Alpha value on textured quad
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?
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?
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.
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.
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?
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?
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
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.
"He who breaks a thing to find out what it is, has left the path of wisdom."
- Gandalf the Gray-Hat
Bring Alistair Cooke's America to DVD!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Y value of a point on a quad | evenmybird | 5 | 3,207 |
Aug 6, 2006 02:32 PM Last Post: OneSadCookie |
|
| png without alpha fine, png with alpha, nothing | dave05 | 6 | 5,750 |
Jun 11, 2005 10:31 AM Last Post: dave05 |
|
| quick opengl 2d quad question | dave05 | 2 | 3,333 |
Jun 9, 2005 06:09 PM Last Post: arekkusu |
|
| Quad Vertex Array Woes | WakingJohn | 1 | 2,069 |
Apr 9, 2005 07:55 PM Last Post: WakingJohn |
|
| White quads instead of textured quads | pkraft | 3 | 2,876 |
Mar 3, 2005 04:23 PM Last Post: AngelDaniel |
|

