Particles are Z-Fighting
How do I keep my particles from Z-Fighting?
I''m drawing them as 34bit(TGA''s) textured quads.
quote:Original post by DrEvilThat''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...
disable depth testing
[Insert witty signature here]
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 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... ??
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.
The Red Book explains this pretty extensively IIRC in the blending section.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement