Hi Ulrich
thanks for help.
I use/try this code for the moment :
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);
But nothing appear transparent...
Regards,
Vincent
2008/7/12 Ulrich Hertlein <[EMAIL PROTECTED]>:
> 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);
>> }
>>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org