View Full Version : Blending Question?

08-28-2000, 02:30 PM
I am creating a 2d heightfield, I wish to import a picture of a map(done), then draw a grid over the top(done).

But I also wish to make both map & the grid user transparent, via a slider.

I have the slider control implemented, I simply wish to know how you would make both the grid and pictures transparency gradually change with the manipulation of the slider control?

08-29-2000, 05:03 AM
I assume you are displaying the map by drawing a textured polygon. If this is the case, simply set the texture mode to modulate with glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE) and use glColor4f(r,g,b,a) to set the alpha value of the polygon.

Hope that's what you meant.


08-31-2000, 08:17 AM
That is a fudge, as it only works if the background is the same colour as the quad!

What if I am blending over another Images does this mean if I require user transparency
I will have to edit the alpha of each pixel before drawing!