• Advertisement
Sign in to follow this  

Need Help making a good particle engine

This topic is 1895 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have been trying to make a particle engine for a while now. i think i understand the base mechanics behind it but i can't seem to put it together.
my end goal would be to a particle engine based in drx9 that uses shaders. So if anyone could point me in the direction of a simple particle engine tutorial or on here i would greatly appreciate it.

another question if doing particle with shaders the only thing that would get update c++ side would be the position right???

Share this post


Link to post
Share on other sites
Advertisement
You need to think about how you will lay out your engine. A basic structure can be:

Particle Engine---has many-->Particle Emitters---has many--->particles. You will want to create a method by which you send chunks of the number of particles to the graphics card at once, to save draw calls.

For the actual particles, you need to think about what attributes you would like for the emitter. Max particles speed, colour, and of course texture. etc.

If you want to make an efficient GPU based particle system, you will do world calculations inside the shader. This includes scaling,translation and rotations. For instance, you can create a simple particle trajectory with a start time and velocity.

position = (currentTime - startTime)*constantVelocity

Where startTime is passed into the vertex shader from the application.

You can also manage to pass just the centre position of the starting particle into the shader, and transform each vertex of the quad using that position and the UV coordinates.

As for tutorials, I have yet to see a satisfactory one. Most seem to fly past important topics without discussing them. Edited by dAND3h

Share this post


Link to post
Share on other sites
Thanks for the tips. And yea i have been looking for tutorials but all they do is confuse me

Share this post


Link to post
Share on other sites
IMO, figure out particle systems (or any graphics tech you have trouble understanding) by messing with them in regular old code.
Shaders make coding harder, and their only purpose is to speed things up. Before you have a decent idea of what you want to do, that is not useful.

Share this post


Link to post
Share on other sites
SPARK is a good engine if you want something you can just drop in. Just google "SPARK particle engine" and you should find it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement