View Full Version : Texture Crossfade

02-08-2004, 06:47 PM

I'm trying to crossfade 2 24bit textures on one poligon, but I can't find a way to do this without generating an alpha map.I can do this with GL_BLEND by setting the alpha color for each vertex and textures, but I want to use z-buffer so I can't use GL_BLEND.
Any idea?

02-08-2004, 07:47 PM
If you want a linear crossfade, you can do this with vertex alpha: use modulate texturing and change the color alpha per vertex. First draw the base texture at full opacity everywhere. Then draw the second texture with full opacity at some vertices and zero at others.

If you have multitexturing hardware you can do this in one pass. Otherwise, use two passes and disable depth/stencil/etc writes in the second pass.

If you want a fade that isn't linear, then you can use an alpha mask.

02-09-2004, 01:11 AM
Thanks, I figured out using ARB_multitexture http://www.opengl.org/discussion_boards/ubb/smile.gif