View Full Version : what's the use of the alpha value of a texture
01-14-2004, 07:28 PM
we know when a texture has 4 color components,the last one is alpha,but what's the use of it?which objects will be affected by it?OGL how to deal it in a blend operation?
01-14-2004, 10:18 PM
the alpha channel of the texture works as the alpha for the colors:
textures' pixels with lower alpha will be more and more transparent. U can use such properties to achive some effects, as the billboarding. (never seen in games those 2d trees always facing the camera? the tree's texture is square, but the higher part is usually transparent.)
Sorry for my poor didactic propoerties, if u wanna know more google yourself searching billboarding http://www.opengl.org/discussion_boards/ubb/smile.gif
01-14-2004, 11:27 PM
Shalom! You are just continuing my topic... Yes, that is true - alpha channel is a way to make sprites. Also, if your texture is only RGB you cannot make it transparent - even with similar transparency by whole area. Have you tried to make water? http://www.opengl.org/discussion_boards/ubb/smile.gif So, RGBA textures are rather cool thing. But not in OpenGL at least not on PC. When you will get real sprite, please reply to my topic - Transparent Textures
Actually, you can have the transparency with RGB bmps. But, you have to convert them to RGBA in the loading of the texture.
Just make a new char array [width by height by 4] then go through each pixel and set the 4th value to 0 if its the right color, then send off that char to glTexImage2D.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.