[osg-users] Fw: Both orthographic and perspective projections for the same camera

2008-12-28 Thread guher b
Hi,
I have resolved the problem, I found out that there is a class which helps 
changing projection, that is osg::Projection which provides different 
projections for the same camera.


--- On Sat, 12/27/08, guher b  wrote:

> From: guher b 
> Subject: [osg-users] Both orthographic and perspective projections for the 
> same camera
> To: osg-users@lists.openscenegraph.org
> Date: Saturday, December 27, 2008, 8:17 PM
> Hi, 
> 
> while trying to implement rtt textures,
> I came a cross a situation that I can not solve in anyway.
> A camera (this camera is  a post render camera (which was
> added to scenegraph) which draws to frame buffer.and
> meanwhile,  the main camera (of the viewer) produces a
> texture (via fbo) that this camera uses to draw to frame
> buffer)
> 
> This camera(post render camera) should draw two different
> geometries; a simple quad, which is used to render a
> textured quad with orthographic projection (to draw the main
> camera's fbo's generated texture in to the frame
> buffer), and secondly a geometry(a sphere) with perspective
> projection to be drawn to the frame buffer afterwards. 
> 
> To handle different projections, I reimplemented the
> drawcallback of the  first geometry (which needed
> orthographic projection) and did nothing for the sphere
> which used the camera's original projection (perspective
> projection). However, when the sphere is visible, sphere is
> not rendered as it should be, the whole scene becomes the
> sphere's color, when the sphere is visible, and nothing
> is drawn when the sphere is not visible. There is no sphere
> shape at all. I belive that the drawcallback of the first
> geometry does something wrong which produces this behavior,
> cause when the drawcallback is not done, the first geom is
> not drawn but the sphere is drawn as it should be. The
> following code shows my drawcallback of the first geometry,
>  class TmpDrawCallback : public osg::Drawable::DrawCallback
> {
> public:
> TmpDrawCallback() :
> osg::Drawable::DrawCallback(){
>   projectionMatrix=new
> osg::RefMatrix(osg::Matrix::ortho(0,1,0,1,0,1));
>   osg::Matrix m;
>   
> m.getLookAt(osg::Vec3d(0,0,0),osg::Vec3d(0,0,-2),osg::Vec3d(0,1,0));
>   modelViewMatrix=new osg::RefMatrix(m);
>   }
> ~TmpDrawCallback() {}
> 
> void drawImplementation
> (osg::RenderInfo& ri, const osg::Drawable* dr) const;
>   osg::RefMatrix * projectionMatrix;
>   osg::RefMatrix * modelViewMatrix;
>   
> 
>   
> 
> };
> void TmpDrawCallback::drawImplementation
> (osg::RenderInfo& ri, const osg::Drawable* dr) const
> {
>   osg::RefMatrix  * originalPm=new
> osg::RefMatrix(ri.getState()->getProjectionMatrix());
>   osg::RefMatrix  * originalMvm=new
> osg::RefMatrix(ri.getState()->getModelViewMatrix());
> 
>   ri.getState()->applyProjectionMatrix(projectionMatrix);
>   ri.getState()->applyModelViewMatrix(modelViewMatrix);
>   
> dr->drawImplementation(ri);
> 
>   ri.getState()->applyProjectionMatrix(originalPm);
>   ri.getState()->applyModelViewMatrix(originalMvm);
> }
> 
> 
> Does anyone see the flaw here? Or, is there any other way
> of implementing 2 different projections for the
> samecamera(without reimplementing the drawcallback)?
> Thanks in advance
> 
> 
> 
> 
> 
>   
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


  
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Both orthographic and perspective projections for the same camera

2008-12-27 Thread guher b
Hi, 

while trying to implement rtt textures,
I came a cross a situation that I can not solve in anyway.
A camera (this camera is  a post render camera (which was added to scenegraph) 
which draws to frame buffer.and meanwhile,  the main camera (of the viewer) 
produces a texture (via fbo) that this camera uses to draw to frame buffer)

This camera(post render camera) should draw two different geometries; a simple 
quad, which is used to render a textured quad with orthographic projection (to 
draw the main camera's fbo's generated texture in to the frame buffer), and 
secondly a geometry(a sphere) with perspective projection to be drawn to the 
frame buffer afterwards. 

To handle different projections, I reimplemented the drawcallback of the  first 
geometry (which needed orthographic projection) and did nothing for the sphere 
which used the camera's original projection (perspective projection). However, 
when the sphere is visible, sphere is not rendered as it should be, the whole 
scene becomes the sphere's color, when the sphere is visible, and nothing is 
drawn when the sphere is not visible. There is no sphere shape at all. I belive 
that the drawcallback of the first geometry does something wrong which produces 
this behavior, cause when the drawcallback is not done, the first geom is not 
drawn but the sphere is drawn as it should be. The following code shows my 
drawcallback of the first geometry,
 class TmpDrawCallback : public osg::Drawable::DrawCallback
{
public:
TmpDrawCallback() : osg::Drawable::DrawCallback(){
projectionMatrix=new 
osg::RefMatrix(osg::Matrix::ortho(0,1,0,1,0,1));
osg::Matrix m;

m.getLookAt(osg::Vec3d(0,0,0),osg::Vec3d(0,0,-2),osg::Vec3d(0,1,0));
modelViewMatrix=new osg::RefMatrix(m);
}
~TmpDrawCallback() {}

void drawImplementation (osg::RenderInfo& ri, const 
osg::Drawable* dr) const;
osg::RefMatrix * projectionMatrix;
osg::RefMatrix * modelViewMatrix;




};
void TmpDrawCallback::drawImplementation (osg::RenderInfo& ri, const 
osg::Drawable* dr) const
{
osg::RefMatrix  * originalPm=new 
osg::RefMatrix(ri.getState()->getProjectionMatrix());
osg::RefMatrix  * originalMvm=new 
osg::RefMatrix(ri.getState()->getModelViewMatrix());

ri.getState()->applyProjectionMatrix(projectionMatrix);
ri.getState()->applyModelViewMatrix(modelViewMatrix);
  
dr->drawImplementation(ri);

ri.getState()->applyProjectionMatrix(originalPm);
ri.getState()->applyModelViewMatrix(originalMvm);
}


Does anyone see the flaw here? Or, is there any other way of implementing 2 
different projections for the samecamera(without reimplementing the 
drawcallback)?
Thanks in advance





  
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgPPU and change in colors

2008-12-20 Thread guher b
Hi,

I found out that my skybox was darkened because of a flaw in my code, my sky 
was alpha blended and the clear color was black which reproduced the darkness 
result in the second example.  I missed the part where I changed clear colors 
when comparing revisions,


Thanks a heap



--- On Fri, 12/19/08, J.P. Delport  wrote:

> From: J.P. Delport 
> Subject: Re: [osg-users] osgPPU and change in colors
> To: stud_in...@yahoo.de, "OpenSceneGraph Users" 
> 
> Date: Friday, December 19, 2008, 5:34 PM
> Hi,
> 
> also check if the geom you are applying the final texture
> to has a white colour, or set the texture mode to
> GL_REPLACE.
> 
> jp
> 
> Art Tevs wrote:
> > Hi,
> > 
> > I would suppose, that your lighting cnditions are
> different. It could be that in one case the scene is lit by
> some lights and in another case there is no lighting (no
> lights in use). Check it out.
> > 
> > Cheers
> > 
> > 
> > --- guher b  schrieb am Fr,
> 19.12.2008:
> > 
> >> Von: guher b 
> >> Betreff: [osg-users] osgPPU and change in colors
> >> An: osg-users@lists.openscenegraph.org
> >> Datum: Freitag, 19. Dezember 2008, 15:17
> >> Hi, I used osgPPU nodekit and I only used
> UnitByPass and UnitOut to only render the scene graph to
> >> fbo  and then finally to framebuffer. In the
> result, my
> >> skybox color has changed color (become darker)
> >> Has anybody else encountered this behaviour
> before?  May
> >> writing the fbo to a texture with viewport
> dimensions (resolution change) cause this behaviour? 
> >> 
> >> 
> >> Thanks in advance
> >> 
> >> 
> >>  
> ___
> >> osg-users mailing list
> >> osg-users@lists.openscenegraph.org
> >>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > 
> > 
> >   ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
> -- This message is subject to the CSIR's copyright
> terms and conditions, e-mail legal notice, and implemented
> Open Document Format (ODF) standard. The full disclaimer
> details can be found at
> http://www.csir.co.za/disclaimer.html.
> 
> This message has been scanned for viruses and dangerous
> content by MailScanner, and is believed to be clean. 
> MailScanner thanks Transtec Computers for their support.
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


  
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Frame buffer object in cull traversal

2008-12-17 Thread guher b
Hi,

Is is possible to use frame buffer objects of opengl without creation of a 
secondary camera in openscenegraph? 

In the single cull traversal phase of the scene graph, I would like to draw one 
specific geode to a FBO and all other geodes to the frame buffer.To do that, in 
the cull traversal of geode (e.g. in user defined cull callback of geode) with 
gl commands, would it be stable to change the render target to a FBO with gl 
command syntax? 

Thanks in advance






  
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] About cpu usage

2008-02-29 Thread guher b
Hi,

I want to render an ive terrain database (which was
originally an openflight database that was converted
to ive). 

In osgViewer, the application has a CPU usage of 50%. 
The database covers 600 km square area with 2048 km
square tiles with 6 level of details. The
georeferenced texture is originally 1 meter resolution
but in the highest lod. The far visibility is 15km.
At total,the database size is 100MB with DX1 textures.
(But the texture resolution was scaled down to %50 in
the highest LOD to minimize the generated database
size, since with %100 texture resolution, 1 gb
database was generated and as a secondary problem, I
couldnot make database pager work in my application to
view the database that was converted to carry paged
lod nodes in it so that 1 gb is not loaded once at all
in loading the database)

Is the terrain database badly formed so that the
application has %50 CPU usage? May be my generated
database settings are incorrect? 
Does exist an CPU usage versus polygon count in
anybody in general?  

Thanks in advance :)
  


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgUtil::cullvisitor

2008-02-25 Thread guher b
Hi,

I am running the application on windows XP and my
graphic card is NVidia Geforce 6600.

I was compiling in debug mode, now I would change the
configuration to release mode. 

Thanks in advance


