Godot Game Of Life

A GPU-based implementation of Conway's Game of Life in Godot, leveraging shaders for cellular automata calculations. GDScript is used for user input, with a focus on efficient rendering techniques.

https://github.com/tavurth/godot-game-of-life

Preview Images

Preview
Preview

This project provides a GPU-accelerated implementation of Conway's Game of Life in Godot. It utilizes shaders to calculate the next steps of the cellular automata, achieving high performance. GDScript is employed for handling mouse input and button presses, allowing users to interact with the simulation.

Key Features

  • GPU-Based Calculation: The core logic of the Game of Life is implemented using shaders, enabling parallel processing on the GPU.
  • GDScript Input: GDScript is used to capture user input, such as mouse clicks, to modify the simulation.
  • Viewport Rendering: The project uses Viewports and Sprites to render the simulation efficiently.
  • Customizable Rules: The GameOfLife.shader file allows for easy modification of the Game of Life rules.

Rendering Details

The project utilizes a Viewport and Sprite setup to achieve efficient rendering. The Viewport's Render Target clear mode is set to 'Next Frame' to preserve the FBO contents for the subsequent frame. This approach enables the shader to calculate the next state based on the previous state. Using Sprites as direct children of the viewport is crucial for correct rendering, with the scale set appropriately.

Resource Details

demo

tavurth



3