Advertisement

Particle troubles

Started by March 24, 2003 01:21 PM
14 comments, last by yodaman 21 years, 11 months ago
Disabling depth buffer writes while rendering the PS actually does not solve the problem because then none of the quads that make up a PS will affect the depth buffer and therefore other models will either obscure the PS everytime or be obscured by the PS everytime u render (depending on the rendering order). As i said in my first post I believe that a solution to this would be to render a quad (with colour buffer writes disabled) over the entire PS to set the depth buffer up correctly.
jonbell : if disable only z-writes and render PS as last thing it will look correct since you are still doing z-reads. Just try it..


You should never let your fears become the boundaries of your dreams.

[edited by - _DarkWIng_ on March 25, 2003 1:18:05 PM]
You should never let your fears become the boundaries of your dreams.
Advertisement
I actually believe that they didn''t use glDepthMask(), but instead disabled depth testing, in the game "A time to kill", in the last chapter in the OpenGL game programming book... Try it and look what happens when the particles com behind a small piece of terrain, and you''ll see what I mean...
Wouldn''t it just be better to sort the particles by distance with the rest of the world drawing furthest to closest with depth testing on. They are after all just quads so just treat them like the are a part of your scene. This is of couse assuming you render all polys furthest to closest to keep your blending realistic.
I'm don't know much but I can try to help... just email me at... Shadow_0f_Light@Yahoo.com(the '0' in 'Of' is a zero :P)
Shadow_0f_Light : Sorting particles is a much better aproach but the trouble is sorting them. Especiali when you have alot of them (+10k).

You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
It''s a good point, the trick is not to you a bsp or oct tree cause then you have to redo your tree every frame. If you sort the polys, including the polys for the particles, by distance to the camera (simple trig) it actually a bit faster. But then again I haven''t tried it with +10k particles in my scene. I''ll have to check that out...
I'm don't know much but I can try to help... just email me at... Shadow_0f_Light@Yahoo.com(the '0' in 'Of' is a zero :P)

This topic is closed to new replies.

Advertisement