--- Robert Osfield <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> The cull and draw times you have are appalling slow.
>  Its clear that
> your model is really badly conditioned.  The number
> of transforms and
> geodes etc isn't that high, and shouldn't cause
> things to be that
> slow.
> 
> Hows about some details of the OS, hardware you
> have.  Also are you
> compiling in Release mode??  Doing any benchmarking
> in anything other
> than Release mode is totally pointless as Debug
> builds can easily make
> things 5 to 10 times slower.
> 
> Robert.
> 
> On Mon, Feb 25, 2008 at 4:08 PM, guher b
> <[EMAIL PROTECTED]> wrote:
> > Hi,
> >  I converted the model to an ascii osg file, and
> in the
> >  file, there exists,
> >  -12 groups
> >  -59 matrix transforms some holding totally 20
> >  animationpathcallbacks
> >  -40 geodes
> >  -4 statesets, one of them holding 1 material and
> 1
> >  textureunit and 11 geodes referencing this
> stateset
> >
> >  I tested the model with osgviewer, with 8 models
> the
> >  statistics are as follows,
> >  cull time: 34.5
> >  draw time: 40.5
> >  frame rate:11.5
> >  In this case, the cull time does not increase 5
> ms
> >  with the addition of 1 model. But for 10 models
> viewed
> >  in osgViewer,
> >  cull time: 110.5
> >  draw time: 62.5
> >  frame rate:4.27
> >
> >  yet in my application, when there exist a single
> >  model, on the addition of a second model, the
> cull
> >  time increases  as 5 ms.
> >
> >  Thanks in advance
> >
> >
> >
> >  --- Gordon Tomlinson
> <[EMAIL PROTECTED]>
> >  wrote:
> >
> >
> >
> >  > 5ms for a 1500 polys is a lot,
> >  >
> >  > are there a lot of different textures, colours,
> >  > materials on the models ?,
> >  > large textures sizes ?
> >  >
> >  > Are there degenerate polygons etc.
> >  >
> >  > do you see the same hit is you run osgview with
> one
> >  > of the problematic cases
> >  > ?
> >  >
> >  > Could you post an example of the model the
> exhibits
> >  > the problems
> >  >
> >  > If you run you model through optimize and write
> it
> >  > out as an IVE or even an
> >  > ASCII OSG format do you still see the same hit
> ?
> >  >
> >  >
> >  >
> >  > -Original Message-
> >  > From:
> [EMAIL PROTECTED]
> >  >
> [mailto:[EMAIL PROTECTED]
> >  > On Behalf Of Robert
> >  > Osfield
> >  > Sent: Monday, February 25, 2008 9:25 AM
> >  > To: OpenSceneGraph Users
> >  > Subject: Re: [osg-users] osgUtil::cullvisitor
> >  >
> >  > Hi,
> >  >
> >  > The most common problem with performance is a
> poorly
> >  > conditioned scene
> >  > graph, so this is the place to look first
> rather
> >  > assuming there is a
> >  > problem in the core OSG that needs a major
> rewrite.
> >  >  The OSG is used
> >  > very widely with plenty of people pushing it as
> hard
> >  > if not harder than you
> >  > are and still hitting a solid 60Hz.
> >  >
> >  > Now an increase in cull time of 5ms with adding
> a
> >  > single model is seriously
> >  > out of keeping, so this really needs to be look
> at
> >  > in isolation - what
> >  > exactly is in the model?  What update, cull and
> draw
> >  > times do you get for
> >  > each of these models?
> >  >
> >  > Robert.
> >  >
> >  > On Mon, Feb 25, 2008 at 1:36 PM, guher b
> >  > <[EMAIL PROTECTED]> wrote:
> >  > > Hi,
> >  > >
> >  > >  I am using a standard graphics card for
> todays,
> >  > and  rendering a 100
> >  > > mb (s3tc textured) terrain database.
> >  > >   The cull traversal time increases too much
> when
> >  > I add  animated
> >  > > models (osg model with update callback) 
> (each
> >  > having 1400-1500
> >  > > polygons) to the scene, so that  the frame
> rate
> >  > drops too much. Each
> >  > > addition of model  makes 5 msec increase in
> cull
> >  > traversal time. I
> 

Re: [osg-users] osgUtil::cullvisitor

2008-02-25 Thread guher b
Hi,

I thought that geodes received primitive culling but I
could not find it to close it(now know that there is
no primitive culling, it is left to graphic card),

therefore solution seems to be flattening the model,

Thanks a heaps

--- Brian R Hill <[EMAIL PROTECTED]> wrote:

> OSG already culls the models based on heirarchical
> bounding volumes.
> 
> The complexity of the models is the most likely
> problem. You need to
> understand the model structure and how it impacts
> performance. The applies
> to every stage - update, cull, draw.
> 
> Try running without your terrain or skydome and see
> what the impact of just
> the animation models is.
> 
> 
> Brian
> 
> [EMAIL PROTECTED]
> wrote: -
> 
> 
> To: OpenSceneGraph Users
> 
> From: guher b <[EMAIL PROTECTED]>
> Sent by: [EMAIL PROTECTED]
> Date: 02/25/2008 10:30AM
> Subject: Re: [osg-users] osgUtil::cullvisitor
> 
> Hi,
> I did not want to say that OSG had any problem nor I
> have the power to reimplement it :), sorry if my
> sayings were misunderstood
> 
> I only wanted to ask for advice in solving my
> performance problem due to my models'  (an animated
> person model in osg) complexity. Since this problem
> is
> observed in addition of only 2 models to my
> scenegraph, that means to me that the models have
> some
> problem as a scenegraph leave,
> therefore I wanted to close the culling of the model
> with respect to primitives (if it exists, could not
> find/implement it yet) especially, I wanted that the
> whole model is culled as it was a box, and only the
> presence of the model is tested in being inside the
> viewing frustrum or not, yet could not implement it.
> 
> 
> With a single model viewed in osgViewer I get the
> following times
> 
> cull 4.21
> draw 7.33
> update 1.11
> frame rate 60
> 
> but if that model is added to a scenegraph with a
> skydome and terrain, the problems become magnificent
> for my application,
> 
> I use spatial grouping(quadtrees) but that does not
> solve my problem since if I can have 5 models in the
> viewing frustrum that have to be rendered with
> maximum
> detail, I get drops in frame rate. I might be
> fighting
> with inevitable with my terrain database(maybe that
> node is causing the problems), dont know the source
> of
> my problem yet. I just want to decrease the cull
> time
> without interfering the models , since they are
> program generated models and they seemed complex to
> me.
> 
> Thanks
> 
> 
> --- Robert Osfield <[EMAIL PROTECTED]> wrote:
> 
> > Hi,
> >
> > The most common problem with performance is a
> poorly
> > conditioned scene
> > graph, so this is the place to look first rather
> > assuming there is a
> > problem in the core OSG that needs a major
> rewrite.
> >  The OSG is used
> > very widely with plenty of people pushing it as
> hard
> > if not harder
> > than you are and still hitting a solid 60Hz.
> >
> > Now an increase in cull time of 5ms with adding a
> > single model is
> > seriously out of keeping, so this really needs to
> be
> > look at in
> > isolation - what exactly is in the model?  What
> > update, cull and draw
> > times do you get for each of these models?
> >
> > Robert.
> >
> > On Mon, Feb 25, 2008 at 1:36 PM, guher b
> > <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > >  I am using a standard graphics card for todays,
> > and
> > >  rendering a 100 mb (s3tc textured) terrain
> > database.
> > >   The cull traversal time increases too much
> when
> > I add
> > >  animated models (osg model with update
> callback)
> > >  (each having 1400-1500 polygons) to the scene,
> so
> > that
> > >  the frame rate drops too much. Each addition of
> > model
> > >  makes 5 msec increase in cull traversal time. I
> > tried
> > >  to optimize the cull time with reimplementing
> the
> > cull
> > >  visitor, however, I could not achieve any
> > improvements
> > >  on this issue yet (the problem is that the cull
> > >  visitor takes too much time with the addition
> of
> > >  models, so that the problem is cpu bound, the
> > draw
> > >  time is not bad),  Does anybody know how could
> i
> > carry
> > >  the load from cpu to graphics card in
> > cullvisitor?
> > >
> > >  Thanks a heap
> > >
> > >  Thanks
> > >
&

