Hi all, I'm currently working on extensions to our existing application to allow us to render several (as in 100+) lights in a single scene and (hopefully) maintain usable framerates. Currently I'm using a cull callback to create multiple RenderStages so that the lights can be additively blended into the image after the initial rendering pass with a global light (like in the osgmanylights example). Since the lights are all spot lights, the first optimization I used was to render a cone into the stencil buffer so that only the pixels that could possibly be affected by the light were re-rendered. This actually (I think) exposed a bug in CullVisitor's handling of StateSets, but that'll be the subject of another e-mail once I've gotten a simpler example coded up to show what happens...
The next step I want to take is to use this cone geometry (or even the cone's bounding box/sphere) as a pre-processing step to eliminate portions of the scene graph that won't be affected by the light as well (since the Stencil buffer test means that the geometry gets all the way to the raster stage before it's discarded). I'd like some advice as how to tackle this in a fashion that fits in with the 'OSG' way to do things. :) My initial thoughts were to do something like inherit IntersectionVisitor, but then should this new Visitor return a new subgraph of the nodes that will be affected by the lighting pass? Or should it do something like change the nodemasks of the nodes so that, by modifying the CullVisitor's traversal mask, only the nodes that could be lit in the lighting pass will be visited? Or should I just screw with the frustum/polytope of the CullVisitor somehow to make it a reasonable approximation of the cone's bounding box? I didn't see any option to be able to specify a bounding volume for a CullVisitor, but I'd be happy to know that I'd overlooked something like that... So can someone set me straight? Am I heading in completely the wrong direction here? Thanks! -Chris B _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org