[osg-users] Transparency on a drawable
Ulrich Hertlein
u.hertlein at sandbox.de
Fri Jul 11 21:03:43 PDT 2008
Vincent Bourdier wrote:
> I do exactly the same things, on Nodes...
>> stateset->setMode(GL_BLEND, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON );
>> stateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
Are you sure you're doing this last line? It's not in the code snippet you
posted initially...
Cheers,
/ulrich
> double opacity = 0.1;
>
> osg::StateSet* state = mygometry->getOrCreateStateSet();
> state->setMode(GL_BLEND,osg::StateAttribute::ON|
> osg::StateAttribute::OVERRIDE);
> osg::Material* mat = (osg::Material*)state->getAttribute
> (osg::StateAttribute::MATERIAL);
> if(!mat) {
> mat = new osg::Material;
> mat->setAlpha(osg::Material::FRONT_AND_BACK, opacity);
> state->setAttributeAndModes(mat,osg::StateAttribute::ON);
> }
More information about the osg-users
mailing list