View Full Version : Masking question

08-15-2002, 05:36 AM
Hi there!

My problem is the following: I have an object loading and drawing class already working, and i don't want to implement depth sorting for my polygons, but i want to draw tree branches with black and withe alpha masks. I understend why depth ordering necessary for blending but in this case i have no transparent pixels just masked or non masked, so is it somehow possible to mask the depthbuffer with my black and withe image mask? or is there any other way to draw masked faces without depth ordering?

Thanks, a lot!

08-15-2002, 06:17 AM
Stencil buffer with depth test as well.

08-15-2002, 06:57 AM
Sounds like a perfect job for the alpha test. Set the alpha of the texture to white for opaque parts and black for transparent parts. Then enble alpha test and call glAlphaTest with appropriate parameters (look it up). Bingo.

08-24-2002, 08:33 AM
Thaks guys! Writing a TGA loader, changing texturing mode to glmodulate and useing alphatest does the work. Thanks for your help!

p.s.: sorry for my poor english