bruce965 / godot-gpu-cellular-automata

GPU-accelerated cellular automata template in Godot (OBSOLETE: could be done in better ways in Godot 4)
MIT License
16 stars 2 forks source link
didactic godot particles-sandbox shader

GPU Cellular Automata Template

GPU-accelerated cellular automata template in Godot.

Uses GLSL3, but it should be possible to run it on GLSL2 with minor tweaks.

Controls

Scroll wheel = select material

Click = place material

Enter = pause/play

Space = step once

How it works

The current state of the simulation is stored in a texture, rendered in a special viewport named Simulation/Viewport.

A simulation.shader reads the viewport to compute the next frame and writes the result back to the same viewport.

Finally, the result is shaded through the render.shader and presented on the screen.

Setup and input are handled from cellular_automata.gd.

License

Copyright (c) 2021-2022 Fabio Iotti. Released under the MIT License.