[osg-users] Transparency problem

Panagiotis Papadakos papadako at csd.uoc.gr
Wed Sep 26 09:56:37 PDT 2007


Hello everybody.

I have a transparency problem which you can see in the attached 
image. As you can see the strings rendered on the orange window, which is 
in front of another blue window, have a blue outline from the blue window 
behind. The strings are in front of a semi-transparent rectangle in front 
of the semi-transparent window. What might be happening?

I use the following statesets for the windows

         stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::OVERRIDE);
         stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
         stateSet->setMode(GL_BLEND, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);

         osg::ref_ptr <osg::Depth> depth = new osg::Depth;
         depth->setFunction(osg::Depth::LESS);
         stateSet->setAttribute(depth.get());

         osg::ref_ptr<osg::BlendFunc> blendFunction = new osg::BlendFunc;
         blendFunction->setFunction(osg::BlendFunc::SRC_ALPHA,osg::BlendFunc::ONE_MINUS_SRC_ALPHA);
         stateSet->setAttributeAndModes(blendFunction.get());

         stateSet->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);

 	stateSet->setRenderBinMode(osg::StateSet::OVERRIDE_RENDERBIN_DETAILS);


Thank in advance!

 	Panagiotis Papadakos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transparency_problem.png
Type: application/octet-stream
Size: 66574 bytes
Desc: 
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070926/f0d1c87d/attachment-0002.obj>


More information about the osg-users mailing list