From b1dfe847f742aa7079a819090ba36d606e7af4db Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Thu, 29 Oct 2026 23:01:05 -0400 Subject: LUT tweaks Signed-off-by: Andrew Opalach --- Plugin.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'Plugin.cs') diff --git a/Plugin.cs b/Plugin.cs index 7ae5c2e..a2d0f19 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -613,7 +613,6 @@ namespace WorldTuningTool } // Start of Parameter Definitions. - private delegate void OnAreaChange(nint sMhArea); private Hook? onAreaChange; @@ -931,10 +930,11 @@ namespace WorldTuningTool private Hook? destroyBloomObject; private nint bloomObject = 0x0; private static Parameter[] bloomParameters = { - // Disabling 'Draw' is a bad way to disable bloom. It breaks the filter on initial load which - // can be seen when returning to title or opening a guild card for the first time. Setting 'Bloom Renormalize' - // to 0.0 or 'Bloom Reduction Resolution' to -1 can both effectively disable bloom without that issue. - //newFlag("Bloom Enabled", 0x14, ParameterType.FLAG, (1 << 1)), // Draw + // Disabling "Draw" is a bad way to disable bloom as it breaks the filter on initialization. + // It can be seen when returning to title or opening a guild card for the first time. + // Setting "Bloom Renormalize" to 0.0 or "Bloom Reduction Resolution" to -1 can both + // effectively disable bloom without that issue. + //M("Bloom Enabled", 0x14, ParameterType.FLAG, (1 << 1)), // Draw P("Bloom Threshold", 0x204, ParameterType.FLOAT, pStep(0.001f)), P("Bloom Renormalize", 0x208, ParameterType.FLOAT, pMin(0.0f)), P("Bloom Color", 0x200, ParameterType.COLOR), @@ -2283,6 +2283,9 @@ namespace WorldTuningTool sslrEnvMapIntensity.Update(sMhScene!.Instance, true); } + // Any CreateObject() can be called many times consecutively before it's associated DestroyObject(). + // For this to be correct, the most recent CreateObject() needs to be the object that is used. + // This is why we cannot, for example, Assert(toneMapObject == 0x0) in CreateToneMapObjectHook(). private nint CreateToneMapObjectHook() { toneMapObject = createToneMapObject!.Original(); @@ -2290,6 +2293,7 @@ namespace WorldTuningTool { param.Update(toneMapObject); } + Lut.clearState(); return toneMapObject; } @@ -2303,7 +2307,6 @@ namespace WorldTuningTool { param.Update(toneMapObject); } - Lut.clearState(); } return destroyToneMapObject!.Original(toneMapObjectInternal, unknownInt); } -- cgit v1.2.3-101-g0448