Need Help making a good particle engine
Members - Reputation: 117
Posted 13 November 2012 - 10:30 AM
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???
Members - Reputation: 216
Posted 13 November 2012 - 12:50 PM
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, 13 November 2012 - 12:51 PM.
Crossbones+ - Reputation: 1416
Posted 13 November 2012 - 06:18 PM
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.
Members - Reputation: 1166
Posted 13 November 2012 - 07:22 PM