PDA

View Full Version : Alpha-fading a 32-bit texture



halo
11-04-2005, 03:49 PM
glColor4f does not appear to have any effect on the alpha-fading of an object textured with a 32-bit texture. The texture already has an alpha channel, and OpenGL seems to just use that, instead of combining it with the material color alpha. I am using glBlendFunc GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA.

I also tried creating a temporary color array with the desired alpha value, but this had no effect.

I am trying to get my grass to fade with distance. How can I alpha-fade an object that is already textured with a 32-bit texture?

sqrt[-1]
11-04-2005, 04:44 PM
I assume you are not using any shaders?

What is your tex environment set to?
Do you have a:
glTexEnvi(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_MODULATE); call somewhere?

halo
11-04-2005, 04:47 PM
Yes, of course I do.

No shaders in use.

Blending works fine with 24-bit textures, and my 32-bit textures work fine with GL_BLEND. I just can't combine 32-bit textures with an additional alpha value, to make the already transparent object fade.

halo
11-04-2005, 07:46 PM
Nevermind, it works.