Hi,
In open inventor, there is a transparency mode called: delayed blend
Transparent objects are rendered using multiplicative alpha blending, in a
second rendering pass with depth buffer updates disabled. And I want to get the
same effect.
here's what I am trying to do
transparency->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
transparency->setAttributeAndModes(new osg::BlendFunc(GL_SRC_ALPHA
,GL_ONE_MINUS_SRC_ALPHA), osg::StateAttribute::ON);
_geom_solid->setStateSet(transparency);
class TransparencyTechnique : public osgFX::Technique
{
public:
TransparencyTechnique() : osgFX::Technique() {}
virtual bool validate( osg::State& ss ) const { return true; }
protected:
virtual void define_passes()
{
osg::ref_ptr<osg::StateSet> ss = new osg::StateSet;
ss->setAttributeAndModes( new osg::ColorMask(true, true, true, true) );
addPass( ss.get() );
ss = new osg::StateSet;
osg::Depth* depth = new osg::Depth;
depth->setWriteMask( false );
ss->setAttributeAndModes( depth, osg::StateAttribute::ON );
addPass( ss.get() );
}
};
The result is not right. how should define_passes() be defined?
...
Thank you!
Cheers,
Tina
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50484#50484
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org