I am applying textures on entity,how do I get
transparency on entity?what kind of opengl commands should I use?
Make sure your texture has an alpha channel. Then enable alpha testing (see glAlphaFunc) and/or blending (see glBlendFunc). If you use blending you probably want to disable zbuffer writes for the blended geometry (see glDepthMask).
I have problens with transparency in textures too, I load image from tiff format (having alfa channel) and loading with
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
The image is printed ok, but the transparency are printed black, or all image are translucid.
Actualy I use blend as:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
I render images in 2d (no depth test) on windows 2000.
Thanks
Can you post your code?
I can solve it,
I change
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
to
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
Thanks a lot