PDA

View Full Version : Particle Woes



MrShoe
01-19-2002, 01:54 PM
My Particle system has a problem. If Depth testing is on then the particles block each other out for obvious reasons. When is is off it is ok but then you can see the particles through walls and everything for that matter. What do i have to do so they dont block each other out and so you cant see them through walls?

Nutty
01-19-2002, 03:11 PM
Draw all opaque geometry 1st.

Turn Depth testing on
Turn Z writing off

Draw all your particles.

Ideally all your particle should be depth sorted, but not everyone does this.

If they are drawn as Addative blends, then you dont need to sort.

Nutty



[This message has been edited by Nutty (edited 01-19-2002).]

MrShoe
01-19-2002, 03:38 PM
Thanks... I know how to turn depth testing on/off (not kinda hard ;-p ), but how do i turn z writing off?? BTW, they are drawn using glBlendFunc(GL_SRC_ALPHA, GL_ONE);

[This message has been edited by MrShoe (edited 01-19-2002).]

chowe6685
01-19-2002, 05:10 PM
glDepthMask(0);
turns Z-writing off
glDepthMask(1);
turns it back on

MrShoe
01-19-2002, 07:40 PM
Sweet, thanks!