Sign in to follow this  
Hibbs

Particles in an Octree

Recommended Posts

Ive recently got my Octree working with my particle system, now Im able to have multiple different emitters and particles mingling together and still have correct culling and alpha sorting. Even though I still have many optimizations to make it obviously eats the CPU when the particle number increases because of all the dynamic updates for the particle position. I could remove the particles from the octree and frustrum check each particle, or I could add a bounding volume into the octree to represent the emitters maximum bounding area, then only frustrum check the particles in the frustum when there emiiters bounding volume is inside the frustum. Does anyone know of a better way of culling/alpha sorting particles?

Share this post


Link to post
Share on other sites
The lame answer: use additive blending, and don't sort at all ;)

On a more serious note, if your viewpoint doesn't differ much from one frame to the next (you could test for this), you could consider not sorting every frame, or doing a single-pass bubblesort (quite fast if the order of your particles is almost right).

Share this post


Link to post
Share on other sites
Store particles in some bounding boxes and use radix sort if you need to have them sorted. Using bubble or insertion sort, as suggested, might also be good to have your particles "almost" sorted most of the time.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this