View Full Version : transparency in textures
I am applying textures on entity,how do I get
transparency on entity?what kind of opengl commands should I use?
08-17-2005, 12:20 AM
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:
I render images in 2d (no depth test) on windows 2000.
I can solve it,
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
Thanks a lot
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.