[osg-users] Transparency on a drawable

Paul Martz pmartz at skew-matrix.com
Fri Jul 11 06:51:58 PDT 2008

This has been discussed multiple times, have you tried searching the
archives for "transparent" or "blend"? There are also several examples that
show how to do this. Try doing a recursive, case-insensitive grep on your
OSG source tree for "transparent".
The rules for transparency in OSG are not different from those of OpenGL. Do
it just like you would in OpenGL, except use the StateSet setRenderingHint
to control render order.


From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Vincent
Sent: Friday, July 11, 2008 6:54 AM
To: osg
Subject: Re: [osg-users] Transparency on a drawable

No one have any idea of how to set an alpha transparency level on a geometry
It has no texture, juste one color...




2008/7/11 Vincent Bourdier <vincent.bourdier at gmail.com>:

Hi All,

Just a simple question on how to set a transparency effect on a drawable.

My geode contains 2 drawables, and I need only one to be transparent... 

I've tried : 

double opacity = 0.1;

    osg::StateSet* state = mygometry->getOrCreateStateSet();
    osg::Material* mat =
    if(!mat) {
        mat = new osg::Material;
        mat->setAlpha(osg::Material::FRONT_AND_BACK, opacity);

Lightning is already set to ON...

But nothing appear transparent...



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080711/ca7979bf/attachment-0003.htm>

More information about the osg-users mailing list