First pass of my 3D particle emitter for my Raylib game is done. I'm going to wait until it's feature complete before I re-write it for the GPU, something I have no idea how to do. It's only emits sphere meshes, which is fine for now since it stylistically fits the game's art.

#raylib #indiedev #imgui

@grumpygamer That's some good progress, Ron.
@grumpygamer particles on gpu are easier if they are stateless (ie, you can infer every state from parameters + time).
If not, you need to first update all the parameters in say a compute shader pass, and then render that.
@vhamm Once a particle is started it is stateless. It goes until it's life runs out (or it hits a AABB box. There is no external force like a changing wind, etc.
@grumpygamer stateless here means, do you store the particle position/velocity, and integrate it each frame. If so, position/velocity is a state persistent between frame
@grumpygamer in a stateless particle system, you can figure out each particle position just from say, seed, time of start of the system and current time.
They are pretty constrained to what you can do with them.
(Also I'm unsure of the state of the art here)
@vhamm Yes, position, velocity, rotation, etc, but they are all driving by data set up when each particle is started.

@grumpygamer yeah for those cases you likely need to do an integration compute shader that will update each particles in parallel and then generate the rendering triangles for the render draw call.

Honestly, unless you go crazy with particles, you can likely just keep that on CPU for now, until it becomes a bottleneck.

@vhamm I have close to 50 particles! Good thing I have a M1 Mac.