GPU Life

January 26, 2009

After a night of extreme boredom I present…GPU Life! A faast implementation of Conway’s Game of Life

Life!

It runs on the GPU as a fragment shader, and is fully capable of running at 60FPS, with 1.6 million cells using only 5% CPU on my (1.5 year old) laptop. Screensaver potential at 25 fps or so? if anyone wants to try it, you will probably have to change the WIDTH/HEIGHT defines in main.c, and in life.glsl.

Repository at
http://hortont.com/repo/life

Some mixed code and concepts from GPUlife for OSX and some various shaders around the internets.

6 Responses to “GPU Life”

  1. Michael Gauthier Says:

    Winamp’s Milkdrop music visualization has shader support and some presets use the game-of-life with an oscilloscope as the seed. Looks really cool and runs really quickly. I think Milkdrop is open-source so it might be worth taking a look at.

  2. Mitchell Says:

    Is it hooked up to the engine from Golly? If not, that might make it even faster!

  3. Wouter Says:

    ./life
    Mesa 7.0.4 implementation error: User called no-op dispatch function (an unsupported extension function?)
    Please report at bugzilla.freedesktop.org
    Mesa 7.0.4 implementation error: User called no-op dispatch function (an unsupported extension function?)
    Please report at bugzilla.freedesktop.org

    Too bad, it doesn’t work on my ancient hardware 🙂

  4. las Says:

    Nice work – works fast & smooth on my NV 8400 GS.

  5. ytrp Says:

    Thank you for posting the source to this, the shader is very educational.


  6. […] Following Robb’s recent blog post about an implementation of Life as a GLSL shader, I now present to you a Mac OS X […]


Comments are closed.