>2) There is some sort of state leakage (of my shader) issue
> between sibling nodes. If this is leakage - is it a bug or not?
If an app has a custom node that is altering OpenGL state outside of OSG,
then another custom node is needed, as a counterpart, to undo that
special state.
So those two nodes would form two sub-trees: specially-rendered and
normally-rendered.
For debugging state problems, you could splice in a debug node
that directly queries OpenGL state.
Eg, black color can be caused by RGBA(0,0,0,0) persisting,
a light src positioned incorrectly, etc.
class DebugDrawable : public osg::ShapeDrawable
{
public:
virtual void drawImplementation( osg::RenderInfo& renderInfo ) const
{
cerr << "HACK lighting " << int(glIsEnabled(GL_LIGHTING)) <<
endl;
}
};
osg::ref_ptr<DebugDrawable> drawable = new DebugDrawable;
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
geode->addDrawable( drawable.get() );
geode->setCullingActive( false );
transformNode->addChild( geode.get() );
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org