supagu

is it possible to sort geometry in a geometry shader
Im trying to move as much of my perticle system to my GPU, so far i generate the quads on the GPU from points, but now i need to sort them by depth if possible.

ideas


Re: Direct3D 10 sorting in geometry shader

Gieve

I would take a look at the merge sort used in the million particle demo. I implemented it, and it works well.




Re: Direct3D 10 sorting in geometry shader

Jack Hoxley

supagu wrote:
is it possible to sort geometry in a geometry shader
From my own experimentation over the last year or so, I would think not. You can amplify or kill geometry, but you have no control over what order it is processed in. I'm pretty sure this is quite intentional as GPU's are massively parallel and having the software step all over the scheduler is likely to cause headaches

supagu wrote:
Im trying to move as much of my perticle system to my GPU, so far i generate the quads on the GPU from points, but now i need to sort them by depth if possible.
Have you looked at the GPU-based particle demo in the SDK It's been a while since I looked at it, but that should give you some ideas about how much is possible purely on the GPU.

Also, do you *really* need to sort your particles for depth Almost every particle system I've developed has been fine provided I disable Z-Writing and use blending. The soft-particles demo in the SDK shows some pretty cool techniques for further improving the quality.

hth
Jack