Re: [osg-users] osgUtil::cullvisitor

2008-02-25 Thread guher b
Hi, 
I converted the model to an ascii osg file, and in the
file, there exists,
-12 groups
-59 matrix transforms some holding totally 20
animationpathcallbacks
-40 geodes
-4 statesets, one of them holding 1 material and 1
textureunit and 11 geodes referencing this stateset

I tested the model with osgviewer, with 8 models the
statistics are as follows, 
cull time: 34.5
draw time: 40.5
frame rate:11.5
In this case, the cull time does not increase 5 ms
with the addition of 1 model. But for 10 models viewed
in osgViewer,
cull time: 110.5
draw time: 62.5
frame rate:4.27

yet in my application, when there exist a single
model, on the addition of a second model, the cull
time increases  as 5 ms.

Thanks in advance 



--- Gordon Tomlinson <[EMAIL PROTECTED]>
wrote:

> 5ms for a 1500 polys is a lot, 
> 
> are there a lot of different textures, colours,
> materials on the models ?,
> large textures sizes ?
> 
> Are there degenerate polygons etc.
> 
> do you see the same hit is you run osgview with one
> of the problematic cases
> ?
> 
> Could you post an example of the model the exhibits
> the problems
> 
> If you run you model through optimize and write it
> out as an IVE or even an
> ASCII OSG format do you still see the same hit ?
> 
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> On Behalf Of Robert
> Osfield
> Sent: Monday, February 25, 2008 9:25 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] osgUtil::cullvisitor
> 
> Hi,
> 
> The most common problem with performance is a poorly
> conditioned scene
> graph, so this is the place to look first rather
> assuming there is a
> problem in the core OSG that needs a major rewrite. 
>  The OSG is used
> very widely with plenty of people pushing it as hard
> if not harder than you
> are and still hitting a solid 60Hz.
> 
> Now an increase in cull time of 5ms with adding a
> single model is seriously
> out of keeping, so this really needs to be look at
> in isolation - what
> exactly is in the model?  What update, cull and draw
> times do you get for
> each of these models?
> 
> Robert.
> 
> On Mon, Feb 25, 2008 at 1:36 PM, guher b
> <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> >  I am using a standard graphics card for todays,
> and  rendering a 100 
> > mb (s3tc textured) terrain database.
> >   The cull traversal time increases too much when
> I add  animated 
> > models (osg model with update callback)  (each
> having 1400-1500 
> > polygons) to the scene, so that  the frame rate
> drops too much. Each 
> > addition of model  makes 5 msec increase in cull
> traversal time. I 
> > tried  to optimize the cull time with
> reimplementing the cull  
> > visitor, however, I could not achieve any
> improvements  on this issue 
> > yet (the problem is that the cull  visitor takes
> too much time with 
> > the addition of  models, so that the problem is
> cpu bound, the draw  
> > time is not bad),  Does anybody know how could i
> carry  the load from 
> > cpu to graphics card in cullvisitor?
> >
> >  Thanks a heap
> >
> >  Thanks
> >
> >
> >
> >
> >   
> >
>
__
> > __
> >  Be a better friend, newshound, and
> >  know-it-all with Yahoo! Mobile.  Try it now.  
> >
>
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> >
> >  ___
> >  osg-users mailing list
> >  osg-users@lists.openscenegraph.org
> >  
> >
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
> > org
> >
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 



  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgUtil::cullvisitor

