[osg-users] transparency becomes dark

Dieter Pfeffer dieter.pfeffer at nl.thalesgroup.com
Wed Jul 30 05:08:53 PDT 2008

Thanks Ulrich and Dimi

I supposed that it has s.th to do with the missing material paramters; my
idea was to change the original material of the node, therefore I set:

osg::StateSet *ss = loadedModel ->getOrCreateStateSet();
osg::Material* blendMaterial =

but the material is always NULL so I don't have the original material

Is this the wrong function call ?


Unclassified Mail

-----Original Message-----
From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org]On Behalf Of Ulrich
Sent: Saturday, 26 July, 2008 08:08
To: OpenSceneGraph Users
Subject: Re: [osg-users] transparency becomes dark

Hi Dieter,

Dieter Pfeffer wrote:
> I am trying to set the object transparency from 1.0 -> 0.0 and vice versa;
> but when I start changing the alpha of the material the object becomes
> dark.
> I have changed the material parameters but without success; when I look
> in the loaded model (for example cow.osg) for material, the material is
> always null.
> I have modified the osgviewer example and attached it.
> Could s.o. give me a hint what I am doing wrong ?

You're creating a new Material that overrides the material of the node
fading.  However, you're not setting the Material properties (ambient,
specular, emissive, shininess) and the default values for Material are
to match that of the node you're trying to blend.  Hence when you override
original material it will switch from the original settings to the default

For an experiment, have a look at any .osg file and look at the material
properties.  Then set those values on the 'blendMaterial' node you're
and it should look smooth.

You're probably better off modifying the original Material(s) of the node
hierarchy.  Or try another approach, like using blendcolor.


osg-users mailing list
osg-users at lists.openscenegraph.org


This e-mail may contain confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please 
notify the sender and delete this e-mail. Any unauthorized copying, disclosure
or distribution of the material in this e-mail is strictly forbidden.

Considering the inherent risks of the use of e-mail communication, 
Thales Nederland BV shall not be liable for any damage derived from it. 

Thales Nederland BV is seated in Hengelo (Ov.), the Netherlands, 
and registered at the Chamber of Commerce under number 06061578.

More information about the osg-users mailing list