Geometry Shader for ParticleSystem

Started by
5 comments, last by Krohm 12 years, 3 months ago
Hi,
Using geometry shader, particle system can be done.
Is it better to use geometry shader or traditional batching ?
I think if using geometry shader, can't do particle collision, I am wrong ?

Thanks
Advertisement
Most people just use a geometry shader to expand a single vertex into a billboarded quad. Are you talking about actually simulating particles on the GPU?
Using a ping-pong buffer for stream-out and drawing.
But if for exemple using bullet for collision, I guess it's not possible to do particle collision using that, I am wrong ?
Is it more effective to use traditional batching ?
You can find an implementation of the ping-pong particle system with geometry shaders in the D3D10 book Programming Vertex, Geometry, and Pixel Shaders, which is available on gpwiki (see my signature for the link...).

Regarding which way is better, that depends on lots of things. I'm not sure what you mean by traditional batching, but there are many ways to do partcle systems that perform particle collision. Most that I have seen recently use the compute shader to do the work, and then display the results with the traditional rendering pipeline.
Of course it's still possible to do collision on a GPU...you just need to have your collision data in a format that's GPU-friendly and also do your collision calculations in a way that's GPU-friendly. Nvidia has been doing a lot of simple FX simulation on the GPU for some time now with PhysX, and some people have implemented full rigid-body simulations on the GPU. Or you can do something really simple like what Bungie did for Halo Reach, where they just used the depth buffer to handle particle collisions.
The Halo, Reach approach works best for really small particles onscreen. Errors do crop up (stuff "falling" through) but it's not noticeable if you're just using sparks or etc. It's an efficient approach for small eye candy, but it sounds like you may be asking for more practical, gameplay oriented stuff as well.

In that case you should take a look at Nvidia's papers. I'm not sure there'd be much other research on it from actual game implementations quite yet, for the obvious reasons that the 360 and PS3 don't support compute shaders.
But if for exemple using bullet for collision, I guess it's not possible to do particle collision using that, I am wrong ?
Bullet won't help you in particle collision. It is not geared towards this type of application, performance does not scale well enough.

Previously "Krohm"

This topic is closed to new replies.

Advertisement