2008-02-25 Thread guher b
Hi, 
I did not want to say that OSG had any problem nor I 
have the power to reimplement it :), sorry if my
sayings were misunderstood

I only wanted to ask for advice in solving my
performance problem due to my models'  (an animated
person model in osg) complexity. Since this problem is
observed in addition of only 2 models to my
scenegraph, that means to me that the models have some
problem as a scenegraph leave, 
therefore I wanted to close the culling of the model
with respect to primitives (if it exists, could not
find/implement it yet) especially, I wanted that the
whole model is culled as it was a box, and only the
presence of the model is tested in being inside the
viewing frustrum or not, yet could not implement it.  


With a single model viewed in osgViewer I get the
following times 

cull 4.21
draw 7.33
update 1.11
frame rate 60

but if that model is added to a scenegraph with a
skydome and terrain, the problems become magnificent
for my application,

I use spatial grouping(quadtrees) but that does not
solve my problem since if I can have 5 models in the
viewing frustrum that have to be rendered with maximum
detail, I get drops in frame rate. I might be fighting
with inevitable with my terrain database(maybe that
node is causing the problems), dont know the source of
my problem yet. I just want to decrease the cull time
without interfering the models , since they are
program generated models and they seemed complex to
me. 

Thanks


--- Robert Osfield <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> The most common problem with performance is a poorly
> conditioned scene
> graph, so this is the place to look first rather
> assuming there is a
> problem in the core OSG that needs a major rewrite. 
>  The OSG is used
> very widely with plenty of people pushing it as hard
> if not harder
> than you are and still hitting a solid 60Hz.
> 
> Now an increase in cull time of 5ms with adding a
> single model is
> seriously out of keeping, so this really needs to be
> look at in
> isolation - what exactly is in the model?  What
> update, cull and draw
> times do you get for each of these models?
> 
> Robert.
> 
> On Mon, Feb 25, 2008 at 1:36 PM, guher b
> <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> >  I am using a standard graphics card for todays,
> and
> >  rendering a 100 mb (s3tc textured) terrain
> database.
> >   The cull traversal time increases too much when
> I add
> >  animated models (osg model with update callback)
> >  (each having 1400-1500 polygons) to the scene, so
> that
> >  the frame rate drops too much. Each addition of
> model
> >  makes 5 msec increase in cull traversal time. I
> tried
> >  to optimize the cull time with reimplementing the
> cull
> >  visitor, however, I could not achieve any
> improvements
> >  on this issue yet (the problem is that the cull
> >  visitor takes too much time with the addition of
> >  models, so that the problem is cpu bound, the
> draw
> >  time is not bad),  Does anybody know how could i
> carry
> >  the load from cpu to graphics card in
> cullvisitor?
> >
> >  Thanks a heap
> >
> >  Thanks
> >
> >
> >
> >
> >  
>

> >  Be a better friend, newshound, and
> >  know-it-all with Yahoo! Mobile.  Try it now. 
>
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> >
> >  ___
> >  osg-users mailing list
> >  osg-users@lists.openscenegraph.org
> > 
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 



  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgUtil::cullvisitor

2008-02-25 Thread guher b
Hi,

I am using a standard graphics card for todays, and
rendering a 100 mb (s3tc textured) terrain database.
 The cull traversal time increases too much when I add
animated models (osg model with update callback) 
(each having 1400-1500 polygons) to the scene, so that
the frame rate drops too much. Each addition of model
makes 5 msec increase in cull traversal time. I tried
to optimize the cull time with reimplementing the cull
visitor, however, I could not achieve any improvements
on this issue yet (the problem is that the cull
visitor takes too much time with the addition of
models, so that the problem is cpu bound, the draw
time is not bad),  Does anybody know how could i carry
the load from cpu to graphics card in cullvisitor?

Thanks a heap 

Thanks




  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::DatabasePager and paged lod database

2008-01-18 Thread guher b
Hi,
I removed the databasepager part from the code and
still osgViewer can not view the database.  Can it be
related to my graphic card that supports two monitors?



