So... I need to attach instead to setCullCallback?

I'm looking in ViewerBase and I see the order is event, update, & rendering, and Rendering calls "renderer->cull()".  I need to be after a completed cull, but before rendering actually starts (or at least as early into rendering as I can get).  Could/should I register what I want as a custom "operation"?  Or is this the job of the Camera's PreDrawCallback?

Basic requirements:
 * Run once per frame (in a system with multiple viewers & contexts per frame)
 * After Cull (so I have a valid znear/zfar estimate for the frame), but before/during the Render
 * I will not be modifying the scenegraph, only reading data & shipping it elsewhere




March 29, 2013 10:09 AM
Hi Randall,



These will be valid for the previous frame as the cull traversal happens after the update traversal.

Robert.
March 29, 2013 9:55 AM
I'm currently using the viewer.getCamera()->setUpdateCallback() to assigna custom callback that does stuff on a per-frame basis.  Is it safe to retrieve the camera->getRenderer()->getSceneView(0)->getCullVisitor()->getCalculatedNear/FarPlane() ?  are those values valid and available at that point?




March 29, 2013 9:35 AM
Hi Randall,


The CullVisitor computes and maintains the near/far values when these need computing.  Have a look at osgUtil::CullVisitor.

Robert.
March 29, 2013 9:18 AM
Well, I want to do it "in" the frame.. Basically, I'm hoping to get OSG to do the scene traversal for culling, etc, then read the znear/zfar values to be sent elsewhere while the geometry is pushed down the pipe.  I don't need perfectly accurate znear/far, just the bounding box estimates.






March 24, 2013 4:05 PM
Hi Randal,

it is easy ..... somewhere in the loop, probably after the frame all you have to do is to get the projection matrix like

while (!viewer.done())
{
viewer.frame();
viewer.getCamera()->getProjectionMatrixAsFrustum(arguments .... )




--
trajce nikolov nick

--
Randall Hand
www.yeraze.com
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to