[osg-users] Disabling rendering

2010-01-14 Thread Guy Volckaert
This might sound like an odd question, but is there a way to disable rendering 
(no culling and no draw) while still allowing intersections. The reason why I 
am asking is because I have a distributed system - i.e. some applications only 
performs  intersections with the scene without rendering it. In addition, the 
osg update call must still occur since that's where some of my animation states 
gets uptate, which will change the outcome of intersection results (like 
sprites).

Cheers,
Guy

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





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


Re: [osg-users] Disabling rendering

2010-01-14 Thread Jean-Sébastien Guay

Hi Guy,


This might sound like an odd question, but is there a way to disable rendering 
(no culling and no draw) while still allowing intersections. The reason why I 
am asking is because I have a distributed system - i.e. some applications only 
performs  intersections with the scene without rendering it. In addition, the 
osg update call must still occur since that's where some of my animation states 
gets uptate, which will change the outcome of intersection results (like 
sprites).


Intersections are completely separate from cull and draw, so you can 
always do intersections even if no rendering is happening.


But the hard part is getting the update visitor to run on your subgraph 
but not the cull visitor (the results of the cull visitor are used for 
rendering, so if the cull visitor doesn't run on a subgraph then that 
subgraph will not be rendered). There's a few ways to do it, I guess I 
would do that with a cull callback set on the root node of the subgraph 
you don't want to render, and which doesn't call traverse(node, nv);. 
That way the cull traversal will stop there for that subgraph, and won't 
visit the children. But since there's no similar update callback, the 
update traversal will traverse the whole thing.


Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Disabling rendering

2010-01-14 Thread Paul Martz

Guy Volckaert wrote:

This might sound like an odd question, but is there a way to disable rendering 
(no culling and no draw) while still allowing intersections. The reason why I 
am asking is because I have a distributed system - i.e. some applications only 
performs  intersections with the scene without rendering it. In addition, the 
osg update call must still occur since that's where some of my animation states 
gets uptate, which will change the outcome of intersection results (like 
sprites).


If using osgViewer, don't call viewer.frame(). If you still want the 
update traversal, run the UpdateVisitor by hand.

   -Paul


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


Re: [osg-users] Disabling rendering

2010-01-14 Thread Guy Volckaert
Paul. Thanks for the advice. 

What I ended-up doing is overriding the void ViewerBase::frame(double 
simulationTime) function. Depending on the state of a rendering flag, I either 
call or don't call the renderingTraversals() function.

Hopefully, that won't cause any other issues.

Cheers,
Guy

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





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