Refactor asset loading and shadow pass preparation

  • Refactor AssetManager and asset classes to use Ctor structs for initialization.
  • Move Deferred rendering logic to a separate file.
  • Implement Checkbox UI component.
  • Add castShadows flags to lights and meshes .
  • Refactor asset processing.
  • Implement placeholder shadow shaders and integrate shadow pass into the Render class.
  • Update SceneEditor with a debug panel for toggling rendering features.

It is time to implement shadows. I don’t think adding shadows gives a lot of value to the game, but I probably need to do it for my sanity. I am looking at how the game looks, and I feel it does not need shadows. On the other side, there are some cases that look weird. For example, in the crystal sanctuary area, I put several crystals and they are emitting light. And if I enter the crystal sanctuary room, the light from crystals is bleeding into that room and it looks weird. Or in the respawn area, I put the light on the ceiling and it bleeds outside of the respawn room. I can adjust the lights to make it less jarring, but on the other side, I could just implement shadows. And just to give peace to my soul, I am going to spend some time and implement shadows in my game.

First step, I am going to add the flag to the lights and meshes castShadows. I realized I need to update the assets loader to take that parameter, and since it makes the line that takes all those parameters too long, I refactored assets loading and processing a bit.

I also decided to refactor the code and move the Deferred class into a separate file. Plus, I added the Checkbox class so I can add some UI elements for easier debugging. Hopefully tomorrow I’ll start working on shadows and finish the implementation.

Next - Previous