Closed jasonwebb closed 3 years ago
The cellular-automata-rule-parser
package is working out beautifully! All of the other fundamentals (ping-pong rendering, ortho camera, etc) are all also working nicely, using the reaction-diffusion project as a starting point.
This project can probably work very similarly to my 2d-reaction-diffusion-experiments project. ThreeJS for WebGL conveniences, custom shaders applied to a plane mesh oriented perpendicular to an ortho camera, ping-pong between render targets to speed things up, encode cell state data in textures, passing previous iteration's texture into current gen shader pass for coherent simulation.
Kevin Chapelier (@kchapelier) has done some great prior work that can be built in as dependencies or adapted based on personal preference:
Piecing together a shader as a string feels kind of gnarly to me, so I wonder how feasible it would be to have a single shader that has multiple paths triggered by conditionals. There might be a performance hit, but surely that would be pretty small?