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???
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.
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.