gfx-rs / gfx

[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
http://gfx-rs.github.io/
Apache License 2.0
5.36k stars 546 forks source link

Particle systems #875

Open kvark opened 8 years ago

kvark commented 8 years ago

Writing this down so that I don't forget. Been playing the Convoy game - it features very simple sprites and particles, but looks great. Adding simple particles can do wonders to the immersion.

First question, which way of simulation we want to have:

  1. CPU, with sending data to GPU every frame
    • ineffective due to bus transfers
    • takes a lot of CPU
    • works on a toaster
  2. GPU textures
    • not convenient to pack attributes into texture formats
    • works on GL2+
  3. GPU transform feedback
    • works on GL3+ and DX11, but no such feature in next-gen APIs
  4. Compute shaders
    • works on GL4+ and DX11+, but we don't support them yet

As for the roadmap, first thing we need to hack an example that demonstrates particles. Then we'll need to generalize particle attributes and move the logic into a separate project.

kvark commented 5 years ago

triaged: leaving open for someone to write a library on top of either gfx-hal or wgpu-rs