Archived

This topic is now archived and is closed to further replies.

FlyingDemon

Particles are Z-Fighting

Recommended Posts

quote:
Original post by DrEvil
disable depth testing
That''s the obvious solution, but it won''t work in all situations. Post some more info, FlyingDemon, and we''ll be able to help a little more...

[Insert witty signature here]

Share this post


Link to post
Share on other sites
thanks.
I used glDepthMask(GL_FALSE) glDepthMask(GL_TRUE) to draw my particles and it works good so far. No more z-fighting.

but...
If i were to sort them would i have to perform a distance function for every particle or is there a faster way?

Share this post


Link to post
Share on other sites
i thought the point of depth was that things would automatically sort according to z location and camera? i dont understand why someone would have to sort the quads on their own when the 3d api is supposed to do it anyways... ??

Share this post


Link to post
Share on other sites
Particles are generaly blended. This means you have to draw them in the right order or it''ll look wrong with some of the blending mode. Additive blending is very popular because you don''t have to do depth sorting.

The Red Book explains this pretty extensively IIRC in the blending section.

Share this post


Link to post
Share on other sites