Re: [Plib-users] transparent material with texture ?
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2001-05-11 13:04:26
|
Marc Escher wrote: > I'm trying to render an object with a bmp texture (no alpha) and a > tranparent material associated to it, but I can't get the material > properties to be mixed with the texture. The object is displayed with > the texture but with no transparency or any color for the material. What > is the right way to do it ? You are using setColourMaterial (GL_AMBIENT_AND_DIFFUSE) - which tells the system to use the *polygon* colour for the Ambient and Diffuse component of the lighting and to use the setMaterial settings only for the remaining components (Specular and Emission). Now, one of the oddities of OpenGL (and hence of SSG) is that the Alpha produced by this process is ALWAYS the alpha of the DIFFUSE component... which in this case (because of the setColourMaterial) is coming from the polygon itself. So, you either need to disable GL_COLOR_MATERIAL so that all the lighting components come from the material settings *OR* put the 0.7 alpha on the polygon vertex colours instead of the material. > --- Pingouins dans les champs, hiver méchant. --- :-) Strictly, the French word 'Pingouin' refers to *northern* arctic seabirds like the Puffin and the Auk. The correct French work for Penguin is 'Manchot'. Note this discussion: http://linuxfr.org/2001/02/05/2198,0,0,1.php3 -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net http://freeglut.sourceforge.net |