iDevGames Forums
Alpha value on textured quad - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Alpha value on textured quad (/thread-7723.html)



Alpha value on textured quad - monteboyd - Jun 4, 2002 08:24 PM

This is something I've been confused about for while, never caused any major hassles but thought I'd ask.

If I have a quad textured with a 32-bit texture with an alpha channel I can get that to display properly with blend enabled, alpha testing enabled and the right blend fuction. But if I use glColor4f to try to change the alpha value so that it, maybe, fades out, then the alpha value in glColor4f seems to have no affect. If I turn texturing off and just use a flat colour the alpha works fine.

So is it possible to achieve?


Alpha value on textured quad - ibullard - Jun 4, 2002 09:04 PM

Look into glTexEnv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

Note that this will blend the vertex colors as well so if you don't want modify the texture colors you should put white in each vertex.


Alpha value on textured quad - monteboyd - Jun 4, 2002 10:12 PM

I'm pretty sure it is set to GL_MODULATE. I can get a texture to blend with vertex colours, but not the alpha. Any ideas?


Alpha value on textured quad - ibullard - Jun 4, 2002 10:47 PM

Have you tried any of the other blend modes? How do you set the vertex alpha? What video card are you using? Have you looked into using ths multitexture interface instead? Do you mind if I bombard you with questions? Wink


Alpha value on textured quad - rangaroek - Jun 5, 2002 12:16 PM

Quote:Originally posted by monteboyd
This is something I've been confused about for while, never caused any major hassles but thought I'd ask.

If I have a quad textured with a 32-bit texture with an alpha channel I can get that to display properly with blend enabled, alpha testing enabled and the right blend fuction. But if I use glColor4f to try ... snip ...
So is it possible to achieve?

Hi, if you are using glLights you have to use the diffuse material color, not glColor4f to modulate the final color value ... there is an online version of the red book on http://www.opengl.org ... hope it helps

bye, rangaroek


Alpha value on textured quad - inio - Jun 29, 2002 04:36 AM

Are you on a earlier mac with a RagePro2 (I think?) graphics accellerator? These cards do not support OpenGL fully, and in particular they ignore glTexEnv and it's related behaviors (almost?) entirely.