Refactoring the rendering system

Coming back after a long break, I wanted to work on improving the rendering. First task was to do some pretty heavy refactoring of the rendering handler to allow it to support different shaders efficiently. This also required changing the camera code to allow application of different shaders on different views. I didn’t want to just hardcode everything, I wanted something more flexible. The animation below shows the work in progress. So, even though the cameras stopped working properly for now, game logic and collision handling continued to work. This shows the value of isolating components and objects and compartmentalizing the game engine properly!

Animated gif showing black screen but game logic still run - Logging shows that events are still happening

Black screen with no rendering but game logic still runs

Also, let's imagine collision bug is fixed! (I will admit though, it looks quite boring now...)

Time spent for this Time spent so far
20 h 70 h

Once again, this took longer than one can imagine as it meant:

  • going back to a code base I had not worked with in 3 months
    • (and my day job has nothing to do with this type of code…)
  • reading through documents and comments to remind myself how things work
    • thankfully they were written properly, gg me!
  • cleaning up some code, add some asserts, fix small bugs
  • updating the camera class to contain all that is needed to render from them
    • (now cameras have dirty flags for their matrices to avoid recalculations)
  • moving shader from camera class to rendering handler
    • make camera register themselves to the shader we want to run on them
  • preparation work to use several advanced rendering shaders together

Suggestions de lecture :