Alpha value on textured quad

Member
Posts: 351
Joined: 2002.04
Post: #1
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?
Quote this message in a reply
ibullard
Unregistered
 
Post: #2
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.
Quote this message in a reply
Member
Posts: 351
Joined: 2002.04
Post: #3
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?
Quote this message in a reply
ibullard
Unregistered
 
Post: #4
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
Quote this message in a reply
rangaroek
Unregistered
 
Post: #5
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
Quote this message in a reply
Member
Posts: 145
Joined: 2002.06
Post: #6
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!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Y value of a point on a quad evenmybird 5 3,595 Aug 6, 2006 02:32 PM
Last Post: OneSadCookie
  png without alpha fine, png with alpha, nothing dave05 6 6,652 Jun 11, 2005 10:31 AM
Last Post: dave05
  quick opengl 2d quad question dave05 2 3,592 Jun 9, 2005 06:09 PM
Last Post: arekkusu
  Quad Vertex Array Woes WakingJohn 1 2,319 Apr 9, 2005 07:55 PM
Last Post: WakingJohn
  White quads instead of textured quads pkraft 3 3,152 Mar 3, 2005 04:23 PM
Last Post: AngelDaniel