[osg-users] Transparency on a drawable

Vincent Bourdier vincent.bourdier at gmail.com
Fri Jul 11 06:14:57 PDT 2008


Hi Stephan

Yes GL_BLEND is on :

osg::StateSet* state = g->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, alpha);
>     state->setAttributeAndModes(mat,osg::StateAttribute::ON);
>     state->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
>     state->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
>



2008/7/11 Stephan Maximilian Huber <ratzfatz at digitalmind.de>:

> Hi,
>
> Vincent Bourdier schrieb:
>
>> Lightning is already set to ON...
>>
>> But nothing appear transparent...
>>
> is GL_BLEND enabled? a.ka. state->setMode(GL_BLEND,
> osg::StatetAttribute::ON);
>
> cheers
> Stephan
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080711/f1ade5c6/attachment-0003.htm>


More information about the osg-users mailing list