----- From: Ulrich Hertlein at 2008-11-30 11:17-----
On 30/11/08 9:17 AM, Steven Saunderson wrote:
> If I setComputeNearFarMode to DO_NOT_COMPUTE_NEAR_FAR the HD background
> (white in my case) appears but not the black text.

Have you set correct near/far values? Maybe your text is clipped by the near plane?

I've just tried this (and other tests). The HUD code has a Geode as the parent for the Geometry (background) and Text (foreground). This Geode has a StateSet that should do what I want but doesn't. If I also attach this StateSet to the Text everything works. I thought the Text would be affected by inheritance but apparently not. Perhaps Text has a default StateSet that stops inheritance. So, the good news is that this is now working.

> Also, the HUD relies on the scene lighting. This means that when I
> reduce/disable the scene lights the HUD also fades to black.

Disable lighting for the HUD subgraph:
stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF);

Brilliant, thank you very much. I wouldn't have realised this from reading my OpenGL book. Presumably LIGHTING OFF means the colour displayed is that specified with no modification. This is much better than adding a light to the HUD (just tried and it works) because lights are a limited resource.

Thanks,
Steven

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

Reply via email to