Sky colour: set 2’s point light

Why the rebuild’s Palace (st03) sky is deep purple where the game’s is white-grey with blue-grey shade. Decoded from PDUWP.exe (our reading; addresses as leads) and the stage scripts, then checked by renders of our build against xemu frames (a check, not a fit: no value below comes from footage).

The wrong step

One step of the cloud colour is missing in the rebuild: point light 0 of light set 2. The skyglow run read it as black and the build draws the sky model with p0 = 0. Everything else on the list was re-checked and is as decoded: vertex colour scale (u8 / 255, raw), texture colour space (raw, no gamma), blend (source alpha / one for the clouds, per material for SC), light set 2 for model 2, draw order, glow chain.

Step Game Rebuild (4efcac8)
Point term of SBTSCLOUD3 sat(sat(N·P) · c5 + sky), c5 = set 2’s point light 0 colour, P = direction to the light × range / distance² c5 = 0: sky only
St03 result most of the dome t0 × (1, 1, 1); t0 × (0.33..0.76, 0.41..0.63, 0.78..1.0) only where the point term fades t0 × (0.68, 0.59, 1.0) everywhere: purple
St02 result t0 × (1, 1, 0.71..0.87) t0 × (0.85, 1.0, 0.83): red 15 % low, slightly green

The point light record (H, code and data)

Set 2 on every versus stage (script values; k over the cloud dome’s vertices)

Cloud dome (model 2, SBTSCLOUD3): 377 vertices on most stages, rim radius 11 100..12 800, top 2 700..4 700 above the origin.

Stage Light Sky Point light 0: colour, range k p10 / p50 / p90 Fog of set 2
st01, st08 (255, 70, 0) 0 none none
st02 (45, 97, 40) (181, 187, 180) (113, 94, 0), 9e8 5.4 / 15.6 / 80 exp 8e-5, black
st12 (28, 33, 26) (11, 11, 11) (90, 90, 90), 9e8 5.4 / 16.2 / 113 exp 1.4e-4, black
st22 (17, 17, 17) (50, 50, 50) (89, 89, 89), 9e8 4.8 / 12.8 / 60 exp² 2e-5, (49, 49, 49)
st03 (110, 55, 150) (85, 105, 200) (225, 255, 220), 1e8 0.77 / 2.4 / 14 linear 1 602..12 822, (30, 45, 55)
st13 (238, 190, 28) (252, 210, 67) none linear 1 602..12 822, (250, 200, 58)
st23 (250, 98, 87) (249, 118, 101) (187, 137, 74), 1e9 8.8 / 27 / 73 none
st04, st24 (55, 55, 55) (140, 140, 140) (155, 155, 155), 1e8 0.62 / 1.7 / 5.5 linear 2 919..12 606, (20, 20, 20)
st14 (37, 39, 39) (167, 188, 171) none exp² 1.4e-4, (11, 19, 18)
st05 (18, 18, 18) (119, 103, 83) (145, 145, 145), 1e8 0.58 / 1.6 / 6.9 linear 8 031..13 512, (16, 11, 9)
st15 (160, 160, 160) (124, 124, 124) (200, 200, 200), 1e8 0.58 / 1.6 / 6.9 linear 8 031..13 512, (30, 30, 30)
st25 (224, 218, 200) (140, 150, 160) (255, 200, 118), 1e8 0.58 / 1.6 / 6.9 linear 9 192..15 498, (20, 0, 30)
st06 (100, 100, 100) (103, 106, 107) (25, 195, 24), 5e6 0.04 / 0.14 / 0.29 linear 1 317..12 999, (26, 31, 29)
st16 (80, 100, 190) (70, 67, 67) black, 5e6 linear 5 778..12 192, (20, 11, 9)
st26 (68, 25, 5) (80, 80, 80) (159, 159, 179), 5e6 0.04 / 0.14 / 0.29 linear 3 390..10 797, (11, 9, 14)
st07 (58, 58, 58) (27, 5, 10) (90, 74, 77), 1e8 0.59 / 1.7 / 9.6 none
st17 (45, 54, 58) (15, 18, 22) (50, 65, 96), 1e8 0.58 / 1.5 / 5.3 linear 7 653..13 524, (79, 104, 118)