thanks a heap
--- Robert Osfield <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> osgViewer::Viewer/CompositeViewer all have the
> DatabasePager built
> into them, and will automatically run the database
> pager thread on
> demand and take care of all the operations required
> to manage a paged
> database.  So adding a DatabasePager to osgViewer
> would be rather
> counter productive.
> 
> Robert.
> 
> On Jan 17, 2008 12:12 PM, guher b <[EMAIL PROTECTED]>
> wrote:
> > Hi,
> >
> > I would like to view a pagedlod database that has
> one
> > pagedlod child via osgViewer(both the master file
> and
> > the paged lod file's are in osg format).
> >  I add database pager to osgViewer, yet the paged
> > database could not be viewed in the viewer.The non
> > paged lod database (in flt format) can be viewed
> > without any problems. Has anybody else encountered
> > this problem?
> >
> > I think that the paged lod database I have
> generated
> > from openflight database(via a code I have found
> from
> > this mailing list, which don't seem to have any
> flaws
> > in it) is not valid. However, i can not  see any
> > problem in the files. And, the viewer can not view
> the
> > database.
> > The general structure of the paged lod database
> master
> > file is,
> >
> >
> > Group {
> >   DataVariance UNSPECIFIED
> >   name "SomeNode"
> >   nodeMask 0x
> >   cullingActive TRUE
> >   num_children 1
> >   Group {
> > DataVariance UNSPECIFIED
> > name "g0"
> > nodeMask 0x
> > cullingActive TRUE
> > num_children 1
> > Group {
> >   DataVariance UNSPECIFIED
> >   name "g0"
> >   nodeMask 0x
> >   cullingActive TRUE
> >   num_children 1
> >   Group {
> > DataVariance UNSPECIFIED
> > name "g1"
> > nodeMask 0x
> > cullingActive TRUE
> > num_children 1
> > PagedLOD {
> >   DataVariance UNSPECIFIED
> >   nodeMask 0x
> >   cullingActive TRUE
> >   Center 13806.9 24056.3 1079.8
> >   Radius 964.735
> >   RangeMode DISTANCE_FROM_EYE_POINT
> >   RangeList 1 {
> > 0 5000
> >   }
> >   NumChildrenThatCannotBeExpired 0
> >   FileNameList 1 {
> > flight0_0.osg
> >   }
> >   num_children 0
> > }
> >   }
> > }
> >   }
> > }
> >
> > Do you see any problems?
> >
> > Thanks in advance
> >
> >
> >
> >  
>

> > Never miss a thing.  Make Yahoo your home page.
> > http://www.yahoo.com/r/hs
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> >
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osg::DatabasePager and paged lod database

2008-01-17 Thread guher b
Hi,

I would like to view a pagedlod database that has one
pagedlod child via osgViewer(both the master file and
the paged lod file's are in osg format).
 I add database pager to osgViewer, yet the paged
database could not be viewed in the viewer.The non
paged lod database (in flt format) can be viewed
without any problems. Has anybody else encountered
this problem? 

I think that the paged lod database I have generated
from openflight database(via a code I have found from
this mailing list, which don't seem to have any flaws
in it) is not valid. However, i can not  see any
problem in the files. And, the viewer can not view the
database. 
The general structure of the paged lod database master
file is, 


Group {
  DataVariance UNSPECIFIED
  name "SomeNode"
  nodeMask 0x
  cullingActive TRUE
  num_children 1
  Group {
DataVariance UNSPECIFIED
name "g0"
nodeMask 0x
cullingActive TRUE
num_children 1
Group {
  DataVariance UNSPECIFIED
  name "g0"
  nodeMask 0x
  cullingActive TRUE
  num_children 1
  Group {
DataVariance UNSPECIFIED
name "g1"
nodeMask 0x
cullingActive TRUE
num_children 1
PagedLOD {
  DataVariance UNSPECIFIED
  nodeMask 0x
  cullingActive TRUE
  Center 13806.9 24056.3 1079.8
  Radius 964.735
  RangeMode DISTANCE_FROM_EYE_POINT
  RangeList 1 {
0 5000
  }
  NumChildrenThatCannotBeExpired 0
  FileNameList 1 {
flight0_0.osg
  }
  num_children 0
}
  }
}
  }
}

Do you see any problems?

Thanks in advance



  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org