Re: [Plib-users] transparent material with texture ?
Brought to you by:
sjbaker
From: Marc E. <ma...@fa...> - 2001-05-16 15:11:19
|
Steve Baker wrote: >=20 > Marc Escher wrote: >=20 > > 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. W= hat > > is the right way to do it ? >=20 > You are using setColourMaterial (GL_AMBIENT_AND_DIFFUSE) - which tells > the system to use the *polygon* colour for the Ambient and Diffuse comp= onent > of the lighting and to use the setMaterial settings only for the remain= ing > components (Specular and Emission). >=20 > 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 th= e > polygon itself. >=20 > So, you either need to disable GL_COLOR_MATERIAL so that all the lighti= ng > components come from the material settings *OR* put the 0.7 alpha on th= e > polygon vertex colours instead of the material. Right, with these modifications and a few internal bug fixes, it seems to be working well. Thanks a lot. By the way, my scene is composed of translucent and opaque objects that can intersect each other and I have some problems of drawing order with the transparent objects. Is there a way in PLIB to manage that ? Can we enable the GL_DEPTH_TEST for the opaque object and disable it for the tranparent ones ? Marc. --=20 ___________Escher Marc____________________Alternet Fabric, sarl_______ rue de Langallerie, 6 Tel : ++41-21-351.10.20 =20 CH-1003 Lausanne Fax : ++41-21-351.10.20 mailto : ma...@fa... =20 http://www.fabric.ch smsto : http://www.flashsms.com/marc ______________________________________________________________________ --- Pingouins et manchots dans les champs, hiver tr=E8s m=E9chant. --- |