Thanks for the reply Paul. I did what you said but I don't see anything
really wrong.
Each object is its own node so the Drawable/Geometry is separate.
However a particular shape may be referenced thru a transform more than
once. In other works I use a library of objects and place them through
transforms multiple times. Could it be the last reference is applied to
all?
I think my StateSets are setup much like the samples, except I have
lighting turned ON. I can see any difference if I turn it off though.
All my translucent StateSets are setup as follows. The colors change
but the rest is the same.
osg::Vec4 auxClr( 0.5f, 0.5f, 0.5f, 0.4f );
osg::Material* auxMat = new osg::Material();
auxMat->setAmbient( osg::Material::FRONT_AND_BACK, auxClr );
auxMat->setDiffuse( osg::Material::FRONT_AND_BACK, auxClr );
auxMat->setSpecular( osg::Material::FRONT_AND_BACK, osg::Vec4(1,
1, 1, 1));
auxMat->setShininess( osg::Material::FRONT_AND_BACK, 64.0f);
osg::StateSet* auxSS = new osg::StateSet();
auxSS->setAttributeAndModes(auxMat, osg::StateAttribute::ON
| osg::StateAttribute::OVERRIDE );
auxSS->setRenderingHint( osg::StateSet::TRANSPARENT_BIN
| osg::StateAttribute::OVERRIDE );
auxSS->setMode( GL_BLEND, osg::StateAttribute::ON
| osg::StateAttribute::OVERRIDE );
auxSS->setMode( GL_LIGHTING, osg::StateAttribute::ON
| osg::StateAttribute::OVERRIDE );
auxNode->setStateSet(auxSS);
Greg
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Martz
Sent: Wednesday, April 18, 2007 3:31 PM
To: 'osg users'
Subject: RE: [osg-users] translucent objects disappear
Sounds like you either didn't set the rendering hint for transparency,
or all your geometry is within a single Drawable/Geometry object, or
both. As a result, some of your geometry is losing the depth test to
other geometry.
To set the render hint correctly, try searching the example code for
"setRenderingHint".
Once that's set, any geometry that could be in front of or behind other
transparent geometry must be separated out from each other and placed in
their own individual Drawables.
Then it should work.
-Paul
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Netschke,
Greg
Sent: Wednesday, April 18, 2007 3:10 PM
To: osg users
Subject: [osg-users] translucent objects disappear
I have a scene where I have translucent objects inside of
translucent object. This causes the interior objects to disappear
entirely. If I hide the containing translucent object, then the
interior ones show just fine.
This is only some of the contained objects. Other contained
objects show just fine. As I rotate the view, objects are flashing in
and out.
Any ideas what is causing this?
I attached a couple of small images to show what I mean.
Thanks,
Greg
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/