Hi,

LispSM works well with directional infinite lights. So I assume you are using this type of light. With inifinite light objects casting shadows can be far outside visible area. So the viewing frustum for shadow camera is usually larger than view frustum of the camera where shadows are cast. You may try to limit the near and far plane of shadow camera by setting Lispsm setMinLightMargin and setMaxFarPlane. setMinLightMargin defines the distance behind main viewer from which shadows can be cast. It of course depends on light angle, but if you have large buildings then their shadows can cover far located views, but if objects in your scene are small you may set minFarLightMargin to small value.
Cheers,
Wojtek

-----Original Message----- From: Ramy Gowigati
Sent: Wednesday, November 03, 2010 12:16 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] does LiSPSM cull the objects in the scene?

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
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to