[Plib-users] transparent material with texture ?
Brought to you by:
sjbaker
From: Marc E. <ma...@fa...> - 2001-05-11 09:20:33
|
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 ? The state setting are: topo1 -> setTexture ( "sat.bmp",0,0 ); topo1 -> enable (GL_TEXTURE_2D); topo1 -> disable (GL_LIGHTING); //the texture gives the shade topo1 -> enable (GL_COLOR_MATERIAL); topo1 -> disable (GL_CULL_FACE); topo1 -> setColourMaterial (GL_AMBIENT_AND_DIFFUSE); topo1 -> setMaterial (GL_SPECULAR, 0.1, 0.1, 0.5, 0.9); topo1 -> setMaterial (GL_AMBIENT, 0.5, 0.3, 0.3, 0.7); topo1 -> setMaterial (GL_DIFFUSE, 0.5, 0.3, 0.3, 0.7); topo1 -> setShininess (0.5); topo1 -> enable (GL_BLEND); topo1 -> enable (GL_ALPHA_TEST); topo1 -> setAlphaClamp (0.001); /* 0..1 */ topo1 -> setTranslucent(); with a blending function: glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); Have I done something wrong ? Marc. -- ___________Escher Marc____________________Alternet Fabric, sarl_______ rue de Langallerie, 6 Tel : ++41-21-351.10.20 CH-1003 Lausanne Fax : ++41-21-351.10.20 mailto : ma...@fa... http://www.fabric.ch smsto : http://www.flashsms.com/marc ______________________________________________________________________ --- Pingouins dans les champs, hiver m=E9chant. --- |