[osg-users] Slow frame rate in release, gets fixed when viewing stats

2011-03-23 Thread Ramy Gowigati
Hi,

I stumbled across a very weird problem.

I have a pretty big scene and the frame rate is about 7 fps according to the 
stats. When I open the graph in the stats window I see the frame rate go up to 
25 fps. If I remove the stats it goes back down to 7 again.

This only happens when I run the release build from as a standalone 
application. If I run the release from visual studio (F5) I don't see this 
problem. 

Im using OSG 2.8.3. 

Any ideas what can be causing the problem?

Thank you!

Cheers,
Ramy

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=37843#37843





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


Re: [osg-users] ViewDependentShadow massive flickering problems

2011-03-17 Thread Ramy Gowigati
Hi Wojciech ,

Thanks for your reply.

I was browsing the forums a little bit more carefully and I saw you suggestion 
reading links from nvidia and so on. I went on there and for a few days I need 
reading there and reading of the real time rendering books. Indeed PSSM is the 
best optimal method. But I can not get it to work under shaders for some 
reason. Only works in fixed function pipeline. So I am sticking with Lispm 
until I get PSSM working with my shaders.

For flickering they seem to decrease or stop when I make the far distance a 
little smaller. But haven't tested that properly yet to see if it fixes the 
flickering or not. 

For artifacts I preformed the PCF and I got some amazing results. no more 
visible artifacts (still some minor artifacts here and there but very 
acceptable). But I used Gaussian blur for the ground because sometimes the PCF 
can be an overkill for the ground. Blur for ground and PCF for models seem to 
be the best methods to hide most of the artifacts and soften the edges of my 
shadows.

Any help on getting PSSM working using shaders will be appreciated.

Thank you!

Cheers,
Ramy

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=37713#37713





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


Re: [osg-users] ViewDependentShadow massive flickering problems

2011-03-15 Thread Ramy Gowigati
Hi,

Sorry guys, I know this thread hasn't been active for quite sometime, but I am 
also using LightSpacePerspectiveShadowMapVB and im getting flickering and 
artifacts. To be honest I kinda got lost in the replies as to how to fix the 
flickering and artifacts.

I also have a large outdoor scene and used LightSPSM for my shadows. Shadows on 
some buildings are stable, but on others it flickers very fast. my scene is 
almost 1Km x 1Km more or less.

I set the near light distance to something small and far distance to some 
distance beyond the camera, but not too far in the distance (since its a big 
scene).

Reading the thread topic I knew this was my problem also, but I am lost in the 
replies. Any clarifications please? If it helps I'm using OSG 2.8.3.

Thank you!

Cheers,
Ramy

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=37634#37634





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


Re: [osg-users] Does osg Database keep the data in memory and doesn't remove them?

2011-02-23 Thread Ramy Gowigati
Hi Jean,

Ya I was only calling optimize (with DEFAULT option) after I load the entire 
scene, which now explains why the memory goes down a lot. So now I just call 
optimize on each model when I load them, and Im fine.

Now after loading everything, im getting openGL out-of-memory error :D

I'm trying to load the models in PagedLODs. Each model has a high res and low 
res versions. So its 1 PagedLOD per model with low and high res as children. 
But I cant get the PagedLOD to unload the child that is not in use!
I'm playing around with the PagedLOD settings and reading the OSG source code, 
maybe that will lead me to somewhere. 

You got any ideas how to get PagedLOD to unload its children when not in use? I 
thought it was straight forward.. maybe I am missing something?!

Thanks

Ramy

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=37030#37030





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


Re: [osg-users] Does osg Database keep the data in memory and doesn't remove them?

2011-02-22 Thread Ramy Gowigati
Jean, The Optimizer trick worked pretty well! Memory consumption is to a 
minimum now.

Thanks for your help mate!

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=36935#36935





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


[osg-users] Does osg Database keep the data in memory and doesn't remove them?

2011-02-21 Thread Ramy Gowigati
Hi,

I now have quite a big scene with lots of textures apparently. When I load my 
scene the osg Database seem to just store the data until some point in time and 
releases them.

When I load my geometry and textures in, I pass in the following parameters:

osgDB::ReaderWriter::Options* op = new osgDB::ReaderWriter::Options;
op-setObjectCacheHint( osgDB::ReaderWriter::Options::CACHE_NONE );

But as it seems that doesn't do anything, it still caches the data loaded until 
some point in time.

I am asking why, because my application during loading now crashes because its 
exceeding 2GB of memory under 32bits.. If i remove a part of the scene (to make 
it less than 2GB in memory load), the scene gets loaded, I can see it in the 
Task Manager going up to 2GB (or just less) and then decreasing almost to half 
of its size just before rendering.

