Live Demo of website here.
This is based on the youtube video by Softology. The article written by them can be found here, and their video linked below.
Cellular automata involves updating a 3D grid of cells based on specific rules.
- Depending on the number of surrounding cells it can either:
- Resurrect a dead cell
- Kill a living cell
- Cells which have died will decay in multiple steps from alive to dead called the refractory period. Here the cell is:
- Unable to be resurrected
- Unable to be killed
- Gradually goes from alive (1.0) to dead (0.0) in increments
- We can count the number of surrounding cells differently
- Moore neighbourhood considers all surrounding 26 cells
- Von Neumann neighbourhood considers the directly adjacent 6 cells
Using these rules we can get interesting patterns.
A more detailed explanation can be found here at Softology's article.
- Press run to begin the simulation.
- You can pause, reset, and randomise the simulation.
- In the rules panel you can change it to a different cellular automata rule in realtime by clicking on them.
- In the randomiser panel, you can change how the world is populated.
- Radius absolute places a blob in the middle with radius in blocks.
- Radius relative places a blob in the middle with radius as a fraction of maximum radius.
- To change how the world is rendered you can change the parameters in the graphics panel.
- You can select different colouring schemes.
- Update the shader parameters in realtime.
- To speed up the simulation you can disable rendering and re-enable it later.
- Use the size controls panel to adjust the width, length and height of the simulation.
- For large sizes this can become very computationally and memory intensive.
- For a 1024x1024x1024 with 1.07 billion cells it will use 4.29GB of VRAM.
- VRAM usage =
4xyz
bytes. - The volume data is stored in two 3D textures with red and green 1 byte channels.
The simulation is computed and rendered using webgl shaders. Therefore having a more powerful graphics card will enable higher simulation speeds.
445 | 678 678 | Amoeba |
Builder 1 | Builder 2 | Clouds 1 |
Crystal Growth 1 | Crystal Growth 2 | Pyroclastic |
Slow Decay | Spikey Growth | |
You can also switch between the rules while it is running, which can create interesting patterns.
Crystal Growth 1 to Crystal Growth 2 | 445 to Crystal Growth 1 |
- Clone the repository and cd into it
npm install
npm run start