I was wondering how can I use transparency with OpenGL. Because I am fairly new to OpenGL and want to make a 2d tile based game. So the maps used will be multilayered and the 2nd layer, 3rd layer and so on should not show the black ( or any other color around them. for example suppose its a tree and the background is euh… background is Pink. So all the pixel that are pink shouldn’t be seen. it should use the color already present at that location ) I used to use Allegro but now i am using OpenGL; I am not sure if blending will do the trick…
[This message has been edited by Akash (edited 08-08-2001).]
what u need to do is add an alpha channel to your texture either in a painting program eg gimp or alternatively when u laod the image for each pixel check to see if the colour of it is black if so make the alpha of that pixel 0 else make it 1 then use
glEnable( GL_ALPHA_TEST )
glAlphaFunc( GL_NOTEQUAL, 0 );