Skip to content

27 September 2024 - Lighting is final!

<<< Previous Post Next Post >>>


  I went on a bit of a hiatus for a while as I focused on other stuff.

  This one is short: Remember that old lighting bug when I added pixel shadows? The one where it created weird triangle artifacts? That bug is no more!

  With some fancy math (creating a 3x3 rotation matrix from the normal, binormal, and tangent vectors of the face being rendered) I was able to properly rotate the shadow projection in 3D space to align it to the surface.

  If that makes zero sense to you, here's a before/after that should make more sense:

The before image. The shadow should exist in discrete squares along the pink surface, but the squares are distorted and have strange, nonsensical angles. The after image. The squares of the shadow now align to match the angle of the pink surface they are being cast upon.