Hi All,

I'm having an interesting problem.  I have a scene with some "world
space" objects (vehicles, terrain, stars ... etc) and some "screen
space" objects (HUD displays, dials, gauges, overlay text ... etc.)  I
based the HUD part of my scene graph on the osghud example, so I have  a
POST_RENDER camera as the root of the screen space half of my scene.
The "world space" objects are in a group node that sits at the same
level as the camera node.

 

I also have a Camera::DrawCallback attached to each of my osgViewer
cameras as a post-draw-callback. 

 

Here's the problem:  

Case 1:  If I leave the camera node set to POST_RENDER, when the draw
callback is called, only the world space objects are visible in the
image that is generated.  At runtime, the scene is visually correct,
with the screen space objects showing up in front of the world space
objects as expected.

 

Case 2:  If I change the camera node to a NESTED_RENDER camera, the draw
callback works correctly (i.e. all world and screen space objects are
visible), but world space objects can be drawn in front of the screen
space objects. 

 

I've tried numerous combinations of render bins, and render orders, and
render order numbers, but I cannot get it to work for both features.

 

Here are my questions:

1.)     Are postDrawCallbacks supposed to be called before the
POST_RENDER camera sub graphs are rendered?

2.)    Is there a way to ensure that the HUD displays are always  drawn
on top of the world space objects and make sure that the
postDrawCallback will be called after they are rendered?

 

 

Thanks In Advance,

Justin

 

  

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

Reply via email to