Gecko: Game Engine

Origins of this game engine come from uni where we were taught the basics of OpenGL and shaders, which are programs that run directly on the GPU. Back then, the rendering of models involved something that lacked textures, that lacked animations and didn’t have terrain. It was indeed very basic, but a small accomplishment for myself given the difficulty in graphics programming. That rendering engine evolved into a game engine then written in C++ and in the interlude graduate years since 2016 had fallen into disrepair due to ageing of code and external dependencies not being upgraded. To that end, the game engine sported the following renderable features:

  • 3D Models
  • Skybox
  • Sprites
  • Text rendering

Since the pandemic, I had taken unto myself a challenge to port that rusty game engine over to Golang, still utilising OpenGL. That has been a remarkable feat as there wasn’t much help to receive as to the hows and whats of graphics programming in Golang. But, thankfully there was a Golang binding for OpenGL with the same interface as in C++. It first began with the model loader, then the skybox, then sprites and also the text. In time new features were added, for in addition to the previous, we now also have:

  • 3D Model enhanced with:
  • Water, including
  • Terrains
  • Various types of cameras, including
  • Collision detection between objects in determining position
  • Ray tracing
  • Vegetation rendering as quads
  • Rendering of fire

img
The above image was rendered on my Dell XPS 13” which isn’t exactly meant for use as a gaming rig, let lone anything graphics-intensive, thus far it has proven capable for what it can do with the game engine, development-wise. Indeed, the scene we can see at the moment involves a big piece of code that manually determines which objects are placed where. There is scope for moving away from this way of instantiating a scene to instead create a scene from a file, but that may first require a world builder in order to visually see how the objects will be created and placed where on the scene.