I am trying to create a 3d cellular automata, largely inspired the methods used by Evan Wallace’s 3d cellular automata project.
- Conway’s Game of Life in 3D (Evan Wallace)
They mention using two 3d textures which ping-pong off each other, and is visualized by using “instanced cubes with one instance per grid cell”.
My question is how do I use a 3D texture to instance these cubes?
I understand how to instance objects, using glDrawElementsInstanced()
and calling gl_InstanceID
with an array of data, but I’m just struggling to figure out how to access texture data using that method.
- Do I store positions alongside cell state in the texture?
- Or do I still send in an array of transformations and use that?
I am still rather new to OpenGL, so apologies if there is a large gap in my understanding of how all of this works.