Oooh looks nice :) Particle systems I've done in the past have been exactly they way you have done it, as shown by your pseudocode. However it took me a while to realise that reusing objects was way quicker than creating and deleting them haha. Keep up the good work.
My particle system is actually very simple. In pseudo code: (__ is to be interpreted as a tab) create n particles and place them in list P for every p in P __ p.dead = TRUE while particle system active __ if there is a particle p in P which satisfies p.dead == TRUE ____ p.dead = FALSE ____ give it position: x0, y0, z0 ____ give this particle a directional vector and some "energy" __ for each particle i in P ____ if it's energy is 0 ____ p.dead = TRUE __ else ____ updateParticle(i)
I have a finite amount of particles in each system, where they are either dead or alive. New particles are created from the buffer full of dead particles as long as the system is "active" In the case of an explosion - all particles are flagged as alive immediately and the system is flaged as inactive immediately thereafter. A fountain on the other hand would allways be active and have most of it's particles (ideally for a good flow) dead and awaiting to be resurrected.
Having a finite amount of particles instead of creating and destroing "particle objects" has two advantages - first, it's faster, and second, if I would create particles too fast I don't end up trashing the system, the system simply stops emitting new particles when all particles are alive at the same time.
updateParticle() is a function specific to that particle system. This is where the particles new position, rotation, size, texture, tint, and any other changes are calculated based on the particles mass, energy, and other data contained in the p struct.
What makes the different particle systems behave differently is different applications of physical "laws". Note that the "laws" are not at all realistic and very simplified to increase the speed of computation. By varying the mass, air resistance, initial velocity etc. I can create different effects.
There is no "particle sorting" involved as each system is responsible for one kind of particles only. The Wind Waker explosion consists of 4 separate particle systems - each with their own specific updateParticle() function.
Rendering is very simple. I just tell the OpenGL rendering engine to draw a polygon centered at a position given by the particle p. Scale of the polygon is determined by it's size. The p struct may also contain information about the rotation, tint, transparency, texture and so on. I do this for each particle p in every active particlesystem once every 1/60th of a second.
sounds like fart but cool though
erionmema1 1 year ago
@erionmema1 You must have some hellish farts then =P
FibrousAcquiescence 10 months ago
Oooh looks nice :) Particle systems I've done in the past have been exactly they way you have done it, as shown by your pseudocode. However it took me a while to realise that reusing objects was way quicker than creating and deleting them haha. Keep up the good work.
sutasman 1 year ago
I'm going into use a faster and orange version without the rocks and place it into Team Fortress 2.
This is well-done. Very nice.
stickmeister0 2 years ago
COOL.
Thank you for the explanation.
ilmale 3 years ago
Very cool.
TheForce 3 years ago
how do you do your particle-sorting? (and rendering)
lorentsg 4 years ago 2
AsymmetricArt 4 years ago
I have a finite amount of particles in each system, where they are either dead or alive. New particles are created from the buffer full of dead particles as long as the system is "active" In the case of an explosion - all particles are flagged as alive immediately and the system is flaged as inactive immediately thereafter. A fountain on the other hand would allways be active and have most of it's particles (ideally for a good flow) dead and awaiting to be resurrected.
AsymmetricArt 4 years ago
Having a finite amount of particles instead of creating and destroing "particle objects" has two advantages - first, it's faster, and second, if I would create particles too fast I don't end up trashing the system, the system simply stops emitting new particles when all particles are alive at the same time.
AsymmetricArt 4 years ago
updateParticle() is a function specific to that particle system. This is where the particles new position, rotation, size, texture, tint, and any other changes are calculated based on the particles mass, energy, and other data contained in the p struct.
AsymmetricArt 4 years ago
What makes the different particle systems behave differently is different applications of physical "laws". Note that the "laws" are not at all realistic and very simplified to increase the speed of computation. By varying the mass, air resistance, initial velocity etc. I can create different effects.
AsymmetricArt 4 years ago
There is no "particle sorting" involved as each system is responsible for one kind of particles only. The Wind Waker explosion consists of 4 separate particle systems - each with their own specific updateParticle() function.
AsymmetricArt 4 years ago
Rendering is very simple. I just tell the OpenGL rendering engine to draw a polygon centered at a position given by the particle p. Scale of the polygon is determined by it's size. The p struct may also contain information about the rotation, tint, transparency, texture and so on. I do this for each particle p in every active particlesystem once every 1/60th of a second.
AsymmetricArt 4 years ago
Cool.
Looks kinda like Peter Max animations.
fistp 4 years ago 2
Nice job! I loved those stylized cloud "poofs" in the Wind Waker. Are you using this particle system in any upcoming projects??
crumby99 5 years ago 2
I'm probably going to use it for a game, but that's a long way into the future.
AsymmetricArt 5 years ago
meh.. audio seems to be out of sync...
AsymmetricArt 5 years ago