Introduction

Conway's Game of Life models population stability in a grid based world with simple rules. If a cell has 3 neighbors it will be alive next round, if it has less than 2 or more than 3 it will die, and if it has 2 and is alive it will remain alive.

Since each cell's future is only dependent on its current neighbors, the algorithm is easily parellelized and is well suited to GPU processing due to the high number of cores. OpenGL 4's instaced drawing and programmable pipeline using glsl shaders provides an easy to use and high performance method for running and visualizing the simulation.

2D Simulation

The simulation is performed by rendering to and sampling from two frame buffer objects. In each iteration of the simulation the buffers are swapped. The simulation simply renders a 2D quad to the next buffer while sampling from the current buffer. Once the next stage has been computed the resulting stage is rendered to the screen buffer.

3D Visulaization

The 3D display is a simple visulaization where a cube is instanced rendered to the screen (1 per cell). The instance number is then used to determine the cell's position in xz space as well as z space using a sine wave. Only cubes which represent alive cells are rendered by moving vertices belonging to dead cells outside of screen space so they are clipped before the rasterizing stage of the GL pipeline.