Engine: CustomEnginev0.1
Languages Used: C++, GLSL
Platform: PC
Development Duration: 2 Weeks
Library/API/Framework: OpenGL, GLFW, GLAD
Engine: CustomEnginev0.1
Languages Used: C++, GLSL
Platform: PC
Development Duration: 2 Weeks
Library/API/Framework: OpenGL, GLFW, GLAD
Conway's game of life has 4 simple rule that governs the simulation, they are:
Any live cell with fewer than two live neighbours dies
Any live cell with more than three live neighbours dies
Any live cell with two or three live neighbours lives, unchanged, to the next generation.
Any dead cell with exactly three live neighbours will come to life.
The biggest challenge for this project was trying to figure how to best render the cells. If each cell were to use a quad, then our simulation resolution would need be lower as at certain number of cells, drawing that many quads at once would result in a big performance hit. My solution to this was to simply reduce the simulation to one quad representing the whole screen, and run the simulation through shaders and using multiple passes and the frame buffer.
Running the simulation through shaders allows for a much larger simulation resolution (where each cell is almost pixel level) while also keeping performance reasonable.
This project was also when I finally took the time to attempt at a cleaner architecture for an OpenGL based application. Proper classes were made to hide away (abstracted) all the lower level OpenGL functions (dealing with meshes, shaders, etc) so that they can be used easily, and other things like buttons/UI.
Users can draw/erase on the grid with their pointers, change the simulation speed, play/pause the simulation, and change the resolution of the grid.