Particles are Z-Fighting

Started by
5 comments, last by FlyingDemon 20 years, 6 months ago
How do I keep my particles from Z-Fighting? I''m drawing them as 34bit(TGA''s) textured quads.
Advertisement
disable depth testing
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]
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
Sort particles back to front before rendering them.

You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
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?
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... ??
--FirekingOwner/LeaderFiregames Development &Blackdragon Studios
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.

This topic is closed to new replies.

Advertisement