From d6822fe63f1023caf3c72bf3f9b654c8779c285a Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Wed, 5 Aug 2026 15:16:08 -0400 Subject: Refactor parameters to reduce noise Signed-off-by: Andrew Opalach --- Plugin.cs | 896 ++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 457 insertions(+), 439 deletions(-) diff --git a/Plugin.cs b/Plugin.cs index d93625d..9cb230e 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -75,10 +75,15 @@ namespace WorldTuningTool #endif } - private static nint lton(long l) { unchecked { return (nint)l; } } + public static nint lton(long l) { unchecked { return (nint)l; } } private static byte ByteFlag(bool f) { return f ? (byte)0x1 : (byte)0x0; } + private static int BitIndex(int mask) + { + return BitOperations.Log2((uint)(mask & (-mask))); + } + private static Vector4 ColorVectorFromInt(int c) { return new Vector4( @@ -288,8 +293,7 @@ namespace WorldTuningTool private static class ParameterFlags { - public const int PerFrame = 1; - public const int NoOverride = 1 << 1; + public const int ViewOnly = 1; } public abstract class Parameter @@ -306,8 +310,7 @@ namespace WorldTuningTool private bool overrideWasOn = false; private int flags; - public bool NoOverride => (flags & ParameterFlags.NoOverride) == ParameterFlags.NoOverride; - public bool PerFrame => (flags & ParameterFlags.PerFrame) == ParameterFlags.PerFrame; + public bool ViewOnly => (flags & ParameterFlags.ViewOnly) == ParameterFlags.ViewOnly; protected float stepf, minf, maxf; protected int step, min, max; @@ -334,19 +337,23 @@ namespace WorldTuningTool Name = name; hiddenName = "##" + Name; Type = type; + switch (Type) + { + case ParameterType.FLAG: + Assert(mask != 0); + break; + case ParameterType.PATCH_FLOAT: + valueV.X = MemoryUtil.Read(offset); + pendingUpdate = false; + break; + case ParameterType.SHADOW_RESOLUTION: + valueInt = 1; + pendingUpdate = false; + break; + } this.offset = offset; this.mask = mask; this.flags = flags; - if (Type == ParameterType.PATCH_FLOAT) - { - valueV.X = MemoryUtil.Read(offset); - pendingUpdate = false; - } - else if (Type == ParameterType.SHADOW_RESOLUTION) - { - valueInt = 1; - pendingUpdate = false; - } } public bool PendingUpdate() @@ -403,7 +410,7 @@ namespace WorldTuningTool } break; } - if (PerFrame || lastAddr == 0x0) + if (lastAddr == 0x0) { return; } @@ -414,21 +421,34 @@ namespace WorldTuningTool MemoryUtil.GetRef(lastAddr + offset) = (byte)valueInt; break; case ParameterType.FLAG: + { + ref int i1 = ref MemoryUtil.GetRef(lastAddr + offset); if (valueInt != 0) { - MemoryUtil.GetRef(lastAddr + offset) |= mask; + i1 |= mask; } else { - MemoryUtil.GetRef(lastAddr + offset) &= ~mask; + i1 &= ~mask; } break; + } case ParameterType.INT: case ParameterType.ALIGNED_INT: case ParameterType.HEX: case ParameterType.COLOR: - MemoryUtil.GetRef(lastAddr + offset) = valueInt; + { + ref int i1 = ref MemoryUtil.GetRef(lastAddr + offset); + if (mask != 0) + { + i1 = (i1 & ~mask) | ((valueInt << BitIndex(mask)) & mask); + } + else + { + i1 = valueInt; + } break; + } case ParameterType.FLOAT: MemoryUtil.GetRef(lastAddr + offset) = valueV.X; break; @@ -445,6 +465,22 @@ namespace WorldTuningTool } } + public void ForceOverrideOn() + { + if (!queuedOverride && !overrideValue) + { + OverrideOn(false); + } + } + + public void ForceOverrideOff() + { + if (queuedOverride || overrideValue) + { + OverrideOff(); + } + } + public void OverrideOn(bool forStage) { if (pendingUpdate) @@ -527,11 +563,6 @@ namespace WorldTuningTool } } - private int bitIndex(int mask) - { - return BitOperations.Log2((uint)(mask & (-mask))); - } - public void Update(nint baseObject, bool fromHook = false) { lastAddr = baseObject; @@ -606,21 +637,29 @@ namespace WorldTuningTool case ParameterType.COLOR: { ref int i1 = ref MemoryUtil.GetRef(baseObject + offset); + int m1 = i1; if (mask != 0) { - i1 = (i1 & mask) >> bitIndex(mask); + m1 = (i1 & mask) >> BitIndex(mask); } if (overrideValue) { - if (i1 != valueInt) + if (m1 != valueInt) { - oValueInt = i1; + oValueInt = m1; + } + if (mask != 0) + { + i1 = (i1 & ~mask) | ((valueInt << BitIndex(mask)) & mask); + } + else + { + i1 = valueInt; } - i1 = valueInt; } else { - valueInt = i1; + valueInt = m1; } break; } @@ -947,7 +986,7 @@ namespace WorldTuningTool { ImGui.PushID(Name); - if (NoOverride) + if (ViewOnly) { ImGui.SetCursorPos(ImGui.GetCursorPos() + new Vector2(ImGui.GetFrameHeight() + ImGui.GetStyle().ItemSpacing.X, 0.0f)); } @@ -958,6 +997,8 @@ namespace WorldTuningTool ImGui.PushItemFlag(ImGuiItemFlags.Disabled, true); ImGui.PushItemFlag(ImGuiItemFlags.MixedValue, true); } + // If OverrideOn() were to set queuedOverride instead of overrideValue, this parameter shouldn't be drawn. + Assert(!PendingUpdate()); bool toggleOverride = overrideValue; if (ImGui.Checkbox("##Override", ref toggleOverride)) { @@ -1155,23 +1196,6 @@ namespace WorldTuningTool } } - public static int pFlags(string s) - { - int flags = 0; - for (int i = 0; i < s.Length; i++) - { - switch (s[i]) - { - case 'f': - flags |= ParameterFlags.PerFrame; - break; - default: - break; - } - } - return flags; - } - public static (float?, float?, float?) pStep(float step) { return (null, null, step); } public static (float?, float?, float?) pMin(float min) { return (min, null, null); } public static (float?, float?, float?) pMax(float max) { return (null, max, null); } @@ -1186,29 +1210,19 @@ namespace WorldTuningTool public static (int?, int?, int?) pMinMaxStep(int min, int max, int step) { return (min, max, step); } public static (byte?, byte?, byte?) pStep(byte step) { return (null, null, step); } - public static Parameter newParameter(string name, nint offset, ParameterType type, (T? min, T? max, T? step) m = default) where T : unmanaged + public static Parameter P(string name, nint offset, ParameterType type, (T? min, T? max, T? step) m = default) where T : unmanaged { return new Parameter(name, offset, 0, type, m.min, m.max, m.step, 0); } - public static Parameter P(string name, nint offset, ParameterType type, int flags, (T? min, T? max, T? step) m = default) where T : unmanaged + public static Parameter V(string name, nint offset, ParameterType type, (T? min, T? max, T? step) m = default) where T : unmanaged { - return new Parameter(name, offset, 0, type, m.min, m.max, m.step, flags); + return new Parameter(name, offset, 0, type, m.min, m.max, m.step, ParameterFlags.ViewOnly); } - public static Parameter newFrameParameter(string name, nint offset, ParameterType type, (T? min, T? max, T? step) m = default) where T : unmanaged + public static Parameter M(string name, nint offset, ParameterType type, int mask, (T? min, T? max, T? step) m = default) where T : unmanaged { - return new Parameter(name, offset, 0, type, m.min, m.max, m.step, ParameterFlags.PerFrame); - } - - public static Parameter newParameterView(string name, nint offset, ParameterType type, (T? min, T? max, T? step) m = default) where T : unmanaged - { - return new Parameter(name, offset, 0, type, m.min, m.max, m.step, ParameterFlags.NoOverride); - } - - public static Parameter newFlag(string name, nint offset, ParameterType type, int mask) where T : unmanaged - { - return new Parameter(name, offset, mask, type, null, null, null, 0); + return new Parameter(name, offset, mask, type, m.min, m.max, m.step, 0); } private static Parameter? getParameterByName(string name) @@ -1383,7 +1397,7 @@ namespace WorldTuningTool { foreach (Parameter iterParam in allParameters) { - if (iterParam.NoOverride) continue; + if (iterParam.ViewOnly) continue; if (overridesContainsParam(currentOverrides, iterParam)) continue; bool isSelected = Param == iterParam; if (ImGui.Selectable(iterParam.Name, isSelected)) @@ -1551,124 +1565,124 @@ namespace WorldTuningTool private static Lights lights = new Lights(); - private static Parameter hqMode = newParameter("HQ Mode", 0xE9A3, ParameterType.BOOL); + private static Parameter hqMode = P("HQ Mode", 0xE9A3, ParameterType.BOOL); private static Parameter[] lodParameters = { - newParameter("LOD Bias 1", 0x21C, ParameterType.FLOAT, pMin(0.0f)), - newParameter("LOD Bias 2", 0x220, ParameterType.FLOAT, pMin(0.0f)), - newParameter("LOD Caster Bias", 0x1E4, ParameterType.FLOAT, pMin(0.0f)), + P("LOD Bias 1", 0x21C, ParameterType.FLOAT, pMin(0.0f)), + P("LOD Bias 2", 0x220, ParameterType.FLOAT, pMin(0.0f)), + P("LOD Caster Bias", 0x1E4, ParameterType.FLOAT, pMin(0.0f)), // If platform is PS4/Xbox/PC it appears [2] is PC. - newParameter("LOD Length Platform Bias[2]", 0x22C + (4 * 2), ParameterType.FLOAT, pMin(0.0f)), - newParameter("LOD Pixel Size Platform Bias[2]", 0x244 + (4 * 2), ParameterType.FLOAT, pMin(0.0f)), - newParameter("LOD Limit", 0xE898, ParameterType.INT, pStep(1)), - newParameter("LOD Passthrough Culling Rate", 0x1F0, ParameterType.FLOAT, pMin(0.0f)), - newParameter("LOD Far Culling Fade Length Max", 0x20C, ParameterType.FLOAT, pMin(0.0f)), - newParameter("LOD Far Culling Fade Pixel Max", 0x210, ParameterType.FLOAT, pMin(0.0f)), - newParameter("Speed Tree LOD Billboard Fade Range", 0x214, ParameterType.FLOAT, pMin(0.0f)), - newParameter("LOD Culling Length Bias", 0x224, ParameterType.FLOAT, pMin(0.0f)), - newParameter("LOD Culling Pixel Bias", 0x228, ParameterType.FLOAT, pMin(0.0f)) + P("LOD Length Platform Bias[2]", 0x22C + (4 * 2), ParameterType.FLOAT, pMin(0.0f)), + P("LOD Pixel Size Platform Bias[2]", 0x244 + (4 * 2), ParameterType.FLOAT, pMin(0.0f)), + P("LOD Limit", 0xE898, ParameterType.INT, pStep(1)), + P("LOD Passthrough Culling Rate", 0x1F0, ParameterType.FLOAT, pMin(0.0f)), + P("LOD Far Culling Fade Length Max", 0x20C, ParameterType.FLOAT, pMin(0.0f)), + P("LOD Far Culling Fade Pixel Max", 0x210, ParameterType.FLOAT, pMin(0.0f)), + P("Speed Tree LOD Billboard Fade Range", 0x214, ParameterType.FLOAT, pMin(0.0f)), + P("LOD Culling Length Bias", 0x224, ParameterType.FLOAT, pMin(0.0f)), + P("LOD Culling Pixel Bias", 0x228, ParameterType.FLOAT, pMin(0.0f)) }; private static Parameter[] snowParameters = { - newParameter("Snow Field 4 Global LOD Param", 0x5718, ParameterType.FLOAT) + P("Snow Field 4 Global LOD Param", 0x5718, ParameterType.FLOAT) }; private static Parameter[] passthroughParameters = { - newParameter("Passthrough Active", 0xE9A0, ParameterType.BOOL), - newParameter("Passthrough Culling Active", 0xE9A2, ParameterType.BOOL), - newParameterView("Passthrough Near", 0xE940, ParameterType.FLOAT), - newParameterView("Passthrough Far", 0xE944, ParameterType.FLOAT), - newParameter("Passthrough Near Alpha", 0xE948, ParameterType.FLOAT), - newParameter("Passthrough Far Alpha", 0xE94C, ParameterType.FLOAT), - newParameter("Passthrough Correct", 0xE950, ParameterType.FLOAT) + P("Passthrough Active", 0xE9A0, ParameterType.BOOL), + P("Passthrough Culling Active", 0xE9A2, ParameterType.BOOL), + V("Passthrough Near", 0xE940, ParameterType.FLOAT), + V("Passthrough Far", 0xE944, ParameterType.FLOAT), + P("Passthrough Near Alpha", 0xE948, ParameterType.FLOAT), + P("Passthrough Far Alpha", 0xE94C, ParameterType.FLOAT), + P("Passthrough Correct", 0xE950, ParameterType.FLOAT) }; private static Parameter[] shadowCascadeParameters = { - newParameter("Primary Shadow HQ", 0xE5C0, ParameterType.BOOL), - newParameter("Primary Shadow HQ (HQ)", 0xE5C2, ParameterType.BOOL), - newParameter("Shadow Cascade 2Way Bias (HQ)", 0x58, ParameterType.FLOAT), - newParameter("Primary Shadow Sample Num (HQ)", 0xE5CC, ParameterType.INT, pStep(1)) + P("Primary Shadow HQ", 0xE5C0, ParameterType.BOOL), + P("Primary Shadow HQ (HQ)", 0xE5C2, ParameterType.BOOL), + P("Shadow Cascade 2Way Bias (HQ)", 0x58, ParameterType.FLOAT), + P("Primary Shadow Sample Num (HQ)", 0xE5CC, ParameterType.INT, pStep(1)) }; private delegate void EvalSceneParams(nint unknownPtr, nint unknownPtr2, int unknownInt, nint unknownPtr3); private Hook? evalSceneParams; private static Parameter[] broadAreaShadowParameters = { - newParameter("Broad Area Shadow Enable", 0x5534, ParameterType.BOOL), - newParameter("Broad Area Shadow Center", 0x5540 + 0x40, ParameterType.VECTOR3), - newParameter("Broad Area Shadow Range", 0x5560 + 0x40, ParameterType.VECTOR3), - newParameter("Broad Area Shadow Direction", 0x5550 + 0x40, ParameterType.VECTOR3, pStep(0.00025f)), - newParameter("Broad Area Shadow Max LOD Level", 0x5524, ParameterType.FLOAT, pMin(0.0f)), - newParameter("Broad Area Shadow Culling Size", 0x5528, ParameterType.FLOAT, pMin(0.0f)), - newParameter("Broad Area Shadow Precision", 0x5518, ParameterType.INT, pMinMaxStep(0, 2, 1)) + P("Broad Area Shadow Enable", 0x5534, ParameterType.BOOL), + P("Broad Area Shadow Center", 0x5540 + 0x40, ParameterType.VECTOR3), + P("Broad Area Shadow Range", 0x5560 + 0x40, ParameterType.VECTOR3), + P("Broad Area Shadow Direction", 0x5550 + 0x40, ParameterType.VECTOR3, pStep(0.00025f)), + P("Broad Area Shadow Max LOD Level", 0x5524, ParameterType.FLOAT, pMin(0.0f)), + P("Broad Area Shadow Culling Size", 0x5528, ParameterType.FLOAT, pMin(0.0f)), + P("Broad Area Shadow Precision", 0x5518, ParameterType.INT, pMinMaxStep(0, 2, 1)) }; private static Parameter[] contactShadowParameters = { - newParameter("Fake Light Intensity", 0xEC40, ParameterType.FLOAT), + P("Fake Light Intensity", 0xEC40, ParameterType.FLOAT), // MonsterHunterWorld.exe+1B18711 - mov [rbx+0000EC44],3F800000 (Other unknown reference). - newParameter("Fake Light Intensity (Gameplay)", lton(0x141B1A19F) + 0x6, ParameterType.PATCH_FLOAT), - newParameter("Fake Light Blend", lton(0x141CDE0CE) + 0x6, ParameterType.PATCH_FLOAT), - newParameter("Force Disable Contact Shadows", 0xB4ED, ParameterType.BOOL), - newParameter("Facial Contact Shadows Enabled", 0xB4EE, ParameterType.BOOL), - newParameter("Facial Contact Shadows Enable Noise", 0xB501, ParameterType.BOOL), - newParameter("Contact Shadow Accept Maximum Length", 0xB4F8, ParameterType.FLOAT), - newParameter("Contact Shadow Accept Minimum Length", 0xB4FC, ParameterType.FLOAT) + P("Fake Light Intensity (Gameplay)", lton(0x141B1A19F) + 0x6, ParameterType.PATCH_FLOAT), + P("Fake Light Blend", lton(0x141CDE0CE) + 0x6, ParameterType.PATCH_FLOAT), + P("Force Disable Contact Shadows", 0xB4ED, ParameterType.BOOL), + P("Facial Contact Shadows Enabled", 0xB4EE, ParameterType.BOOL), + P("Facial Contact Shadows Enable Noise", 0xB501, ParameterType.BOOL), + P("Contact Shadow Accept Maximum Length", 0xB4F8, ParameterType.FLOAT), + P("Contact Shadow Accept Minimum Length", 0xB4FC, ParameterType.FLOAT) }; private delegate void UpdateCapsuleAOParams(nint sceneObjectInternal); private Hook? updateCapsuleAoParams; private static Parameter[] capsuleLightParameters = { - newParameter("Force Disable Capsule AO", 0xB503, ParameterType.BOOL), - newParameter("Capsule AO Enabled", 0xB502, ParameterType.BOOL), - newParameter("Capsule AO Distance Fall Coef", 0xE5B4, ParameterType.FLOAT, pStep(0.0001f)), - newParameter("Capsule AO Light Channel Mask", 0xE5BC, ParameterType.INT, pStep(1)), - newParameter("Capsule Light Dir XZY", 0xE548, ParameterType.VECTOR3), - newParameterView("Capsule Light W Dir", 0xE560, ParameterType.VECTOR3), - newParameter("Capsule Light Angle", 0xE5B0, ParameterType.FLOAT), - newParameter("Capsule AO Intensity", 0xE5B8, ParameterType.FLOAT, pStep(0.00025f)) + P("Force Disable Capsule AO", 0xB503, ParameterType.BOOL), + P("Capsule AO Enabled", 0xB502, ParameterType.BOOL), + P("Capsule AO Distance Fall Coef", 0xE5B4, ParameterType.FLOAT, pStep(0.0001f)), + P("Capsule AO Light Channel Mask", 0xE5BC, ParameterType.INT, pStep(1)), + P("Capsule Light Direction XZY", 0xE548, ParameterType.VECTOR3), + V("Capsule Light W Direction", 0xE560, ParameterType.VECTOR3), + P("Capsule Light Angle", 0xE5B0, ParameterType.FLOAT), + P("Capsule AO Intensity", 0xE5B8, ParameterType.FLOAT, pStep(0.00025f)) }; private delegate void UpdateSSAOParams(nint stackOffset); private Hook? updateSSAOParams; private static Parameter[] ssaoParameters = { - newParameter("SSAO Depth Bias", 0xB4B0, ParameterType.FLOAT, pStep(0.00001f)), - newParameter("SSAO Sloped Depth Bias", 0xB4B4, ParameterType.FLOAT, pStep(0.00001f)), - newParameter("SSAO Max Depth Bias", 0xB4B8, ParameterType.FLOAT, pStep(0.00001f)), - newParameter("SSAO Dispersion", 0xB4BC, ParameterType.FLOAT), - newParameter("SSAO Effect", 0xB430, ParameterType.FLOAT, pStep(0.001f)), - newParameter("SSAO Effect GI", 0xB434, ParameterType.FLOAT, pStep(0.001f)), - newParameter("SSAO Depth Difference", 0xB4C0, ParameterType.FLOAT, pStep(0.01f)), - newParameter("SSAO Samples Per Pixel", 0xB4C4, ParameterType.FLOAT, pStep(1.0f)), - newParameter("SSAO Max Sample Num", 0xB4C8, ParameterType.INT, pStep(1)), - newParameter("SSAO Max Sample Num (HQ)", 0xB4D0, ParameterType.INT, pStep(1)), - newParameter("SSAO Radius", 0xB4D4, ParameterType.FLOAT), - newParameter("SSAO Bias", 0xB4D8, ParameterType.FLOAT, pStep(0.0001f)), - newParameter("SSAO Intensity", 0xB4E0, ParameterType.FLOAT, pMin(0.0f)), - newParameter("SSAO Use HiZ", 0xB4E5, ParameterType.BOOL), - newParameter("SSAO Edge Atten Rate", 0xB4DC, ParameterType.FLOAT, pStep(0.001f)) + P("SSAO Depth Bias", 0xB4B0, ParameterType.FLOAT, pStep(0.00001f)), + P("SSAO Sloped Depth Bias", 0xB4B4, ParameterType.FLOAT, pStep(0.00001f)), + P("SSAO Max Depth Bias", 0xB4B8, ParameterType.FLOAT, pStep(0.00001f)), + P("SSAO Dispersion", 0xB4BC, ParameterType.FLOAT), + P("SSAO Effect", 0xB430, ParameterType.FLOAT, pStep(0.001f)), + P("SSAO Effect GI", 0xB434, ParameterType.FLOAT, pStep(0.001f)), + P("SSAO Depth Difference", 0xB4C0, ParameterType.FLOAT, pStep(0.01f)), + P("SSAO Samples Per Pixel", 0xB4C4, ParameterType.FLOAT, pStep(1.0f)), + P("SSAO Max Sample Num", 0xB4C8, ParameterType.INT, pStep(1)), + P("SSAO Max Sample Num (HQ)", 0xB4D0, ParameterType.INT, pStep(1)), + P("SSAO Radius", 0xB4D4, ParameterType.FLOAT), + P("SSAO Bias", 0xB4D8, ParameterType.FLOAT, pStep(0.0001f)), + P("SSAO Intensity", 0xB4E0, ParameterType.FLOAT, pMin(0.0f)), + P("SSAO Use HiZ", 0xB4E5, ParameterType.BOOL), + P("SSAO Edge Atten Rate", 0xB4DC, ParameterType.FLOAT, pStep(0.001f)) }; private delegate void UpdateSSLRParams(nint stackOffset); private Hook? updateSSLRParams; private static Parameter[] sslrParameters = { - newParameter("SSLR Loop Count", 0xE628, ParameterType.INT, pStep(1)), - newParameter("SSLR Loop Count Factor for CBR", 0xE62C, ParameterType.FLOAT), - newParameter("SSLR Eliminate Depth", 0xE630, ParameterType.FLOAT), - newParameter("SSLR Accurate Threshold", 0xE644, ParameterType.FLOAT, pStep(0.001f)), - newParameter("SSLR Accurate Threshold (HQ)", 0xE64C, ParameterType.FLOAT, pStep(0.001f)), - newParameter("SSLR Dither Radius", 0xE634, ParameterType.FLOAT), - newParameter("SSLR Importance Bias", 0xE638, ParameterType.FLOAT), - newParameter("SSLR Mip Scale", 0xE63C, ParameterType.FLOAT), - newParameter("SSLR Mip Bias", 0xE640, ParameterType.FLOAT), - newParameter("SSLR Dither Resolve", 0xB43F, ParameterType.BOOL), - newParameter("SSLR Edge Atten Rate", 0xB428, ParameterType.FLOAT), - newParameter("SSLR Mip 0 Count Threshold", 0xB438, ParameterType.INT, pStep(1)), - newParameter("SSLR Depth Eliminate Rate", 0xB42C, ParameterType.FLOAT), - newParameter("SSLR Use Mipmap", 0xE650, ParameterType.BOOL), - newParameter("SSLR GBuffer Jitter", 0xB440, ParameterType.BOOL), - newParameter("SSLR Intensity", 0xB424, ParameterType.FLOAT) + P("SSLR Loop Count", 0xE628, ParameterType.INT, pStep(1)), + P("SSLR Loop Count Factor for CBR", 0xE62C, ParameterType.FLOAT), + P("SSLR Eliminate Depth", 0xE630, ParameterType.FLOAT), + P("SSLR Accurate Threshold", 0xE644, ParameterType.FLOAT, pStep(0.001f)), + P("SSLR Accurate Threshold (HQ)", 0xE64C, ParameterType.FLOAT, pStep(0.001f)), + P("SSLR Dither Radius", 0xE634, ParameterType.FLOAT), + P("SSLR Importance Bias", 0xE638, ParameterType.FLOAT), + P("SSLR Mip Scale", 0xE63C, ParameterType.FLOAT), + P("SSLR Mip Bias", 0xE640, ParameterType.FLOAT), + P("SSLR Dither Resolve", 0xB43F, ParameterType.BOOL), + P("SSLR Edge Atten Rate", 0xB428, ParameterType.FLOAT), + P("SSLR Mip 0 Count Threshold", 0xB438, ParameterType.INT, pStep(1)), + P("SSLR Depth Eliminate Rate", 0xB42C, ParameterType.FLOAT), + P("SSLR Use Mipmap", 0xE650, ParameterType.BOOL), + P("SSLR GBuffer Jitter", 0xB440, ParameterType.BOOL), + P("SSLR Intensity", 0xB424, ParameterType.FLOAT) }; - private static Parameter shadowResParameter = newParameter("Shadow Resolution Multiplier", 0, ParameterType.SHADOW_RESOLUTION, pStep(1)); + private static Parameter shadowResParameter = P("Shadow Resolution Multiplier", 0, ParameterType.SHADOW_RESOLUTION, pStep(1)); private delegate void UpdateShadowParams(nint shadowParams, nint stackOffset); private delegate void StaticShadowParams(nint shadowParamsStatic, nint shadowObjectInternal); private Hook? updateShadowParams; @@ -1676,52 +1690,73 @@ namespace WorldTuningTool private static Parameter[] shadowParameters1 = { }; // This is actually an InfiniteLight object. - // Non-PerFrame parameters will be written directly to the light object. + // "Min Roughness" is +0xFC in params but is never read. private static Parameter[] shadowParameters2 = { - newFrameParameter("Sunlight Group", 0x14, ParameterType.INT, pMinMaxStep(1, 255, 1)), - newFrameParameter("Sunlight Direction", 0x110, ParameterType.VECTOR3, pStep(0.00025f)), - newFrameParameter("Sunlight Color", 0xE0, ParameterType.COLOR_FACTOR, pMaxStep(1.0f, 0.001f)), - newFrameParameter("Sunlight Intensity", 0xF4, ParameterType.FLOAT), - newParameter("Sunlight Min Roughness", 0x58C, ParameterType.FLOAT, pStep(0.0025f)), // +0xFC in params but is never read. - newFrameParameter("Sunlight Is Primary", 0x1D, ParameterType.BOOL), - newFrameParameter("Do Volumetric", 0x1F, ParameterType.BOOL), - newFrameParameter("Shadow Cast", 0x23, ParameterType.BOOL), - newFrameParameter("Shadow Map Size", 0x30, ParameterType.ALIGNED_INT, pMinStep(0, 128)), // 0 = 64x64 no multiplier @TODO: Verify in the code. - newFrameParameter("Shadow Near Clip Distance", 0x28, ParameterType.FLOAT), - newFrameParameter("Shadow Cascade Mode", 0x174, ParameterType.INT, pMinMaxStep(0, 3, 1)), - newFrameParameter("Shadow Cascade 2Way Bias", 0x17C, ParameterType.FLOAT), - newFrameParameter("Shadow Distance", 0x6C, ParameterType.FLOAT, pStep(5.0f)), - newFrameParameter("Shadow Backforward Distance", 0x7C, ParameterType.FLOAT, pStep(5.0f)), - newFrameParameter("Shadow Is Fixed Fov Mode", 0x1F9, ParameterType.BOOL), - newFrameParameter("Shadow Fov", 0x1F4, ParameterType.FLOAT, pStep(0.0001f)), - newFrameParameter("Shadow Is Discretization Fov Mode", 0x205, ParameterType.BOOL), - newFrameParameter("Shadow Discretization Angle", 0x200, ParameterType.FLOAT, pStep(0.0001f)), - newFrameParameter("Shadow Distribution", 0x74, ParameterType.FLOAT, pStep(0.001f)), - newFrameParameter("Cascade Manual Split", 0x4D, ParameterType.BOOL), - newFrameParameter("Cascade Manual Split Distance[0]", 0x54, ParameterType.FLOAT), - newFrameParameter("Cascade Manual Split Distance[1]", 0x5C, ParameterType.FLOAT), - newFrameParameter("Cascade Manual Split Distance[2]", 0x64, ParameterType.FLOAT), - newFrameParameter("Shadow Sloped Depth Bias", 0x40, ParameterType.FLOAT, pStep(0.00001f)), - newFrameParameter("Shadow Depth Bias", 0x38, ParameterType.FLOAT, pStep(0.00001f)), - newFrameParameter("Shadow Max Depth Bias", 0x48, ParameterType.FLOAT, pStep(0.00001f)), - newFrameParameter("Cascade Individual Shadow Bias", 0x81, ParameterType.BOOL), - newFrameParameter("Cascade Depth Bias[0]", 0x88, ParameterType.FLOAT, pStep(0.00001f)), - newFrameParameter("Cascade Sloped Depth Bias[0]", 0xA0, ParameterType.FLOAT, pStep(0.00001f)), - newFrameParameter("Cascade Max Depth Bias[0]", 0xB8, ParameterType.FLOAT, pStep(0.00001f)), - newFrameParameter("Cascade Depth Bias[1]", 0x90, ParameterType.FLOAT, pStep(0.00001f)), - newFrameParameter("Cascade Sloped Depth Bias[1]", 0xA8, ParameterType.FLOAT, pStep(0.00001f)), - newFrameParameter("Cascade Max Depth Bias[1]", 0xC0, ParameterType.FLOAT, pStep(0.00001f)), - newFrameParameter("Cascade Depth Bias[2]", 0x98, ParameterType.FLOAT, pStep(0.00001f)), - newFrameParameter("Cascade Sloped Depth Bias[2]", 0xB0, ParameterType.FLOAT, pStep(0.00001f)), - newFrameParameter("Cascade Max Depth Bias[2]", 0xC8, ParameterType.FLOAT, pStep(0.00001f)), - newFrameParameter("Broad Area Shadow Depth Bias", 0x1C4, ParameterType.FLOAT, pStep(0.00001f)), - newFrameParameter("Broad Area Shadow Sloped Depth Bias", 0x1CC, ParameterType.FLOAT, pStep(0.00001f)), - newFrameParameter("Broad Area Shadow Max Depth Bias", 0x1D4, ParameterType.FLOAT, pStep(0.00001f)), - newFrameParameter("Projection Scale", 0x134, ParameterType.VECTOR3), - newFrameParameter("Projection Offset Speed", 0x144, ParameterType.FLOAT), - newFrameParameter("Projection Up", 0x160, ParameterType.VECTOR3), - newFrameParameter("Primary Shadow Sample Num", 0x1DC, ParameterType.INT, pStep(1)), - newFrameParameter("Primary Shadow Radius", 0x1EC, ParameterType.FLOAT, pStep(0.0001f)) + P("Sunlight Group", 0x14, ParameterType.INT, pMinMaxStep(1, 255, 1)), + P("Sunlight Direction", 0x110, ParameterType.VECTOR3, pStep(0.00025f)), + P("Sunlight Color", 0xE0, ParameterType.COLOR_FACTOR, pMaxStep(1.0f, 0.001f)), + P("Sunlight Intensity", 0xF4, ParameterType.FLOAT, pStep(0.001f)), + P("Sunlight Is Primary", 0x1D, ParameterType.BOOL), + P("Do Volumetric", 0x1F, ParameterType.BOOL), + P("Shadow Cast", 0x23, ParameterType.BOOL), + P("Shadow Map Size", 0x30, ParameterType.ALIGNED_INT, pMinStep(0, 128)), // 0 = 64x64 no multiplier @TODO: Verify in the code. + P("Shadow Near Clip Distance", 0x28, ParameterType.FLOAT), + P("Shadow Cascade Mode", 0x174, ParameterType.INT, pMinMaxStep(0, 3, 1)), + P("Shadow Cascade 2Way Bias", 0x17C, ParameterType.FLOAT), + P("Shadow Distance", 0x6C, ParameterType.FLOAT, pStep(5.0f)), + P("Shadow Backforward Distance", 0x7C, ParameterType.FLOAT, pStep(5.0f)), + P("Shadow Is Fixed Fov Mode", 0x1F9, ParameterType.BOOL), + P("Shadow Fov", 0x1F4, ParameterType.FLOAT, pStep(0.0001f)), + P("Shadow Is Discretization Fov Mode", 0x205, ParameterType.BOOL), + P("Shadow Discretization Angle", 0x200, ParameterType.FLOAT, pStep(0.0001f)), + P("Shadow Distribution", 0x74, ParameterType.FLOAT, pStep(0.001f)), + P("Cascade Manual Split", 0x4D, ParameterType.BOOL), + P("Cascade Manual Split Distance[0]", 0x54, ParameterType.FLOAT), + P("Cascade Manual Split Distance[1]", 0x5C, ParameterType.FLOAT), + P("Cascade Manual Split Distance[2]", 0x64, ParameterType.FLOAT), + P("Shadow Sloped Depth Bias", 0x40, ParameterType.FLOAT, pStep(0.00001f)), + P("Shadow Depth Bias", 0x38, ParameterType.FLOAT, pStep(0.00001f)), + P("Shadow Max Depth Bias", 0x48, ParameterType.FLOAT, pStep(0.00001f)), + P("Cascade Individual Shadow Bias", 0x81, ParameterType.BOOL), + P("Cascade Depth Bias[0]", 0x88, ParameterType.FLOAT, pStep(0.00001f)), + P("Cascade Sloped Depth Bias[0]", 0xA0, ParameterType.FLOAT, pStep(0.00001f)), + P("Cascade Max Depth Bias[0]", 0xB8, ParameterType.FLOAT, pStep(0.00001f)), + P("Cascade Depth Bias[1]", 0x90, ParameterType.FLOAT, pStep(0.00001f)), + P("Cascade Sloped Depth Bias[1]", 0xA8, ParameterType.FLOAT, pStep(0.00001f)), + P("Cascade Max Depth Bias[1]", 0xC0, ParameterType.FLOAT, pStep(0.00001f)), + P("Cascade Depth Bias[2]", 0x98, ParameterType.FLOAT, pStep(0.00001f)), + P("Cascade Sloped Depth Bias[2]", 0xB0, ParameterType.FLOAT, pStep(0.00001f)), + P("Cascade Max Depth Bias[2]", 0xC8, ParameterType.FLOAT, pStep(0.00001f)), + P("Broad Area Shadow Depth Bias", 0x1C4, ParameterType.FLOAT, pStep(0.00001f)), + P("Broad Area Shadow Sloped Depth Bias", 0x1CC, ParameterType.FLOAT, pStep(0.00001f)), + P("Broad Area Shadow Max Depth Bias", 0x1D4, ParameterType.FLOAT, pStep(0.00001f)), + P("Projection Scale", 0x134, ParameterType.VECTOR2), + P("Projection Offset Speed", 0x144, ParameterType.VECTOR2), + P("Projection Up", 0x160, ParameterType.VECTOR3), + P("Primary Shadow Sample Num", 0x1DC, ParameterType.INT, pStep(1)), + P("Primary Shadow Radius", 0x1EC, ParameterType.FLOAT, pStep(0.0001f)) + }; + + private static MtObject? sLightProbes = null; + private delegate void UpdateLightProbesParams(nint unknownPtr, int unknownInt); + private Hook? updateLightProbesParams; + private static Parameter[] sLightProbesParameters = { + P("Light Probes Probe Color", 0x38, ParameterType.COLOR), + P("Light Probes Probe Intensity", 0x3C, ParameterType.FLOAT), + P("Light Probes Top Color", 0x44, ParameterType.COLOR), + P("Light Probes Top Intensity", 0x48, ParameterType.FLOAT), + P("Light Probes Bottom Color", 0x4C, ParameterType.COLOR), + P("Light Probes Bottom Intensity", 0x50, ParameterType.FLOAT), + P("Light Probes Direction", 0x60, ParameterType.VECTOR3), + P("Light Probes Shadow Top Color", 0x70, ParameterType.COLOR), + P("Light Probes Shadow Top Intensity", 0x74, ParameterType.FLOAT), + P("Light Probes Shadow Bottom Color", 0x78, ParameterType.COLOR), + P("Light Probes Shadow Bottom Intensity", 0x7C, ParameterType.FLOAT), + P("Light Probes Shadow Direction", 0x80, ParameterType.VECTOR3), + P("Light Probes Daytime State", 0x9C, ParameterType.INT, pMinMaxStep(0, 6, 1)), + P("Light Probes Daytime Interpolation", 0xA0, ParameterType.FLOAT), + P("Light Probes Max Iter", 0xA4, ParameterType.INT), + P("Light Probes Debug Mode", 0x98, ParameterType.INT, pStep(1)) }; private delegate nint CreateLightingObject(); @@ -1729,42 +1764,38 @@ namespace WorldTuningTool private Hook? createLightingObject; private Hook? destroyLightingObject; private nint lightingObject = 0x0; - private delegate void UpdateLightingParameters(nint stackOffset, nint lightingObjectInternal); - private Hook? updateLightingParams; - private Hook? updateLutBlend; + private delegate void UpdateLightingParams(nint stackOffset, nint lightingObjectInternal); + private Hook? updateLightingParams; + private Hook? updateLutBlend; private static LUT luts = new LUT(); private static Parameter[] lightingParameters = { - newParameter("Light Tone Map Type", 0x16C, ParameterType.INT, pMinMaxStep(1, 6, 1)), - newParameter("Light Compute Luminance", 0x170, ParameterType.BOOL), - newParameter("Light Luminance Version", 0x168, ParameterType.BOOL), - newParameter("Light Shoulder Strength", 0x174, ParameterType.FLOAT, pStep(0.001f)), - newParameter("Light Linear Strength", 0x178, ParameterType.FLOAT, pStep(0.001f)), - newParameter("Light Linear Angle", 0x17C, ParameterType.FLOAT, pStep(0.001f)), - newParameter("Light Toe Strength", 0x180, ParameterType.FLOAT, pStep(0.001f)), - newParameter("Light Toe Num", 0x184, ParameterType.FLOAT, pStep(0.001f)), - newParameter("Light Toe Denum", 0x188, ParameterType.FLOAT, pStep(0.001f)), - newParameter("Light White Point", 0x18C, ParameterType.FLOAT, pStep(0.01f)), - newFrameParameter("Light LUT Blend", 0x1C8, ParameterType.FLOAT, pMinMaxStep(0.0f, 1.0f, 0.01f)), - newParameter("Light Vfx LUT Blend", 0x1D0, ParameterType.FLOAT, pMinMaxStep(0.0f, 1.0f, 0.01f)), - newParameter("Light Enable Color Grading", 0x1D8, ParameterType.BOOL), - newParameter("Light Is Linear To PQ", 0x1A1, ParameterType.BOOL), - newParameter("Light Is PQ To Linear", 0x1A0, ParameterType.BOOL), - newParameter("Volume Dispersion", 0x19C, ParameterType.FLOAT), - newParameter("Volume Edge Sharpness", 0x198, ParameterType.FLOAT, pStep(0.00001f)), - newParameter("Volume Downsample", 0x210, ParameterType.BOOL) + P("Light Tone Map Type", 0x16C, ParameterType.INT, pMinMaxStep(1, 6, 1)), + P("Light Compute Luminance", 0x170, ParameterType.BOOL), + P("Light Luminance Version", 0x168, ParameterType.BOOL), + P("Light Shoulder Strength", 0x174, ParameterType.FLOAT, pStep(0.001f)), + P("Light Linear Strength", 0x178, ParameterType.FLOAT, pStep(0.001f)), + P("Light Linear Angle", 0x17C, ParameterType.FLOAT, pStep(0.001f)), + P("Light Toe Strength", 0x180, ParameterType.FLOAT, pStep(0.001f)), + P("Light Toe Num", 0x184, ParameterType.FLOAT, pStep(0.001f)), + P("Light Toe Denum", 0x188, ParameterType.FLOAT, pStep(0.001f)), + P("Light White Point", 0x18C, ParameterType.FLOAT, pStep(0.01f)), + P("Light LUT Blend", 0x1C8, ParameterType.FLOAT, pMinMaxStep(0.0f, 1.0f, 0.01f)), + P("Light Vfx LUT Blend", 0x1D0, ParameterType.FLOAT, pMinMaxStep(0.0f, 1.0f, 0.01f)), + P("Light Enable Color Grading", 0x1D8, ParameterType.BOOL), + P("Light Is Linear To PQ", 0x1A1, ParameterType.BOOL), + P("Light Is PQ To Linear", 0x1A0, ParameterType.BOOL), + P("Volume Dispersion", 0x19C, ParameterType.FLOAT), + P("Volume Edge Sharpness", 0x198, ParameterType.FLOAT, pStep(0.00001f)), + P("Volume Downsample", 0x210, ParameterType.BOOL) }; private static Parameter[] brightnessParameters = { - newParameter("Gamma Correct", 0x1C8, ParameterType.FLOAT, pStep(0.001f)), - newParameter("Gamma Correct EX", 0x1CC, ParameterType.FLOAT, pStep(0.001f)), - newParameterView("Hdr Output", 0x21A, ParameterType.BOOL), - newParameter("Hdr Output White Level", 0x21C, ParameterType.FLOAT, pStep(0.05f)), - newParameter("Hdr Output Gamut Mapping Ratio", 0x220, ParameterType.FLOAT, pStep(0.001f)), - newParameter("Hdr Output Gamma", 0x224, ParameterType.FLOAT, pStep(0.001f)), - newParameter("Hdr Is Gui Hdr Gamma", 0x228, ParameterType.BOOL) - }; - private static MtObject? sLightProbes = null; - private static Parameter[] sLightProbesParameters = { - newParameter("Debug Mode", 0x98, ParameterType.INT, pStep(1)) + P("Gamma Correct", 0x1C8, ParameterType.FLOAT, pStep(0.001f)), + P("Gamma Correct EX", 0x1CC, ParameterType.FLOAT, pStep(0.001f)), + V("Hdr Output", 0x21A, ParameterType.BOOL), + P("Hdr Output White Level", 0x21C, ParameterType.FLOAT, pStep(0.05f)), + P("Hdr Output Gamut Mapping Ratio", 0x220, ParameterType.FLOAT, pStep(0.001f)), + P("Hdr Output Gamma", 0x224, ParameterType.FLOAT, pStep(0.001f)), + P("Hdr Is Gui Hdr Gamma", 0x228, ParameterType.BOOL) }; private delegate nint CreateBloomObject(); @@ -1779,13 +1810,13 @@ namespace WorldTuningTool // 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 - newParameter("Bloom Threshold", 0x204, ParameterType.FLOAT), - newParameter("Bloom Renormalize", 0x208, ParameterType.FLOAT, pMin(0.0f)), - newParameter("Bloom Color", 0x200, ParameterType.COLOR), - newParameter("Bloom Downsample Count", 0x168, ParameterType.INT, pMinMaxStep(0, 8, 1)), - newParameter("Bloom Reduction Resolution", 0x16C, ParameterType.INT, pStep(1)), - newParameter("Bloom Is SRGB Gamut", 0x214, ParameterType.BOOL), - newParameter("Bloom Compute Luminance", 0x241, ParameterType.BOOL) + P("Bloom Threshold", 0x204, ParameterType.FLOAT), + P("Bloom Renormalize", 0x208, ParameterType.FLOAT, pMin(0.0f)), + P("Bloom Color", 0x200, ParameterType.COLOR), + P("Bloom Downsample Count", 0x168, ParameterType.INT, pMinMaxStep(0, 8, 1)), + P("Bloom Reduction Resolution", 0x16C, ParameterType.INT, pStep(1)), + P("Bloom Is SRGB Gamut", 0x214, ParameterType.BOOL), + P("Bloom Compute Luminance", 0x241, ParameterType.BOOL) }; private delegate nint CreateDofObject(); @@ -1798,25 +1829,25 @@ namespace WorldTuningTool private Hook? updateDofParams; private nint dofObject = 0x0; private static Parameter[] dofParameters = { - newParameter("Dof Enabled", 0x1DD, ParameterType.BOOL), - newParameter("Dof New Version", 0x1DC, ParameterType.BOOL), - newFrameParameter("Dof F Number", 0x1A0, ParameterType.FLOAT, pMinStep(0.0f, 0.001f)), - newFrameParameter("Dof Sensor Size", 0x1A4, ParameterType.FLOAT, pStep(0.001f)), - newFrameParameter("Dof Focus Distance", 0x1A8, ParameterType.FLOAT, pStep(0.2f)), - newParameter("Dof Near Coef", 0x1CC, ParameterType.FLOAT, pStep(0.001f)), - newParameter("Dof Far Coef", 0x1C8, ParameterType.FLOAT, pStep(0.001f)), - newParameter("Dof Near Enable", 0x1DE, ParameterType.BOOL), - newParameter("Dof Far Enable", 0x1DF, ParameterType.BOOL), - newParameter("Dof Debug Draw", 0x1E0, ParameterType.BOOL), - newParameter("Dof Radius", 0x1D0, ParameterType.FLOAT, pStep(0.001f)), - newParameter("Dof Depth Scale Foreground", 0x1D4, ParameterType.FLOAT, pMinStep(0.0f, 0.0001f)), - newParameter("Dof Aspect", 0x1D8, ParameterType.FLOAT, pMinStep(0.0f, 0.001f)), - newFrameParameter("Vignetting Enabled", 0x200, ParameterType.BOOL), - newFrameParameter("Vignetting Ellipse", 0x201, ParameterType.BOOL), - newFrameParameter("Vignetting Ellipticity", 0x204, ParameterType.FLOAT, pStep(0.01f)), - newFrameParameter("Vignetting Offset", 0x1F8, ParameterType.FLOAT, pStep(0.001f)), - newFrameParameter("Vignetting Pow", 0x1FC, ParameterType.FLOAT, pStep(0.01f)), - newFrameParameter("Vignetting Color", 0x208, ParameterType.COLOR) + P("Dof Enabled", 0x1DD, ParameterType.BOOL), + P("Dof New Version", 0x1DC, ParameterType.BOOL), + P("Dof F Number", 0x1A0, ParameterType.FLOAT, pMinStep(0.0f, 0.001f)), + P("Dof Sensor Size", 0x1A4, ParameterType.FLOAT, pStep(0.001f)), + P("Dof Focus Distance", 0x1A8, ParameterType.FLOAT, pStep(0.2f)), + P("Dof Near Coef", 0x1CC, ParameterType.FLOAT, pStep(0.001f)), + P("Dof Far Coef", 0x1C8, ParameterType.FLOAT, pStep(0.001f)), + P("Dof Near Enable", 0x1DE, ParameterType.BOOL), + P("Dof Far Enable", 0x1DF, ParameterType.BOOL), + P("Dof Debug Draw", 0x1E0, ParameterType.BOOL), + P("Dof Radius", 0x1D0, ParameterType.FLOAT, pStep(0.001f)), + P("Dof Depth Scale Foreground", 0x1D4, ParameterType.FLOAT, pMinStep(0.0f, 0.0001f)), + P("Dof Aspect", 0x1D8, ParameterType.FLOAT, pMinStep(0.0f, 0.001f)), + P("Vignetting Enabled", 0x200, ParameterType.BOOL), + P("Vignetting Ellipse", 0x201, ParameterType.BOOL), + P("Vignetting Ellipticity", 0x204, ParameterType.FLOAT, pStep(0.01f)), + P("Vignetting Offset", 0x1F8, ParameterType.FLOAT, pStep(0.001f)), + P("Vignetting Pow", 0x1FC, ParameterType.FLOAT, pStep(0.01f)), + P("Vignetting Color", 0x208, ParameterType.COLOR) }; private delegate nint CreateMotionBlurObject(); @@ -1829,11 +1860,11 @@ namespace WorldTuningTool private Hook? updateMotionBlurParams; private nint motionBlurObject = 0x0; private static Parameter[] motionBlurParameters = { - newParameter("Motion Blur Type", 0x168, ParameterType.INT, pStep(1)), - newParameter("Motion Blur Sample Num", 0x180, ParameterType.INT, pMinStep(0, 1)), - newFrameParameter("Motion Blur Shutter Speed", 0x184, ParameterType.FLOAT, pMinStep(0.0f, 0.001f)), - newParameter("Motion Blur Fur Shutter Speed", 0x188, ParameterType.FLOAT, pStep(0.001f)), - newParameter("Motion Blur Threshold", 0x18C, ParameterType.FLOAT, pMinStep(0.0f, 0.01f)) + P("Motion Blur Type", 0x168, ParameterType.INT, pStep(1)), + P("Motion Blur Sample Num", 0x180, ParameterType.INT, pMinStep(0, 1)), + P("Motion Blur Shutter Speed", 0x184, ParameterType.FLOAT, pMinStep(0.0f, 0.001f)), + P("Motion Blur Fur Shutter Speed", 0x188, ParameterType.FLOAT, pStep(0.001f)), + P("Motion Blur Threshold", 0x18C, ParameterType.FLOAT, pMinStep(0.0f, 0.01f)) }; private delegate nint CreateSimpleSkyObject(nint unknownPtr); @@ -1844,108 +1875,108 @@ namespace WorldTuningTool private Hook? renderSimpleSky; private nint simpleSkyObject = 0x0; private static Parameter[] simpleSkyParameters = { - newParameter("Sky Global Intensity", 0x270, ParameterType.COLOR_FACTOR, pStep(0.001f)), - newParameter("Sky Global Cloud Speed", 0x3A8, ParameterType.FLOAT), - newParameter("Sky Top Cloud UV Scale[0]", 0x3D0, ParameterType.FLOAT), - newParameter("Sky Top Cloud UV Scale[1]", 0x3D8, ParameterType.FLOAT), - newParameter("Sky Blend", 0x3B0, ParameterType.FLOAT), - newParameter("Sky Water Reflection Factor", 0x7A0, ParameterType.COLOR_FACTOR, pStep(0.001f)), - newParameter("Sky Fog", 0x3B4, ParameterType.BOOL), - newParameter("Sky Fog Blend", 0x3B8, ParameterType.FLOAT), - newParameter("Sky DeGamma", 0x3BC, ParameterType.BOOL), - newParameter("Sky DeGamma Value", 0x3C0, ParameterType.FLOAT), - newParameter("Sky Cloud Highlight Intensity", 0x3C4, ParameterType.FLOAT), - newParameter("Sky Cloud Shadow Intensity", 0x3C8, ParameterType.FLOAT), - newParameter("Sky Cloud Contrast", 0x3CC, ParameterType.FLOAT), - newParameter("Sky Sun Map Factor", 0x280, ParameterType.COLOR_FACTOR), - newParameter("Sky Sun Size", 0x2A8, ParameterType.FLOAT), - newParameter("Sky Sun Rotation Y", 0x3A4, ParameterType.FLOAT), - newParameter("Sky Sun Height", 0x39C, ParameterType.FLOAT, pStep(0.0001f)), - newParameter("Sky Sun Light Mask Height Adjustment", 0x3A0, ParameterType.FLOAT), - newParameter("Sky Sun Light Mask Transparency", 0x2CC, ParameterType.FLOAT), - newParameter("Sky Sun Light Mask UV Scale", 0x2D0, ParameterType.FLOAT), - newParameter("Sky Sun Bloom Intensity", 0x2AC, ParameterType.FLOAT), - newParameter("Sky Sun Bloom Transparency Coefficient", 0x2B0, ParameterType.FLOAT), - newParameter("Sky Sun Bloom Threshold", 0x2B4, ParameterType.FLOAT), - newParameter("Sky Sun Bloom Dispersion", 0x2B8, ParameterType.FLOAT), - newParameter("Sky Sun Bloom Downsample Count", 0x2C0, ParameterType.FLOAT), - newParameter("Sky Sun Bloom Reduction Resolution", 0x2C4, ParameterType.FLOAT), - newParameter("Sky Sun Light Sky Color", 0x2E0, ParameterType.COLOR_FACTOR, pStep(0.001f)), - newParameter("Sky Sun Light Sky Mask UV Scale", 0x2F0, ParameterType.FLOAT), - newParameter("Sky Base Fov", 0x2BC, ParameterType.FLOAT), - newParameter("Sky Base Map Factor", 0x3E0, ParameterType.COLOR_FACTOR, pStep(0.001f)), - newParameter("Sky Base Side Cloud UV Offset", 0x3F0, ParameterType.FLOAT), - newParameter("Sky Base Top Cloud0 UV Offset", 0x3F8, ParameterType.FLOAT), - newParameter("Sky Base Top Cloud1 UV Offset", 0x400, ParameterType.FLOAT), - newParameter("Sky Base Sun Cloud Highlight Color[0]", 0x440, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Sun Cloud Shadow Color[0]", 0x480, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Middle Highlight Color[0]", 0x4C0, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Middle Shadow Color[0]", 0x500, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Background Highlight Color[0]", 0x540, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Background Shadow Color[0]", 0x580, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Cloud Speed[0]", 0x408, ParameterType.VECTOR2), - newParameter("Sky Base Cloud Alpha[0]", 0x428, ParameterType.FLOAT), - newParameter("Sky Base Sun Cloud Highlight Color[1]", 0x450, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Sun Cloud Shadow Color[1]", 0x490, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Middle Highlight Color[1]", 0x4D0, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Middle Shadow Color[1]", 0x510, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Background Highlight Color[1]", 0x550, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Background Shadow Color[1]", 0x590, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Cloud Speed[1]", 0x410, ParameterType.VECTOR2), - newParameter("Sky Base Cloud Alpha[1]", 0x42C, ParameterType.FLOAT), - newParameter("Sky Base Sun Cloud Highlight Color[2]", 0x460, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Sun Cloud Shadow Color[2]", 0x4A0, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Middle Highlight Color[2]", 0x4E0, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Middle Shadow Color[2]", 0x520, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Background Highlight Color[2]", 0x560, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Background Shadow Color[2]", 0x5A0, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Cloud Speed[2]", 0x418, ParameterType.VECTOR2), - newParameter("Sky Base Cloud Alpha[2]", 0x430, ParameterType.FLOAT), - newParameter("Sky Base Sun Cloud Highlight Color[3]", 0x470, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Sun Cloud Shadow Color[3]", 0x4B0, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Middle Highlight Color[3]", 0x4F0, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Middle Shadow Color[3]", 0x530, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Background Highlight Color[3]", 0x570, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Background Shadow Color[3]", 0x5B0, ParameterType.COLOR_FACTOR), - newParameter("Sky Base Cloud Speed[3]", 0x420, ParameterType.VECTOR2), - newParameter("Sky Base Cloud Alpha[3]", 0x434, ParameterType.FLOAT), - newParameter("Sky Blend Base Map Factor", 0x5C0, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Side Cloud UV Offset", 0x5D0, ParameterType.FLOAT), - newParameter("Sky Blend Top Cloud0 UV Offset", 0x5D8, ParameterType.FLOAT), - newParameter("Sky Blend Top Cloud1 UV Offset", 0x5E0, ParameterType.FLOAT), - newParameter("Sky Blend Sun Cloud Highlight Color[0]", 0x620, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Sun Cloud Shadow Color[0]", 0x660, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Middle Highlight Color[0]", 0x6A0, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Middle Shadow Color[0]", 0x6E0, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Background Highlight Color[0]", 0x720, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Background Shadow Color[0]", 0x760, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Cloud Speed[0]", 0x5E8, ParameterType.VECTOR2), - newParameter("Sky Blend Cloud Alpha[0]", 0x608, ParameterType.FLOAT), - newParameter("Sky Blend Sun Cloud Highlight Color[1]", 0x630, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Sun Cloud Shadow Color[1]", 0x670, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Middle Highlight Color[1]", 0x6B0, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Middle Shadow Color[1]", 0x6F0, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Background Highlight Color[1]", 0x730, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Background Shadow Color[1]", 0x770, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Cloud Speed[1]", 0x5F0, ParameterType.VECTOR2), - newParameter("Sky Blend Cloud Alpha[1]", 0x60C, ParameterType.FLOAT), - newParameter("Sky Blend Sun Cloud Highlight Color[2]", 0x640, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Sun Cloud Shadow Color[2]", 0x680, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Middle Highlight Color[2]", 0x6C0, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Middle Shadow Color[2]", 0x700, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Background Highlight Color[2]", 0x740, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Background Shadow Color[2]", 0x780, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Cloud Speed[2]", 0x5F8, ParameterType.VECTOR2), - newParameter("Sky Blend Cloud Alpha[2]", 0x610, ParameterType.FLOAT), - newParameter("Sky Blend Sun Cloud Highlight Color[3]", 0x650, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Sun Cloud Shadow Color[3]", 0x690, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Middle Highlight Color[3]", 0x6D0, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Middle Shadow Color[3]", 0x710, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Background Highlight Color[3]", 0x750, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Background Shadow Color[3]", 0x790, ParameterType.COLOR_FACTOR), - newParameter("Sky Blend Cloud Speed[3]", 0x600, ParameterType.VECTOR2), - newParameter("Sky Blend Cloud Alpha[3]", 0x614, ParameterType.FLOAT), - newParameter("Sky Starry Sky Map Factor", 0x290, ParameterType.COLOR_FACTOR, pStep(0.001f)), + P("Sky Global Intensity", 0x270, ParameterType.COLOR_FACTOR, pStep(0.001f)), + P("Sky Global Cloud Speed", 0x3A8, ParameterType.FLOAT), + P("Sky Top Cloud UV Scale[0]", 0x3D0, ParameterType.FLOAT), + P("Sky Top Cloud UV Scale[1]", 0x3D8, ParameterType.FLOAT), + P("Sky Blend", 0x3B0, ParameterType.FLOAT, pMinMaxStep(0.0f, 1.0f, 0.0025f)), + P("Sky Water Reflection Factor", 0x7A0, ParameterType.COLOR_FACTOR, pStep(0.001f)), + P("Sky Fog", 0x3B4, ParameterType.BOOL), + P("Sky Fog Blend", 0x3B8, ParameterType.FLOAT), + P("Sky DeGamma", 0x3BC, ParameterType.BOOL), + P("Sky DeGamma Value", 0x3C0, ParameterType.FLOAT), + P("Sky Cloud Highlight Intensity", 0x3C4, ParameterType.FLOAT), + P("Sky Cloud Shadow Intensity", 0x3C8, ParameterType.FLOAT), + P("Sky Cloud Contrast", 0x3CC, ParameterType.FLOAT), + P("Sky Sun Map Factor", 0x280, ParameterType.COLOR_FACTOR), + P("Sky Sun Size", 0x2A8, ParameterType.FLOAT), + P("Sky Sun Rotation Y", 0x3A4, ParameterType.FLOAT), + P("Sky Sun Height", 0x39C, ParameterType.FLOAT, pStep(0.0001f)), + P("Sky Sun Light Mask Height Adjustment", 0x3A0, ParameterType.FLOAT), + P("Sky Sun Light Mask Transparency", 0x2CC, ParameterType.FLOAT), + P("Sky Sun Light Mask UV Scale", 0x2D0, ParameterType.FLOAT), + P("Sky Sun Bloom Intensity", 0x2AC, ParameterType.FLOAT), + P("Sky Sun Bloom Transparency Coefficient", 0x2B0, ParameterType.FLOAT), + P("Sky Sun Bloom Threshold", 0x2B4, ParameterType.FLOAT), + P("Sky Sun Bloom Dispersion", 0x2B8, ParameterType.FLOAT), + P("Sky Sun Bloom Downsample Count", 0x2C0, ParameterType.FLOAT), + P("Sky Sun Bloom Reduction Resolution", 0x2C4, ParameterType.FLOAT), + P("Sky Sun Light Sky Color", 0x2E0, ParameterType.COLOR_FACTOR, pStep(0.001f)), + P("Sky Sun Light Sky Mask UV Scale", 0x2F0, ParameterType.FLOAT), + P("Sky Base Fov", 0x2BC, ParameterType.FLOAT), + P("Sky Base Map Factor", 0x3E0, ParameterType.COLOR_FACTOR, pStep(0.001f)), + P("Sky Base Side Cloud UV Offset", 0x3F0, ParameterType.FLOAT), + P("Sky Base Top Cloud0 UV Offset", 0x3F8, ParameterType.FLOAT), + P("Sky Base Top Cloud1 UV Offset", 0x400, ParameterType.FLOAT), + P("Sky Base Sun Cloud Highlight Color[0]", 0x440, ParameterType.COLOR_FACTOR), + P("Sky Base Sun Cloud Shadow Color[0]", 0x480, ParameterType.COLOR_FACTOR), + P("Sky Base Middle Highlight Color[0]", 0x4C0, ParameterType.COLOR_FACTOR), + P("Sky Base Middle Shadow Color[0]", 0x500, ParameterType.COLOR_FACTOR), + P("Sky Base Background Highlight Color[0]", 0x540, ParameterType.COLOR_FACTOR), + P("Sky Base Background Shadow Color[0]", 0x580, ParameterType.COLOR_FACTOR), + P("Sky Base Cloud Speed[0]", 0x408, ParameterType.VECTOR2), + P("Sky Base Cloud Alpha[0]", 0x428, ParameterType.FLOAT), + P("Sky Base Sun Cloud Highlight Color[1]", 0x450, ParameterType.COLOR_FACTOR), + P("Sky Base Sun Cloud Shadow Color[1]", 0x490, ParameterType.COLOR_FACTOR), + P("Sky Base Middle Highlight Color[1]", 0x4D0, ParameterType.COLOR_FACTOR), + P("Sky Base Middle Shadow Color[1]", 0x510, ParameterType.COLOR_FACTOR), + P("Sky Base Background Highlight Color[1]", 0x550, ParameterType.COLOR_FACTOR), + P("Sky Base Background Shadow Color[1]", 0x590, ParameterType.COLOR_FACTOR), + P("Sky Base Cloud Speed[1]", 0x410, ParameterType.VECTOR2), + P("Sky Base Cloud Alpha[1]", 0x42C, ParameterType.FLOAT), + P("Sky Base Sun Cloud Highlight Color[2]", 0x460, ParameterType.COLOR_FACTOR), + P("Sky Base Sun Cloud Shadow Color[2]", 0x4A0, ParameterType.COLOR_FACTOR), + P("Sky Base Middle Highlight Color[2]", 0x4E0, ParameterType.COLOR_FACTOR), + P("Sky Base Middle Shadow Color[2]", 0x520, ParameterType.COLOR_FACTOR), + P("Sky Base Background Highlight Color[2]", 0x560, ParameterType.COLOR_FACTOR), + P("Sky Base Background Shadow Color[2]", 0x5A0, ParameterType.COLOR_FACTOR), + P("Sky Base Cloud Speed[2]", 0x418, ParameterType.VECTOR2), + P("Sky Base Cloud Alpha[2]", 0x430, ParameterType.FLOAT), + P("Sky Base Sun Cloud Highlight Color[3]", 0x470, ParameterType.COLOR_FACTOR), + P("Sky Base Sun Cloud Shadow Color[3]", 0x4B0, ParameterType.COLOR_FACTOR), + P("Sky Base Middle Highlight Color[3]", 0x4F0, ParameterType.COLOR_FACTOR), + P("Sky Base Middle Shadow Color[3]", 0x530, ParameterType.COLOR_FACTOR), + P("Sky Base Background Highlight Color[3]", 0x570, ParameterType.COLOR_FACTOR), + P("Sky Base Background Shadow Color[3]", 0x5B0, ParameterType.COLOR_FACTOR), + P("Sky Base Cloud Speed[3]", 0x420, ParameterType.VECTOR2), + P("Sky Base Cloud Alpha[3]", 0x434, ParameterType.FLOAT), + P("Sky Blend Base Map Factor", 0x5C0, ParameterType.COLOR_FACTOR), + P("Sky Blend Side Cloud UV Offset", 0x5D0, ParameterType.FLOAT), + P("Sky Blend Top Cloud0 UV Offset", 0x5D8, ParameterType.FLOAT), + P("Sky Blend Top Cloud1 UV Offset", 0x5E0, ParameterType.FLOAT), + P("Sky Blend Sun Cloud Highlight Color[0]", 0x620, ParameterType.COLOR_FACTOR), + P("Sky Blend Sun Cloud Shadow Color[0]", 0x660, ParameterType.COLOR_FACTOR), + P("Sky Blend Middle Highlight Color[0]", 0x6A0, ParameterType.COLOR_FACTOR), + P("Sky Blend Middle Shadow Color[0]", 0x6E0, ParameterType.COLOR_FACTOR), + P("Sky Blend Background Highlight Color[0]", 0x720, ParameterType.COLOR_FACTOR), + P("Sky Blend Background Shadow Color[0]", 0x760, ParameterType.COLOR_FACTOR), + P("Sky Blend Cloud Speed[0]", 0x5E8, ParameterType.VECTOR2), + P("Sky Blend Cloud Alpha[0]", 0x608, ParameterType.FLOAT), + P("Sky Blend Sun Cloud Highlight Color[1]", 0x630, ParameterType.COLOR_FACTOR), + P("Sky Blend Sun Cloud Shadow Color[1]", 0x670, ParameterType.COLOR_FACTOR), + P("Sky Blend Middle Highlight Color[1]", 0x6B0, ParameterType.COLOR_FACTOR), + P("Sky Blend Middle Shadow Color[1]", 0x6F0, ParameterType.COLOR_FACTOR), + P("Sky Blend Background Highlight Color[1]", 0x730, ParameterType.COLOR_FACTOR), + P("Sky Blend Background Shadow Color[1]", 0x770, ParameterType.COLOR_FACTOR), + P("Sky Blend Cloud Speed[1]", 0x5F0, ParameterType.VECTOR2), + P("Sky Blend Cloud Alpha[1]", 0x60C, ParameterType.FLOAT), + P("Sky Blend Sun Cloud Highlight Color[2]", 0x640, ParameterType.COLOR_FACTOR), + P("Sky Blend Sun Cloud Shadow Color[2]", 0x680, ParameterType.COLOR_FACTOR), + P("Sky Blend Middle Highlight Color[2]", 0x6C0, ParameterType.COLOR_FACTOR), + P("Sky Blend Middle Shadow Color[2]", 0x700, ParameterType.COLOR_FACTOR), + P("Sky Blend Background Highlight Color[2]", 0x740, ParameterType.COLOR_FACTOR), + P("Sky Blend Background Shadow Color[2]", 0x780, ParameterType.COLOR_FACTOR), + P("Sky Blend Cloud Speed[2]", 0x5F8, ParameterType.VECTOR2), + P("Sky Blend Cloud Alpha[2]", 0x610, ParameterType.FLOAT), + P("Sky Blend Sun Cloud Highlight Color[3]", 0x650, ParameterType.COLOR_FACTOR), + P("Sky Blend Sun Cloud Shadow Color[3]", 0x690, ParameterType.COLOR_FACTOR), + P("Sky Blend Middle Highlight Color[3]", 0x6D0, ParameterType.COLOR_FACTOR), + P("Sky Blend Middle Shadow Color[3]", 0x710, ParameterType.COLOR_FACTOR), + P("Sky Blend Background Highlight Color[3]", 0x750, ParameterType.COLOR_FACTOR), + P("Sky Blend Background Shadow Color[3]", 0x790, ParameterType.COLOR_FACTOR), + P("Sky Blend Cloud Speed[3]", 0x600, ParameterType.VECTOR2), + P("Sky Blend Cloud Alpha[3]", 0x614, ParameterType.FLOAT), + P("Sky Starry Sky Map Factor", 0x290, ParameterType.COLOR_FACTOR, pStep(0.001f)), }; private delegate nint CreateFogObject(); @@ -1958,8 +1989,8 @@ namespace WorldTuningTool private Hook? updateFogParams; private nint fogObject = 0x0; private static Parameter[] fogParameters = { - newParameter("Fog Mip Fog Intensity", 0x2C0, ParameterType.FLOAT, pStep(0.001f)), - newParameter("Fog Mip Fog Color", 0x330, ParameterType.COLOR_FACTOR, pStep(0.001f)) + P("Fog Mip Fog Intensity", 0x2C0, ParameterType.FLOAT, pStep(0.0025f)), + P("Fog Mip Fog Color", 0x330, ParameterType.COLOR_FACTOR, pStep(0.001f)) }; private delegate nint CreateWaterWaveObject(nint unknownPtr); @@ -1968,9 +1999,9 @@ namespace WorldTuningTool private Hook? destroyWaterWaveObject; private nint waterWaveObject = 0x0; private static Parameter[] waterWaveParameters = { - newParameter("Water Murkiness", 0x40C, ParameterType.FLOAT), - newParameter("Water Color", 0x404, ParameterType.COLOR), - newParameter("Water Scattering Intensity", 0x408, ParameterType.FLOAT, pStep(0.001f)) + P("Water Murkiness", 0x40C, ParameterType.FLOAT), + P("Water Color", 0x404, ParameterType.COLOR), + P("Water Scattering Intensity", 0x408, ParameterType.FLOAT, pStep(0.001f)) }; private delegate nint CreateFXAAObject(); @@ -1981,9 +2012,9 @@ namespace WorldTuningTool private Hook? destroyFXAAObject; private nint fxaaObject = 0x0; private static Parameter[] fxaaParameters = { - newParameter("FXAA Subpix", 0x178, ParameterType.FLOAT, pMinMaxStep(0.0f, 1.0f, 0.005f)), - newParameter("FXAA Edge Threshold", 0x17C, ParameterType.FLOAT, pMinMaxStep(0.0f, 1.0f, 0.001f)), - newParameter("FXAA Edge Threshold Min", 0x180, ParameterType.FLOAT, pMinMaxStep(0.0f, 1.0f, 0.001f)) + P("FXAA Subpix", 0x178, ParameterType.FLOAT, pMinMaxStep(0.0f, 1.0f, 0.005f)), + P("FXAA Edge Threshold", 0x17C, ParameterType.FLOAT, pMinMaxStep(0.0f, 1.0f, 0.001f)), + P("FXAA Edge Threshold Min", 0x180, ParameterType.FLOAT, pMinMaxStep(0.0f, 1.0f, 0.001f)) }; private delegate nint CreateTAAObject(); @@ -1994,13 +2025,13 @@ namespace WorldTuningTool private Hook? destroyTAAObject; private nint taaObject = 0x0; private static Parameter[] taaParameters = { - newParameter("TAA Reprojection", 0x19D, ParameterType.BOOL), - newParameter("TAA Jitter Enable", 0x184, ParameterType.BOOL), - newParameter("TAA Blend Rate", 0x180, ParameterType.FLOAT), - newParameter("TAA Variance Gamma", 0x194, ParameterType.FLOAT), - newParameter("TAA Sharpen", 0x187, ParameterType.BOOL), - newParameter("TAA Sharpen Amount", 0x198, ParameterType.FLOAT), - newParameter("TAA Sharpend Ignore Edges", 0x19C, ParameterType.BOOL) + P("TAA Reprojection", 0x19D, ParameterType.BOOL), + P("TAA Jitter Enable", 0x184, ParameterType.BOOL), + P("TAA Blend Rate", 0x180, ParameterType.FLOAT), + P("TAA Variance Gamma", 0x194, ParameterType.FLOAT), + P("TAA Sharpen", 0x187, ParameterType.BOOL), + P("TAA Sharpen Amount", 0x198, ParameterType.FLOAT), + P("TAA Sharpend Ignore Edges", 0x19C, ParameterType.BOOL) }; private static Parameter[] allParameters = new Parameter[]{ hqMode } @@ -2010,6 +2041,7 @@ namespace WorldTuningTool .Concat(shadowParameters2) .Concat(shadowCascadeParameters) .Concat(broadAreaShadowParameters) + .Concat(sLightProbesParameters) .Concat(contactShadowParameters) .Concat(capsuleLightParameters) .Concat(ssaoParameters) @@ -2017,7 +2049,6 @@ namespace WorldTuningTool .Concat(passthroughParameters) .Concat(lightingParameters) .Concat(brightnessParameters) - .Concat(sLightProbesParameters) .Concat(bloomParameters) .Concat(dofParameters) .Concat(motionBlurParameters) @@ -2338,7 +2369,7 @@ namespace WorldTuningTool onAreaChange = Hook.Create(0x141AC27D0, OnAreaChangeHook); // nint - // Needed for at least "Broad Area Shadow Dir". Otherwise it will flicker on center change. + // Needed for at least "Broad Area Shadow Direction". Otherwise it will flicker on center change. evalSceneParams = Hook.Create(0x1423C3790, EvalSceneParamsHook); // nint, nint, int, nint // Light Dir XZY is updated seperately at 0x1420397F0, we assume this function always happens later, though. @@ -2347,11 +2378,12 @@ namespace WorldTuningTool // These run in a loop during cutscenes. updateSSAOParams = Hook.Create(0x1416D8B10, UpdateSSAOParamsHook); // nint updateSSLRParams = Hook.Create(0x1416DA3F0, UpdateSSLRParamsHook); // nint - updateLightingParams = Hook.Create(0x1416DAAB0, UpdateLightingParametersHook); // nint, nint + updateLightingParams = Hook.Create(0x1416DAAB0, UpdateLightingParamsHook); // nint, nint createLightingObject = Hook.Create(0x1424CDE20, CreateLightingObjectHook); destroyLightingObject = Hook.Create(0x1424CE380, DestroyLightingObjectHook); // nint, int - updateLutBlend = Hook.Create(0x1416D8DF0, UpdateLutBlendHook); // nint, nint + updateLutBlend = Hook.Create(0x1416D8DF0, UpdateLutBlendHook); // nint, nint + updateLightProbesParams = Hook.Create(0x141AB92C0, UpdateLightProbesParamsHook); // nint, int createBloomObject = Hook.Create(0x1424CB3C0, CreateBloomObjectHook); createBloomObject2 = Hook.Create(0x1424CB5E0, CreateBloomObject2Hook); // nint @@ -2656,6 +2688,10 @@ namespace WorldTuningTool sMhRender = SingletonManager.GetSingleton("sMhRender")!; sMhScene = SingletonManager.GetSingleton("sMhScene")!; sLightProbes = SingletonManager.GetSingleton("sLightProbes")!; + foreach (Parameter param in sLightProbesParameters) + { + param.Update(sLightProbes!.Instance); + } Config config = getConfig(); if (config.SelectedGlobal == "") { @@ -2737,22 +2773,22 @@ namespace WorldTuningTool param.Update(sMhScene!.Instance); } - foreach (Parameter param in passthroughParameters) + foreach (Parameter param in snowParameters) { param.Update(sMhScene!.Instance); } - foreach (Parameter param in shadowCascadeParameters) + foreach (Parameter param in passthroughParameters) { param.Update(sMhScene!.Instance); } - foreach (Parameter param in contactShadowParameters) + foreach (Parameter param in shadowCascadeParameters) { param.Update(sMhScene!.Instance); } - foreach (Parameter param in snowParameters) + foreach (Parameter param in contactShadowParameters) { param.Update(sMhScene!.Instance); } @@ -2775,11 +2811,6 @@ namespace WorldTuningTool } } - foreach (Parameter param in sLightProbesParameters) - { - param.Update(sLightProbes!.Instance); - } - foreach (Parameter param in brightnessParameters) { param.Update(sMhRender!.Instance); @@ -2797,10 +2828,7 @@ namespace WorldTuningTool { foreach (Parameter param in dofParameters) { - if (!param.PerFrame) - { - param.Update(dofObject); - } + param.Update(dofObject); } } @@ -2808,10 +2836,15 @@ namespace WorldTuningTool { foreach (Parameter param in motionBlurParameters) { - if (!param.PerFrame) - { - param.Update(motionBlurObject); - } + param.Update(motionBlurObject); + } + } + + if (waterWaveObject != 0x0) + { + foreach (Parameter param in waterWaveParameters) + { + param.Update(waterWaveObject); } } @@ -2830,14 +2863,6 @@ namespace WorldTuningTool param.Update(taaObject); } } - - if (waterWaveObject != 0x0) - { - foreach (Parameter param in waterWaveParameters) - { - param.Update(waterWaveObject); - } - } } private void EvalSceneParamsHook(nint unknownPtr, nint unknownPtr2, int unknownInt, nint unknownPtr3) @@ -2876,7 +2901,7 @@ namespace WorldTuningTool } } - private void UpdateLightingParametersHook(nint stackOffset, nint lightingObjectInternal) + private void UpdateLightingParamsHook(nint stackOffset, nint lightingObjectInternal) { updateLightingParams!.Original(stackOffset, lightingObjectInternal); if (lightingObject == lightingObjectInternal) @@ -2919,14 +2944,20 @@ namespace WorldTuningTool { foreach (Parameter param in lightingParameters) { - if (param.PerFrame) - { - param.Update(lightingObject, true); - } + param.Update(lightingObject, true); } } } + private void UpdateLightProbesParamsHook(nint unknownPtr, int unknownInt) + { + updateLightProbesParams!.Original(unknownPtr, unknownInt); + foreach (Parameter param in sLightProbesParameters) + { + param.Update(sLightProbes!.Instance); + } + } + private nint CreateBloomObjectHook() { bloomObject = createBloomObject!.Original(); @@ -3000,10 +3031,7 @@ namespace WorldTuningTool updateDofParams!.Original(unknownPtr); foreach (Parameter param in dofParameters) { - if (param.PerFrame) - { - param.Update(dofObject, true); - } + param.Update(dofObject, true); } } @@ -3045,10 +3073,7 @@ namespace WorldTuningTool { foreach (Parameter param in motionBlurParameters) { - if (param.PerFrame) - { - param.Update(motionBlurObject, true); - } + param.Update(motionBlurObject, true); } updateMotionBlurParams!.Original(unknownPtr, unknownPtr2); } @@ -3228,10 +3253,7 @@ namespace WorldTuningTool { foreach (Parameter param in shadowParameters2) { - if (param.PerFrame) - { - param.Update(stackOffset, true); - } + param.Update(stackOffset, true); } } updateShadowParams!.Original(shadowParams, stackOffset); @@ -3244,20 +3266,7 @@ namespace WorldTuningTool // Necessary to apply Broad Area Depth Bias overrides on first update. foreach (Parameter param in shadowParameters2) { - if (param.PerFrame) - { - param.Update(shadowParamsStatic, true); - } - } - } - else - { - foreach (Parameter param in shadowParameters2) - { - if (!param.PerFrame) - { - param.Update(shadowObjectInternal, true); - } + param.Update(shadowParamsStatic, true); } } staticShadowParams!.Original(shadowParamsStatic, shadowObjectInternal); @@ -3908,7 +3917,7 @@ namespace WorldTuningTool { shadowResParameter.Draw(width); ImGui.Separator(); - ImGui.Text($"shadowObject: 0x{shadowAddr:X}, shadowAddr: 0x{shadowObject:X}"); + ImGui.Text($"shadowAddr: 0x{shadowAddr:X}, shadowObject: 0x{shadowObject:X}"); /* if (ImGui.CollapsingHeader("Pass 1")) { @@ -3951,6 +3960,17 @@ namespace WorldTuningTool } ImGui.PopID(); + ImGui.PushID("LightProbes"); + if (ImGui.CollapsingHeader("Light Probes")) + { + ImGui.Text($"Address: 0x{sLightProbes!.Instance:X}"); + foreach (Parameter param in sLightProbesParameters) + { + param.Draw(width); + } + } + ImGui.PopID(); + ImGui.PushID("ContactLight"); if (ImGui.CollapsingHeader("Contact Light")) { @@ -4031,12 +4051,6 @@ namespace WorldTuningTool { param.Draw(width); } - ImGui.Separator(); - ImGui.Text($"Address: 0x{sLightProbes!.Instance:X}"); - foreach (Parameter param in sLightProbesParameters) - { - param.Draw(width); - } } ImGui.PopID(); @@ -4110,8 +4124,8 @@ namespace WorldTuningTool } ImGui.PopID(); - ImGui.PushID("Water"); - if (ImGui.CollapsingHeader("Water")) + ImGui.PushID("WaterWave"); + if (ImGui.CollapsingHeader("Water Waves")) { ImGui.Text($"Address: 0x{waterWaveObject:X}"); if (waterWaveObject != 0x0) @@ -4195,6 +4209,8 @@ namespace WorldTuningTool ImGui.EndTooltip(); } + lights.DrawDebug(width); + ImGui.Separator(); } @@ -4304,7 +4320,8 @@ namespace WorldTuningTool /* else if (hash == "18a797dc-9458d333-59e6dff0-9790fcea") { - if (replaceShaderFromFile(info, $"{shaderPath}/sssss.shdr")) { + if (replaceShaderFromFile(info, $"{shaderPath}/sssss.shdr")) + { info->Replacement.Type = ShaderSourceType.Binary; Log.Info("SSSSS shader replaced."); } @@ -4313,7 +4330,8 @@ namespace WorldTuningTool /* else if (hash == "ca33bab6-2119df84-41786a69-404471cd") { - if (replaceShaderFromFile(info, $"{shaderPath}/color_grading.shdr")) { + if (replaceShaderFromFile(info, $"{shaderPath}/color_grading.shdr")) + { info->Replacement.Type = ShaderSourceType.Binary; Log.Info("Color grading shader replaced."); } -- cgit v1.2.3-101-g0448