ggfolks / platform

Once more into the breach.
MIT License
5 stars 0 forks source link

Graph-based particle system engine #19

Open ey6es opened 5 years ago

ey6es commented 5 years ago

There's no great off-the-shelf particle engine/editor for Three.js that I'm aware of. It would be interesting to try to make one using the graph system (with graphs that determine when particles are spawned, what their initial attributes--position, velocity, etc.--are, and how those attributes change over time).

ey6es commented 5 years ago

Eventually we should support both GPU-based (using textures to store particle states) and CPU-based particle system updates. GPU-based is better for large numbers of particles, but it has limitations and is better for "embarrassingly parallelizable" systems. However, I think we should start with the GPU implementation, in part because it will be a different way to use the graph system.

ey6es commented 5 years ago

I think we're going to want different kinds of subgraphs for different domains (hence, AbstractSubgraph and children). For particles, we'll have one "outer" (subgraph) node with an input for the number of particles to emit on the frame. The contained graph will represent the particle's state over time, which can either be a simple function of the "elapsed" time, or something state-based. It will have undeleteable outputs for position, rotation, scale, color, etc. Similar systems come to mind for audio, shaders, post effects, texture synthesis...