From e76dd1c6f0e075b1c6f7c99b138d02361ecca55f Mon Sep 17 00:00:00 2001 From: ritenseki Date: Thu, 7 May 2026 19:52:38 +0800 Subject: [PATCH] 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 --- Assets/Scripts/umamusume/Gallop/Live/Director.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/umamusume/Gallop/Live/Director.cs b/Assets/Scripts/umamusume/Gallop/Live/Director.cs index f317a09..b250a1d 100644 --- a/Assets/Scripts/umamusume/Gallop/Live/Director.cs +++ b/Assets/Scripts/umamusume/Gallop/Live/Director.cs @@ -394,12 +394,12 @@ namespace Gallop.Live private void OnBgColor2Update(ref BgColor2UpdateInfo updateInfo) { - // color1/color2 are a two-tone gradient; value is blend power. - // Exact target shader properties are unconfirmed — driving ambient gradient for now. - // TODO: verify against original game; may target stage background mesh materials instead. - RenderSettings.ambientSkyColor = Color.Lerp(updateInfo.color1, updateInfo.color2, updateInfo.value); - RenderSettings.ambientEquatorColor = updateInfo.color1; - RenderSettings.ambientGroundColor = updateInfo.color2; + if (_stageController == null) return; + Color c = Color.Lerp(updateInfo.color1, updateInfo.color2, updateInfo.value); + foreach (var r in _stageController.GetComponentsInChildren()) + foreach (var mat in r.materials) + if (mat.HasProperty("_AmbientColor")) + mat.SetColor("_AmbientColor", c); } private void OnGlobalFogUpdate(LiveTimelineGlobalFogData fogData, LiveTimelineKeyGlobalFogData keyData)