Sign in to follow this  
fishleg003

particle storage question..

Recommended Posts

fishleg003    122
Hi, Ive got my particles stored in a very very long link list two link lists in fact one for dead particles and one for alive. Now this works really well for one emitter because its not creating new particles that much because i can easily swipe some off the dead list but the problem is im now at the stage where ive got 4 or 5 emitters. The problem is that i just add particles in any old order so drawing can be extremely slow because ive got to keep changing textures between the emitters plus some of the emitter use more than one texture. Just wondering how i could solve this problem, the thing ive came up with at the moment is have a giant array times max particles for each emitter then sort the particles by texture id like so, [1 1 1 2 2 2 2 4 4 4 4 0 0 0 0 ] //0 meaning dead and the other numbers the texture id Not sure if this is best way for this because id need to keep track of where each tex id ends and begins so i know which particles belong to what then if the tex id changes id have to do some swapping so its in the right part of the array. Now this way i could render lots of particles all in one go by texture for each emitter but would this be worth it ? At the moment im having to individually bind a texture for every particle another way i guess i could do would be to put all textures for each emitter onto a single texture then play around with the texture coords. Thx alot for any advice fishy

Share this post


Link to post
Share on other sites
Rasmadrak    196
I made my particle system so that each particle can spawn any other particle on birth, death and somewhere in between.

Rocket spawns exhaust-flames, flames spawn smoke etc...

One big list with particles, each with their own life, position, traveldir, you name it...

Also:

Don't swap textures for each particle, store texturecoords for the various different particles and bind ONE texture that got em all. :)

Cheers!

-----

I'm sorry that I'm not more useful: But you should really consider using dots in your sentences, then maybe more will comment on your post.
The text is REALLY hard to read!

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