Particle "Engine"

Started by
1 comment, last by Jason Z 9 years, 8 months ago

Hi folks,

I have been starting a new hobby project/game just for fun and to try out some new things. Iam writing in C++/OpenGL.

The main thing i wanna try to add to this game is more dynamic/random playstyle.

So iam about to start the Particle "Engine" and before i do that i have a couple questions.

1. I want it to be using the GPU for update, creating, "deleting" etc, is it gonna work if i want a more dynamic system?

2. Do anyone know a good pattern or approach to build a more dynamic kind of particle system?

Maybe someone already have a good article/tutorial about this?

3. How about collisions?

Maybe an example of what i have i mind:

The user have a basic spell called "Magic Ball"

The user can then add an element to this basic spell, lets say fire, then this gonna be a "Fire Ball"

Later on the user finds a "Basic hit effect" spell and then add it to this "Fire Ball".

The user can then add some kind of "Hit effect" like, stun, slow, chain lightning etc etc.

And i want this on the enemies aswell.

I was thinking about some kind of entity-component approach?

And sorry for my terrible english :)

Thanks!

Advertisement

1. You should be able to do all of what you need using compute shaders.

2. A good approach would be to have some common code that all particle systems use, but make a lot of the behavior implemented in separate functions that you can change depending on the behavior of the effect. Don't try to make code for a single particle effect that can handle any situation.

3. Compute shaders will be flexible enough to allow you to handle collision. However, you will probably only get good results with either simple shapes like spheres or static geometry.

My current game project Platform RPG

For an example (using D3D11, but still useful for you) of this type of particle system, check out the ParticleStorm demo from Hieroglyph3. That will show you one way to use append/consume buffers and compute shaders to make a particle system.

This topic is closed to new replies.

Advertisement