Why is this happening?

Thank you!

Cheers,
Ramy

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=36910#36910





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


Re: [osg-users] osgWidget::Label::setLabel() does not update the size

2011-02-18 Thread Ramy Gowigati
Hi,

i had a similar problem with the Label not resizing (shrinking). It resized 
properly when the new size was bigger than existing, but it does not want to 
get smaller.

So I just overrided the _calculateSize() in osgWidget::Label and removed the 
two IF statements.

and I must add Im using OSG 2.8.3, im not sure if in future versions that has 
been fixed or not.

Maybe thats your problem?

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=36791#36791





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


Re: [osg-users] osgWidget::Label::setLabel() does not update the size

2011-02-18 Thread Ramy Gowigati
It frustrated me for a few hours trying to fix that. I'm glad its working now. 
:D 

Cheers,
Ramy

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=36807#36807





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


Re: [osg-users] osgShadow texture problem

2011-02-09 Thread Ramy Gowigati
Hi, with some shadow techniques they take base texture unit value, try setting 
that value. Maybe that will help out.

Are you rendering in Shaders or Fixed function pipeline?

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=36488#36488





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


Re: [osg-users] Optimizing scene structure and geometry

2011-01-28 Thread Ramy Gowigati
Hi,

I am in the same stage now, optimizing a shadowed scene that is 1.5M triangles 
big (according to the stats).

I did several optimizations, but still no where near what I am targeting for. 
Its the same, large outdoor scene, but in my case everything is fairly static. 
And the camera navigates around and in some areas the camera can see pretty 
much all the scene, and that is where the performance plummets pretty fast!

I tried to minimize the StateSets in my models when I load them. I simply 
grouped together the geometry that use a common StateSets. That helped in terms 
of StateSet changes and FPS time (I can't find my stats that I wrote down back 
then at the moment).

Also we created LODs on the high res models, that cut down a lot of tri's, but 
still not the performance we want. Something useful I found was to place an 
OcclusionQuery node on my models and hide them out when they are being occluded 
by another building or a small part of them is not shown.

But recently (and the most interesting to me so far), I tried out the nVidia 
nSight tool. I ran my application and it gave me a detailed analysis of the 
OpenGL calls and the min, max and agv. timing they took. So I discovered one of 
the glBindTexture commands took over 3 milliseconds! That was the highest since 
the average was somewhere around 0.5-0.7. Did anybody by any chance use nSight 
and saw how useful it is in the optimizing process? I will play around more on 
this tool and see what I can do.

I hope these suggestions would help if you haven't already tried them. 
Always looking for new optimization techniques :D

Cheers,
Ramy

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=36116#36116





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


Re: [osg-users] does LiSPSM cull the objects in the scene?

2010-11-04 Thread Ramy Gowigati
Thanks for your answer :) I knew you were going to reply :-D

Thanks for your advise, those are the values I am playing with. I was also 
tried to give the ShadowScene the objects I want to cast shadows (by applying 
the castShadowMask on selected objects). that actually worked, but performance 
was still slow.

The problem appears to be that our scene is too big and too complex (in terms 
of tri count). I believe that's where the problem is, scene has a very large 
tri count and the shadow almost doubles it which is an overkill for the GPU. So 
I will look into trying to simplify the scene then having another go.

Are there any shadowing techniques that can help? Or is LiSPSM the best in my 
case?

thanks

ramy

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33460#33460





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


[osg-users] does LiSPSM cull the objects in the scene?

2010-11-03 Thread Ramy Gowigati
Hi,

I have been experimenting with Shadows lately for a pretty large scene I have. 
After reading some posts on the forum I realized I have to go with LiSPSM since 
it was optimized for large scenes.

So I setup LiSPSM, passed in the variables and rendering using shaders. 
Everything seems to be working fine, until I noticed that LiSPSM doesn't seem 
to cull the objects in my scene graph. Even when I am viewing a building or two 
my triangle count is pretty high. If I turn off the shadows I get a much better 
performance and triangle count drops down to whatever there is on the screen.

I have my ShadowScene as a root node, and the models are divided into regions 
and added as children to their respective  regional group.

I noticed in the LiSPSM there is a setMaxFarPlane() parameter. When I set a 
value it seems to only display shadows up to the far plane I specified, however 
the triangle count is still pretty high, almost as much as the entire scene.

Am I missing something to make Shadows cull the models?

Thank you!

Ramy

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33374#33374





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