Ground colour of set 2 is 0 on every stage. Positions (game order): st02 / st12 / st22 (−864.0, 1 006.3, 4 505.4); st03 (−1 692.1, 1 395.2, 1 733.6); st23 (105.6, 961.3, 0); st04 / st24 (−2 834.3, −614.4, −647.6); st05 / st15 / st25 / st07 / st17 (−1 568.5, −293.6, 4 521.8); st06 / st16 / st26 (−595.8, −258.8, 0). The rebuild is wrong by the point term on the 14 stages with a coloured light: strongly on st03, st04 / st24, st05 / st15 / st25, st12, st22, st07, st17 (dark or tinted sky, bright neutral light), mildly on st02 and st23 (their sky is already bright), barely on st06 / st26 (k under 0.3). St13, st14, st01, st08 and st16 have no point term and are right today.

Check against footage (renders of our build with the light switched on by a probe flag)

Same intro camera as the footage (st03 shot 2, st02 shot 0), 1280 × 720, mean colour of a sky box; the cloud scroll phase differs between frames, which moves a mean by up to ± 0.1.

Sky Mean RGB R : G : B Clipped pixels
St03 xemu, three frames (0.38..0.66, 0.43..0.70, 0.51..0.76) 0.75..0.87 : 0.84..0.92 : 1 1..36 %
St03 ours today, PC look (0.24, 0.23, 0.39) 0.62 : 0.59 : 1 0
St03 ours + point light, PC look (two phases, the second without glow) (0.20, 0.23, 0.27), (0.36, 0.39, 0.43) 0.74..0.84 : 0.85..0.91 : 1 0..7 %
St03 ours + point light, Xbox look (two phases, the second without glow) (0.16, 0.19, 0.23), (0.27, 0.31, 0.35) 0.70..0.77 : 0.83..0.89 : 1 0
St02 xemu, three frames (0.61..0.64, 0.54..0.58, 0.37..0.39) 35..40 %
St02 ours today, Xbox look (0.61, 0.51, 0.30) 19 %
St02 ours + point light, Xbox look (0.70, 0.60, 0.36) 39 %
St02 ours today / + point light, PC look (0.75, 0.68, 0.46) / (0.76, 0.69, 0.48) 52 / 55 %

Implementation notes for the rebuild (built in skycol 11-15: pdconv points, PdData.set_point_light for every material under sets 1..3, the Xbox look’s [0, 1] clamp in the cloud shader; test godot/tests/test_skycol.gd)

  1. pdconv: write each set’s point lights into light.json (points: colour 0..1, position in the script’s order, range), from the 0x2005 records it already reads.
  2. PdData: give the sky model’s materials (light set 2) that set’s point light 0: p0_c5 = colour, p0_range = range, p0_pos = position (game order, z mirrored, × 0.1), fixed in the world. The cloud shader already has the term. Set 0 keeps its effect-light rule.
  3. Xbox look: clamp the packed point vector to [0, 1] before unpacking (PC look keeps [−1, 1]).
  4. Expect at st03 intro shot 2: sky R : G : B about 0.8 : 0.87 : 1 (today 0.62 : 0.59 : 1), a white core toward the light, mean luma about 0.2..0.4 depending on the scroll phase. At st02 intro shot 0, Xbox look: about (0.70, 0.60, 0.36), 39 % clipped.
  5. Re-shoot st04 / st24, st05 / st15 / st25, st07 / st17, st12 and st22 after the change: their skies gain the most after st03 and have not been compared with footage.
  6. (skybright 11-15: settled.) The remaining 2 × on st03 against xemu is the sky model’s opaque svc backdrop dome, which pdconv drops: “St03 sky brightness against the Xbox”.