Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 7 developers from Canada and 18 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!


Particle "Engine"


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Simon Johansson   Members   -  Reputation: 148

Like
0Likes
Like

Posted 07 August 2014 - 01:56 AM

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!

 

 

 

 

 

 

 

 

    

    

 

 

 

 



Sponsor:

#2 HappyCoder   Members   -  Reputation: 3140

Like
1Likes
Like

Posted 07 August 2014 - 03:00 PM

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.


Edited by HappyCoder, 12 August 2014 - 01:02 PM.


#3 Jason Z   Crossbones+   -  Reputation: 6160

Like
2Likes
Like

Posted 09 August 2014 - 05:52 AM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS