Fix BgColor2 to write _AmbientColor on stage materials

Replaces incorrect RenderSettings.ambient* with per-material
_AmbientColor writes on stage renderers, confirmed via live10106
material dump.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ritenseki
2026-05-07 19:52:38 +08:00
parent d0c1a20e95
commit e76dd1c6f0
@@ -394,12 +394,12 @@ namespace Gallop.Live
private void OnBgColor2Update(ref BgColor2UpdateInfo updateInfo) private void OnBgColor2Update(ref BgColor2UpdateInfo updateInfo)
{ {
// color1/color2 are a two-tone gradient; value is blend power. if (_stageController == null) return;
// Exact target shader properties are unconfirmed — driving ambient gradient for now. Color c = Color.Lerp(updateInfo.color1, updateInfo.color2, updateInfo.value);
// TODO: verify against original game; may target stage background mesh materials instead. foreach (var r in _stageController.GetComponentsInChildren<Renderer>())
RenderSettings.ambientSkyColor = Color.Lerp(updateInfo.color1, updateInfo.color2, updateInfo.value); foreach (var mat in r.materials)
RenderSettings.ambientEquatorColor = updateInfo.color1; if (mat.HasProperty("_AmbientColor"))
RenderSettings.ambientGroundColor = updateInfo.color2; mat.SetColor("_AmbientColor", c);
} }
private void OnGlobalFogUpdate(LiveTimelineGlobalFogData fogData, LiveTimelineKeyGlobalFogData keyData) private void OnGlobalFogUpdate(LiveTimelineGlobalFogData fogData, LiveTimelineKeyGlobalFogData keyData)