Closed PiKeyAr closed 5 years ago
Turns out the code "Allow Dynamic Light Direction Globally" in the Mod Loader enabled this functionality in SADX. Looks like the rotation values are the same between SADX and SA1. I remember having to introduce a workaround because light direction was breaking at the Final Egg base, I think it may've been caused by the light direction being rotated before the rotation is reset while switching between acts. I'll post here if I catch it again.
I thought we'd figured this out for good, but... Here we go again. Up until now the assumption was that the light direction in SA1 Mystic Ruins ignores Y/Z rotation specified in the SL file, and its vector is therefore always { 0, -1, 0 }. The rotations specified in the SL file are indeed ignored. However, the light vector is still rotated. While investigating a related report, I found out that light direction in almost all parts of the Mystic Ruins is offset, sometimes very slightly so it's almost unnoticeable. After retrieving light rotations from memory I found out that it's hardcoded for all acts except Eggman's base. The values differ between acts and times of day. Here are all of them:
How to deal with this in the Lantern mod, I'm not sure. It has to be a code-based solution because there aren't enough SL files for MR to cover all rotations. Perhaps use the function referenced as "SkyBox_MysticRuins_TimeOfDayLightDirection" in the disassembly?