PDA

View Full Version : another texture thing, transparency



punky
10-16-2009, 04:40 AM
how i can make my texture transparenT?
glBlendFunc(GL_DST_COLOR, GL_ZERO);
DrawCube(0,0,0,2);
the mask, it works, the white thing is transparent, the rest of the cube is black than :
http://lh3.ggpht.com/_M88JYhzTo4s/SthZfAFmnVI/AAAAAAAAAE8/jpXgvDswNoo/s128/text_100x100_mask.jpg

like here, u can see another smaler cube inside the cube with the texture, the big cube uses the mask texture i added at first
http://lh3.ggpht.com/_M88JYhzTo4s/SthckfpB3II/AAAAAAAAAFI/VCDmSilGDU0/rederd_mask.jpg

but how i can make transparency with this texture?
http://lh3.ggpht.com/_M88JYhzTo4s/SthZfEaiFeI/AAAAAAAAAFA/-jFfIKMF468/s128/text_100x100.jpg

is there maybe a posibility to draw it into a buffer and delete the white pixel so that they dont get displayed`?

punky
10-16-2009, 08:11 AM
i got it i do now a 32bit Alpha-Channel bitmap for transparency
and use this function

glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glAlphaFunc(GL_GREATER,0.1f);
and glEnable(GL_ALPHA_TEST);

for transparency, but if anyone knows to delte custom pixel out of the buffer to get custom transparenzy by pixel plz tell me

here is the result:
http://lh6.ggpht.com/_M88JYhzTo4s/StiOv-_CqxI/AAAAAAAAAFQ/yxZFVtqAWtk/rederd_mask.jpg

punky
10-16-2009, 08:43 AM
another question would be a png or tga file better for transparency

ZbuffeR
10-16-2009, 09:03 AM
"if anyone knows to delte custom pixel out of the buffer to get custom transparenzy by pixel plz tell me"
What do you mean ?

punky
10-16-2009, 10:00 AM
in older double buffers it was possible to delete a pixel out. or at old dos assembler example:
memory adress $A0000 delete pixel at offset 0xA0005
to get a transperancy, just to delete a pixel out of the buffer so that it does not get displayed anymore