SurGL
06-03-2001, 05:51 AM
Hello,
I was trying to draw a texture mapped polygon. Certain pixels in texture has Alpha value as 0( manually done to make transparent).
Now the problem is it does not work.
I have done,
a. Enable ALPHA TEST
b. Alpha function ( greater, 0.5)
i have used
glTexImage2D(GL_TEXTURE_2D,0,4,width,height,
0, GL_RGBA, image);
tried with GL_DECAL, GL_MODULATE and GL_REPLACE!!
but nothing is displayed. but if i mention 3rd paramenter in glTexImage2D as 3( instead of 4), the image is displayed but with all pixels( no transparency). Why is this?
how come it works with 'components' as 3 even if image is RGBA?
please help!!
I was trying to draw a texture mapped polygon. Certain pixels in texture has Alpha value as 0( manually done to make transparent).
Now the problem is it does not work.
I have done,
a. Enable ALPHA TEST
b. Alpha function ( greater, 0.5)
i have used
glTexImage2D(GL_TEXTURE_2D,0,4,width,height,
0, GL_RGBA, image);
tried with GL_DECAL, GL_MODULATE and GL_REPLACE!!
but nothing is displayed. but if i mention 3rd paramenter in glTexImage2D as 3( instead of 4), the image is displayed but with all pixels( no transparency). Why is this?
how come it works with 'components' as 3 even if image is RGBA?
please help!!