A simple 2D particle system in Rust using gfx. Particles are created with some initial state and then handed over to the GPU.
- Advantage: Particle movement is performed on the GPU, so buffers don't need to be modified for updating the state.
- Disadvantage: Dynamic particle state needs to be parameterized by time.
Parts of the code, especially the shaders, are based on gfx's particle example.
Consider this a proof of concept. Currently, only circular particles are possible.
See examples/ggez.rs for an example of using this crate in combination with ggez
:
cargo run -j4 --release --example ggez
In this example, 2000 particles are spawned whenever the mouse is moved.