PDA

View Full Version : Depth Test Problems



Xero_Tolerance
08-14-2003, 02:42 PM
Hey, here's my problem. I have my engine set up and for the effects in the game I use a particle effect. To make the particle effect look good I have to turn off the depth test and turn on blending and such. The problem is, once I turn off the depth test you can see the particles through walls and such because it's drawing no matter what. Is there anyway I can just turn off the depth test in relation to the other particles but keep on the test in relation to other polygons. In other words, keep the particle effect look but not be able to see it through all the walls. Thanks ahead of time.

AdrianD
08-14-2003, 02:45 PM
use this:

gxEnable(GL_DEPTH_TEST);
glDepthMask(0);


[This message has been edited by AdrianD (edited 08-14-2003).]

JanHH
08-14-2003, 02:49 PM
It think it's better to use

glDepthMask(GL_FALSE)

?

zeckensack
08-14-2003, 03:08 PM
Originally posted by JanHH:
It think it's better to use

glDepthMask(GL_FALSE)

?That's the same. GL_FALSE is 0 (on sane machines anyway).
Note that the glDepthMask description says "non-zero" stuff will allow depth writes, it doesn't say "GL_TRUE" or something. So it may even be more correct to use 0 and 1, but that's really highly theoretical.

Xero_Tolerance
08-14-2003, 03:34 PM
Thanks guys, works perfectly