Render to texture and model cleanup

I did a bit of grunt work as I was getting frustrated with the look of the scene and the usability of the software while working on rendering. This implied a rework of many models making them more colorful, better optimized (removed duplicate vertices and fixed normals) and standardized (they all face the same directions -Z). I could then update my code to work in a more standard way now that models have been oriented properly. I also added a separate debug camera (in the top left corner), and the necessary code to render to texture (which is now displayed on the platform screens).

New models, better debug experience, first steps for deferred renderin

Surface normals visible on the platform screens after pre-calculation

Time spent for this Time spent so far
15 h 135 h

Now if you are reading this, I suspect you want more details, so here goes:

  • Attached a debug camera to the single light (used for debug) in the top left corner.
    • this was useful for debugging, and incredibly easy to add because all my codebase was meant to support these kind of changes very easily!
  • Reworked most models (with the help of an artist, thanks Bobby!). They now have a much better look!
  • Removed A LOT of hardcoded workarounds thanks to the standardization / re-orientation mentioned before. I used to have various rotations applied in engine to the different models to make them all face the same -Z direction.
    • The code is now simpler to manage (less brain gymnastics and self-doubts).
    • In other words, moving forward now means going in the -Z direction, moving left going in -X and moving up up is +Y, and so for every models.
  • Did some research for the obj material file format; tweaked it for a couple of models.
  • Added an “arrow” model. It is used to get a sense of scale (size is +10 in all direction) and showing world space XYZ directions.
    • Colored it in RGB they provide a visual reminder in the world of what is the “standard” orientation. This was helpful for debugging.
  • Added a camera and a light model to visualize these objects in the game world.
  • Added support for FrameBuffers objects. It is basically a texture to which you can render instead of the window screen.
    • Added a single framebuffer for every camera (should be done more dynamically in the future though).
  • Modified the landing pad model to have the screens oriented towards +X +Z, and colored accordingly (Red and Blue). Each screen now have their individual material.
    • Using these separate materials, I can now display separate textures.
  • Added SSAO input shader (more on that in a future post…).
    • This shader stores the depth and surface normals viewed by the cameras in their respective framebuffers
    • These pre-render steps are actually visible on the platforms’ screens (surface normals). Top left camera (what the light object is illuminating) is shown on the blue screen, while main camera is shown on the red screen (what the player camera is seeing).
  • Added ability to reload shaders during execution for debugging (backspace key)
    • This is very helpful for debugging and showing the effect of shader changes “live”. No need to restart and recompile anymore.

See also