turn off depth testing something like this:

camera_->setViewport( 0, 0, image_->s(), image_->t() );
camera_->setRenderTargetImplementation( osg::Camera::FRAME_BUFFER_OBJECT );

// *** this is also pretty key ** 
camera_->setRenderOrder( osg::Camera::PRE_RENDER, 1 );

camera_->attach( osg::Camera::COLOR_BUFFER, texture_.get() );

camera_->setClearMask( GL_COLOR_BUFFER_BIT ); // do not want to clear bg image
camera_->setReferenceFrame( osg::Transform::ABSOLUTE_RF );
camera_->setViewMatrix( osg::Matrix::identity() );

// *** make sure depth is off ***
camera_->getOrCreateStateSet()->setMode( GL_DEPTH_TEST, 
osg::StateAttribute::OFF );




________________________________
From: Carlos Sanches <[email protected]>
To: OpenSceneGraph Users <[email protected]>
Sent: Friday, July 3, 2009 2:22:27 PM
Subject: Re: [osg-users] Background image

no, I m using hud   but my 3d objects are behind the hud.
I want  my 3d objets in front of hud .



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

Reply via email to