View Full Version : Alpha value on textured quad
monteboyd
2002.06.04, 11: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?
ibullard
2002.06.05, 12:04 AM
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.
monteboyd
2002.06.05, 01:12 AM
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?
ibullard
2002.06.05, 01:47 AM
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? ;)
rangaroek
2002.06.05, 03:16 PM
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 www.opengl.org ... hope it helps
bye, rangaroek
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.
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.