View Full Version : Depth buffering & transparency plz. help!

W. C. Picker
02-17-2003, 11:15 AM
I got a 32bpp texture wih an alpha channel, and a few holes in it.
Is there a way to write to the depth buffer only the texels with alpha!=0 ?

Dont want to disable depth writing.
Sorting wont do because i want polygons to intersect.

I think it might be possible, cause trees made of 2 intersecting masked textures are quite common.

I'd apreciate any help

02-18-2003, 12:03 AM
Alpha testing should do the trick:

glAlphaFunc(GL_NOTEQUAL, 0.0);


W. C. Picker
02-18-2003, 12:43 AM
That's what I did, but it doesnt work for me. I must have erred somewhere...

Thanks anyway.