Hi Vincent,

The code you supply just relates to OpenGL state, it doesn't affect
scene graph level culling at all.  To disable the scene graph culling
you simply do:

  node->setCullingActive(false);

Robert. 

On 12/2/08, Vincent Bourdier <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Still me and my rendering problems :
>
> I just need to set a node to be always rendered (or not).
> It needs to not depend on the Zbuffer/culling.
>
> Maybe I am confuse, but I have tried this :
>
> *osg::ref_ptr<osg::StateSet> state = node->getOrCreateStateSet();*
>> *        state->setMode(GL_CULL_FACE, osg::StateAttribute::ON);*
>> *        osg::ref_ptr<osg::Depth> depth;*
>> *        if(set){*
>> *            depth = new osg::Depth(osg::Depth::ALWAYS, 0.0, 1.0);*
>> *            state->setMode(GL_CULL_FACE, osg::StateAttribute::OFF);*
>> *            node->setCullingActive(false);*
>> *        }else{*
>> *            depth = new osg::Depth(osg::Depth::LEQUAL, 0.0, 1.0);*
>> *            state->setMode(GL_CULL_FACE, osg::StateAttribute::ON);*
>> *            node->setCullingActive(true);*
>> *        }*
>> *            *
>> *        state->setAttributeAndModes(depth.get(),
>> osg::StateAttribute::ON);*
>
>
> Nothing changes at the screen...
>
> If I put a node always rendered, is there some "limits" to that ? (node will
> be culled if frustum far plane cut it... or anything similar )
> if not, there is a real mistake is my code... and if it is right... that
> will complicate my work :-(
>
> Thanks.
>
> Regards,
>    Vincent.
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to