Hi!

Before removing some nodes, I want them to fade out. So I want them to be rendered transparently for a short time, after they have been opaque most of their lifetime. I achieve this by setting the node's state as follows when the fadeout starts (omitting blend func constant details etc.):

state_set->setAttribute(new osg::BlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA));
state_set->setRenderBinDetails(BN_TRANSPARENT, "DepthSortedBin");
state_set->setMode(GL_BLEND, osg::StateAttribute::ON);
state_set->setAttribute(new osg::Depth(osg::Depth::LESS, 0,1,false));


The problem is that the osg::Depth state seems to leak out and affect every rendered node while the fade-out is in effect. After the node is removed from the scenegraph, everything is back to normal.

If I set the osg::Depth state right from the start when creating the node (and before rendering for the first time), I get the expected results, without state leakage (but obviously z-buffering doesn't work for the node).

Is there something general I'm doing wrong, or is it rather something specific to the way I build my scene graph? Perhaps some information has to be rebuilt after changing state attributes, which doesn't happen automatically? At the moment I'm clueless where to start. I'm using OSG 2.2.

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

Reply via email to