Hi Chris

now I have the following settings:

ref_ptr<BlendFunc> blfSky = new BlendFunc(BlendFunc::SRC_ALPHA, BlendFunc::ONE_MINUS_SRC_ALPHA); // sets the state set of the OSG node for the sky and sets the states
   ref_ptr<StateSet> stateSky = geoSky->getOrCreateStateSet();
   stateSky->setAttributeAndModes(blfSky);
stateSky->setMode(GL_BLEND, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
   stateSky->setRenderingHint(StateSet::TRANSPARENT_BIN);

but there is no transparency. Even with the setRenderBinDetails(1, "DepthSortedBin"); enabled it doesn't work.

I added a material like this:

   // creates a new material for the sky
   ref_ptr<Material> material = new Material;
   material->setAlpha(Material::FRONT_AND_BACK, 0.5);
stateSky->setAttributeAndModes(material, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);

Now there is some transparency, but now also the clouds are half transparent, this is not whati want. Any idea?

Regards
Dominic

Chris 'Xenon' Hanson schrieb:
On 12/11/2009 10:15 AM, Dominic Stalder wrote:
How can I set the state to include transparency?

  Here's an example:
http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2009-June/029244.html

  You might be able to skip the rendering hint, and the backface cull will 
probably be
beneficial to you.


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

Reply via email to