On 5/16/2011 6:07 AM, Wojciech Lewandowski wrote:
Hi Paul,
What I know for certain is this: all shadow techniques stemming from
ViewDependentShadowTechnique (StandardShadowMap, MinimalShadowMap, LispSM) are
not compatible with nested cameras. And its a design flaw. Basically all these
techniques allocate resources per View and views are recognized and indexed by
cull visitor pointer. Unfortunately cull visitor of the view main camera also
traverses nested cameras, so this means these nested cameras will use the same
resources as main view camera.
I understand. I encountered the same issue in an early prototype version of what
eventually became OcclusionQueryNode.
Since the shadow map depends on the camera
view/projection, obiously shadowmaps, projection and texgen settings will not
work correctly for nested cams.
Right, because (in the nested case), the CullVisitor address index looks up the
wrong values. You get results, you just get the wrong results.
So I always recommended using Slaves cameras
instead of Nested cams because they have their own CullVisitors. If I would
design this today, instead of CullVisitor I would probably use RenderStage to
index view resources.
Understood. This is ViewerBase::RenderingTraversals, where it calls
renderer->cull(). That's implemented internally with SceneView::cull().
I am however, not sure if I agree with your diagnosis on basic ShadowMap
problem. Even if shadow map was rendered only once it should work well for both
main and nested camera. Thats because ShadowMap projection does not depend on
parent camera view or projection.
I came to the same conclusion after I slept on this Friday night. One pass to
create the shadow map should be sufficient.
-Paul
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org