Lighting Smoothing Plans (Patreon)
Content
I'm looking into ways to smooth out the diagonal shadows in the surface lighting caches when they're expanded from the lightmap data.
First, the good news: Since Retroquad splits the colored lighting into two separate 8-bit surface caches (one for brightness, and other for hue & saturation), I can implement the smoothing into the brightness alone, which will be enough to make the lighting look smooth while ensuring that its impact on the performance of the colored lighting will be limited to the same impact it will have on the performance of the white lighting.
Now, the complications: I'll have to rewrite the entire lightblock-to-luxel algorithm. The bilinear filtering method used right now generates each luxel from the four closest lightblocks, but this is not enough to detect diagonals. Trying to generate diagonals from just 4 brightness points would make isolated lightblocks to be expanded into a diamond shape, which would look awfully wrong (imagine a tiny square hole into a wall, and the light coming from it becoming diamond-shaped instead of a square). The current bilinear filter turns such isolated light blocks into circles, which is a more accurate behavior since the result won't look like the light rotated in midair.
The new lightblock-to-luxel algorithm will have to parse a greater amount of lightblocks per luxel, so it can properly detect the angles of the shadows. I'm still analyzing the data to see the most efficient way to do this.