Thanks for reply. Below is my code creating the HUD node. You could see it is almost the same with the osgHud example.

    m_hudNode = new CCAuxHUDNode;//I subclassed CameraNode to put my HUD things (text, background, etc)
                                                         // inside the class. nothing else.
    m_hudNode->CreateHUD(m_viewWidth, m_viewHeight);

    m_hudNode->setProjectionMatrix(osg::Matrix::ortho2D(0, m_viewWidth, 0, m_viewHeight));
    m_hudNode->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
    m_hudNode->setViewMatrix(osg::Matrix::identity());

    m_hudNode->setClearMask(GL_DEPTH_BUFFER_BIT);
    m_hudNode->setRenderOrder(osg::CameraNode::POST_RENDER);
    m_hudNode->setComputeNearFarMode(osg::CullSettings::ComputeNearFarMode::DO_NOT_COMPUTE_NEAR_FAR);

DO_NOT_COMPUTE_NEAR_FAR is not for the HUD. It's for the rest of my scene, as you could see in my last email's attachment. Having the feeling that computing near/far for HUD will alter near/far range for the rest of my scene, although this could be completely wrong....

On 8/8/06, Robert Osfield <[EMAIL PROTECTED]> wrote:
Hi Yanling,

You seem to be fighitng the API.  For HUD's you really shouldn't need
to mess around with the compute near far too much - simply disable the
depth test, or do a depth clear at the begining of the HUD.

Robert.

On 8/8/06, Yanling Liu <[EMAIL PROTECTED]> wrote:
> Hi, just want you to know when using Fox toolkit 1.6.6 with
> Producer::RenderSurface and osgUtil::SceneView, there may be a problem with
> HUD.....
>
> I have created a CameraNode for HUD following the osgHud example. I have to
> manually set
>
> m_hudNode->setComputeNearFarMode(osg::CullSettings::ComputeNearFarMode::DO_NOT_COMPUTE_NEAR_FAR);
>
> otherwise the near/far limit won't be correct and triangles close together
> will be rendered incorrectly. Please see attached z_buffer.gif.
>
> Here is the history of the HUD problem I have encountered..
>
> 1. osg 0.9.9, created HUD using Projection and MatrixTransform, no problem
> at all
> 2. osg 1.0, created HUD using CameraNode, has to set
> DO_NOT_COMPUTE_NEAR_FAR, otherwize broken trackball control (after you move
> scene behind the camera, you cannot move it back)
> 3. osg 1.1, created HUD using CameraNode, need to switch from FXGlcanvas to
> Producer::RenderSurface, otherwise a black window will be shown when using
> HUD, also has to set
> DO_NOT_COMPUTE_NEAR_FAR, otherwise there is rendering problem related to
> z-buffer (z-buffer range too large to correctly render closer triangles).
>
> Tired with the HUD thing... It may be a compatibility problem with sceneview
> and fox toolkit...
>
> Regards,
> Yanling
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to