Skip to main content
gamedev.net
🔒 Locked

Depth testing with particles

Started by SinnDarin 3 replies 550+ views
Original Post
SinnDarin
SinnDarin
Hi, I was wondering how I could render some particles without having the particle polygon borders shown.... I try something and desactivated depth testing: it looks great but since I wanted to use particles with a landscape engine I also need depth testing between particles and landscape... Does anyone know how to do this ? Thx Sinn
Thorin_nz
Thorin_nz
well what I would do is first render all the solid objects, then turn on blending and render all the objects with DepthWriting disabled.

to disable depth writing add
glDepthMask(GL_FALSE);
to enable depth writing add
glDepthMask(GL_TRUE);

DepthTesting should always be on and the blend func should be set at...
glBlendFunc( GL_SRC_ALPHA, GL_DST_ALPHA);

Btw if im wrong, please correct me, (I only learned about glDepthMask(GL_TRUE); a few days ago
MirekCz
MirekCz
Thorin is right.

for working source visit nehe.gamedev.net
With best regards, Mirek Czerwiñski
SinnDarin
SinnDarin
Thx, but I already try this... It works well with particles themselves but not between particles and landscape, the result is that landscape parts don t occlude the ''normaly'' hidden particles.
_the_phantom_
_the_phantom_
Depth testing on.
Depth writes off.
alpha blending on.

the above combination should do what you want as long as you do your particals AFTER the landscape has been rendered

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.