Learning Game Engines the Hard Way

Lumina!

I was always interested in how things worked under the hood more than making the thing or the “thing” itself. I remember the first time I opened Unreal Engine 4 and started following a fps game tutorial on youtube, the biggest thought in my head was –

“Man, making a game sucks!”

But I wondered how these graphics are actually coded. Do they actually simulate light rays following light theory in physics and everything just “works”? What language does the gpu understand? Are the buildings in Los Santos still being “drawn” while I’m in Vinewood? Can I write my own c program and upload it my gpu and run it? Unity is definitely easier but its graphics look nothing like Unreal!

I wanted to learn how to make those graphics for myself.

I immediately started googling graphics rendering, shaders, shading models, OpenGL vs DirectX, etc. I discovered the OpenGL and the Game Engine series by The Cherno. This was around the time I of my first programming class in university – “Intro to C/C++”.

Learning C/C++ and basics of programming while navigating the graphics programming tutorials of OpenGL made me so overwhelmed and frustrated that for a period of my bachelors, I gave up on programming and focused on my Electronics degree for my career.

But soon, an internship opportunity highly incentivized to learn python and backend development in flask/django on the job. I actually liked it and I invested time in learning web development and a lot of full stack skills for the internship – which lead to me getting an offer for a hybrid role of Data Scientist/SDE.

Fast forward to now, I’m in another country (Canada) and done with my masters’, looking for a job. I’m not really interested in the modern Gen-AI centred job market so I made the decision to just try learning C++ and OpenGL again and make another attempt to learn how to make a game engine.

Surprise surprise! I am a much more comfortable with programming and also have a lot of experience now! So I actually understood the concepts a lot more quickly and intuitively, and made a lot of progress with OpenGL and beginner realtime rendering concepts.

Then I decided to actually get serious and make a 3D game engine with Vulkan as my choice of graphics API and cross platform compatibility in mind because I got a new Macbook M4 that I wanted to use and not my crappy old windows laptop.

The game engine is called “Lumina” and I plan to use it as my playground for learning the cutting edge rendering and software architecture. Some of the planned features are –

  1. A fully gltf 2.0 PBR shading model compliant renderer.
  2. Fully bindless rendering.
  3. Multi-threaded command buffer recording.
  4. Framegraphs.
  5. Deferred -> Clustered Deferred -> Forward+.
  6. Compute-based frustum & occlusion culling, LOD selection and indirect draw call generation.
  7. Meshlet rendering – mesh shaders + compute fallback.
  8. Hybrid Global Illumination – Baked + DDGI. (I want to learn SDF tracing as well.)
  9. Cascaded Shadow Maps + Contact Shadows + Soft Shadows.
  10. Temporal AA.
  11. SSRI + Ray traced reflections.
  12. Volumetrics – Volumetric fog, Light Scattering, God Rays

These are just some of the main features I plan to work on. My plan with this project is to get a baseline scaffolding up (think event system, input windowing, ECS, and a good CMake setup etc) and then focus on the rendering core. All the other systems like physics, AI, scripting etc will be after the rendering core reaches a level of maturity that I’m satisfied with.

I’m in the process of setting up a github repo for the purposes of this blog, separate from the one I’m currently working in. I want to keep the messiness of my playground out of the blog showcases.

So stay tuned, my next blog post will go deeper into the current state of the project, (I’ve been working on this for about 5 months now) and what I plan to do, with more blog posts coming in about some of the architectural decisions I made.

Keep Learning!

Leave a comment