View Full Version : Texture Problem

02-19-2005, 02:58 AM
Hi all!

I want my texture to look exactly like a bmp picture. Is this possible?

When I try to do this the texture get different colors than the BMP file. What is wrong?

I tried with both GL_MODULATE and GL_DECAL, but it does not work. What of these two enviroment options is correct to use in this case?

02-19-2005, 03:30 AM
When using GL_MODULATE you need to set glColor4f(1.0,1.0,1.0,1.0)

Or just set it to GL_REPLACE:



02-20-2005, 10:52 PM
Thanks for the quick replay.

I tried to use GL_REPLACE and it worked fine if I disabled GL_BLEND. The problem is that some parts of my texture is transparent. (Using alpa blending: 0 value=not visible, 255=visible). So when I turn of the blending the image is no longer transparent. And if I use blending the image have different colors than the original bmp file.

I want the image to look exactly like the bmp file with some pixels not visible. Is this possible in openGL?

02-21-2005, 12:17 AM
This can be done with glEnable(GL_ALPHA_TEST) instead of blending. Use glAlphaFunc to set the comparison function and reference alpha value.