PDA

View Full Version : Depthmap: skip transparent pixels



MitchVL
03-04-2010, 06:41 AM
hi,

At the moment, i'm rendering my depthmap to an fbo the standard way (GL_DEPTH_ATTACHMENT_EXT).
I have trees that consist of two crossed quads with transparency (alpha to coverage).
When i look at my depth map, the trees are displayed as quads.

Is there a way to avoid transparent pixels being rendered to the depth map?

regards
Mitch

ZbuffeR
03-04-2010, 06:41 AM
enable alpha test.

MitchVL
03-04-2010, 06:43 AM
How do i do this for the depth map?

ZbuffeR
03-04-2010, 06:50 AM
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.5f);

right before any rendering.

Or I did not understood your question ?

MitchVL
03-04-2010, 06:57 AM
no, you're absolutely right

thank you !