Hi,

  I have some solid geometry clipped by some clipping planes in an OSG
application. I am trying to use the capping technique described in chapter
10 of the Red Book using the stencil buffer. I have successfully implemented
this technique in raw OpenGL, but I would like to use it whithin the OSG
application. The technique is based on storing on the stencil buffer the
regions that are "open" and then in a later pass draw a solid color in these
regions.

  I have put the clipped geometry under an osg::Camera node with the stencil
function configured. To do the second pass (the one that draws the caps in
the regions marked in the stencil), I am trying to use a post-draw callback
with the OpenGL calls (saving and restoring the states to avoid breaking
things). The problem is that I need to set the NESTED rendering order to see
all the scene graph, and when I do it, the post-draw callback is not called
anymore.

  I do not have full control over the application, so the solution I am
looking for has to be "transparent" to the rest of the scene graph. I must
activate this behaviour to a group in the scene graph without breaking
anything outside this branch.  What is the best way to do it? camera
post-draw callbacks? rendering bins? any other?

  I am not very familiar with render passes in OSG, so the way I am trying
is probably not the best way. I would appreciate any suggestion, advice or
pointer to any related documentation or source code.


  Thanks in advance.


  Javier Taibo.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to