Depth Test Problems

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.

use this:

gxEnable(GL_DEPTH_TEST);
glDepthMask(0);

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

It think it’s better to use

glDepthMask(GL_FALSE)

?

Originally posted by JanHH:
[b]It think it’s better to use

glDepthMask(GL_FALSE)

?[/b]
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.

Thanks guys, works perfectly