From 6265e51d8270a23fb16e2ecb3e85356910197e32 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Tue, 30 Jun 2026 21:04:21 -0400 Subject: More complete full res SSLR patches Signed-off-by: Andrew Opalach --- Plugin.cs | 161 ++++++++++++++++++++++++++++---------------------------------- 1 file changed, 73 insertions(+), 88 deletions(-) (limited to 'Plugin.cs') diff --git a/Plugin.cs b/Plugin.cs index 52aa730..820b79f 100755 --- a/Plugin.cs +++ b/Plugin.cs @@ -1886,7 +1886,6 @@ namespace WorldTuningTool private Patch ssrRes1; private Patch ssrRes2; private Patch ssrRes3; - private Patch ssrRes4; private Patch ssrShr1; private Patch ssrShr2; private Patch ssrShr3; @@ -1918,12 +1917,8 @@ namespace WorldTuningTool private Patch ssrSars21; private Patch ssrSars22; private Patch ssrSars23; - private Patch ssrSars24; - private Patch ssrSars25; - private Patch ssrSars26; private bool skipSSLRMipMapping = false; - private bool unknownFullResPath = false; private bool continousSSLRTemporalReset = false; private Patch forceSSLRTemporalReset; @@ -2188,6 +2183,13 @@ namespace WorldTuningTool createTAAObject2 = Hook.Create(0x142391320, CreateTAAObject2Hook); // nint destroyTAAObject = Hook.Create(0x1423916E0, DestroyTAAObjectHook); // nint, int + createLight = new NativeFunction(0x1418A3EF0); + //createLightObject = Hook.Create(0x1418A3EF0, CreateLightObjectHook); + destroyLightObject = Hook.Create(0x141F87D90, DestroyLightObjectHook); + addToScene = new NativeAction(0x142219070); + removeFromScene = new NativeAction(0x142228F10); + updateLights = Hook.Create(0x141F88F30, UpdateLightsHook); + IntPtr addr = PatternScanner.FindFirst(Pattern.FromString("48 89 5C 24 10 48 89 74 24 18 48 89 7C 24 20 55 41 56 41 57 48 8B EC 48 83 EC 30 48 8B FA 48 8B D9 E8 AA B6 C1 FF 48 8B 47 10 48 8D 57 50")); Assert(addr == 0x141AB2260); // nint, nint updateShadowParams = Hook.Create(addr, UpdateShadowParamsHook); @@ -2296,7 +2298,7 @@ namespace WorldTuningTool zeroFrameSkip = new Patch(new IntPtr(0x142246948), [0x31, 0xC0, 0x90, 0x90, 0x90, 0x90]); // The game will crash when trying to switch to the FULL_RES path for SSR. It's likley because - // it tries to access resources that are not available in the game files. + // it tries to access shaders that are not available in the game files. // Ex: MonsterHunterWorld.exe+259329B - lea rcx,[rdi+00000120] # Zero. // MonsterHunterWorld.exe+228C4A7 - mov rdi,[rdi+00000120] # Attempted read. // The code that zero's these addresses looks like a shell of where they would be loaded. My assumption @@ -2315,68 +2317,67 @@ namespace WorldTuningTool // SSLR resolution factor 0.5 -> 1.0 (not related to fSSLRFactor or fSSLRScale). ssrRes1 = new Patch(new IntPtr(0x1425926B8) + 0x9, [0x80]); ssrRes2 = new Patch(new IntPtr(0x1425934C0) + 0x8, [0x80]); - // Approximate mip resolution. - ssrShr1 = new Patch(new IntPtr(0x142592EBA) + 0x2, [0x3]); // 4 -> 3 - ssrShr2 = new Patch(new IntPtr(0x142592ED0) + 0x2, [0x3]); - // Compute dispatch dimensions. - ssrSars1 = new Patch(new IntPtr(0x142283626) + 0x3, [0x03]); // 4 -> 3 - ssrSars2 = new Patch(new IntPtr(0x142283633) + 0x2, [0x03]); - ssrSars3 = new Patch(new IntPtr(0x142283667) + 0x2, [0x03]); - ssrSars4 = new Patch(new IntPtr(0x14228366A) + 0x3, [0x03]); - ssrSars5 = new Patch(new IntPtr(0x14228366E) + 0x3, [0x03]); - ssrSars6 = new Patch(new IntPtr(0x142283672) + 0x3, [0x03]); - ssrSars7 = new Patch(new IntPtr(0x1422838D5) + 0x2, [0x03]); - ssrSars8 = new Patch(new IntPtr(0x1422838E7) + 0x3, [0x03]); - ssrSars9 = new Patch(new IntPtr(0x1422838F0) + 0x2, [0x03]); - ssrSars10 = new Patch(new IntPtr(0x1422838FC) + 0x2, [0x03]); - // Mips blur dispatch. - ssrSars11 = new Patch(new IntPtr(0x1422839B0), [0x8D, 0x0E, 0x44, 0x8D, 0x76, 0x01, 0x90]); + // Skip mip mapping pass (part of _FULL_RES). + ssrRes3 = new Patch(new IntPtr(0x142282B53), [0x31, 0xC0, 0x90, 0x90, 0x90]); + + // Depth mips resolution. + ssrShr1 = new Patch(new IntPtr(0x14269DE47), [0x90, 0x90]); + ssrShr2 = new Patch(new IntPtr(0x14269DE54), [0x90, 0x90]); + ssrShr3 = new Patch(new IntPtr(0x14269E07A), [0x90, 0x90]); + ssrShr4 = new Patch(new IntPtr(0x14269E080), [0x90, 0x90]); + // Approximate depth mip resolution. + ssrShr5 = new Patch(new IntPtr(0x14269DED3) + 0x2, [0x3]); + ssrShr6 = new Patch(new IntPtr(0x14269DEDA) + 0x3, [0x3]); + // Depth mips pass 1 dispatch dimensions. + ssrSars1 = new Patch(new IntPtr(0x142282FD8) + 0x3, [0x3]); // 4 -> 3 + ssrSars2 = new Patch(new IntPtr(0x142282FE5) + 0x2, [0x3]); + // Depth mips pass 2 iRegion parameter. + ssrSars3 = new Patch(new IntPtr(0x142283014) + 0x3, [0x3]); + ssrSars4 = new Patch(new IntPtr(0x142283018) + 0x3, [0x3]); + ssrSars5 = new Patch(new IntPtr(0x14228301C) + 0x3, [0x3]); + ssrSars6 = new Patch(new IntPtr(0x142283020) + 0x2, [0x3]); + // Depth mips pass 2 dispatch dimensions. + ssrSars7 = new Patch(new IntPtr(0x1422832B3) + 0x3, [0x3]); + ssrSars8 = new Patch(new IntPtr(0x1422832C8) + 0x2, [0x3]); + + // Depth copy, for unknown use, viewport/scissor. + ssrSars9 = new Patch(new IntPtr(0x1423C5809), [0x90, 0x90]); + ssrSars10 = new Patch(new IntPtr(0x1423C5818), [0x90, 0x90]); + ssrSars11 = new Patch(new IntPtr(0x1423C5824), [0x90, 0x90]); + ssrSars12 = new Patch(new IntPtr(0x1423C5830), [0x90, 0x90]); + ssrSars13 = new Patch(new IntPtr(0x1423C5ABC), [0x90, 0x90]); + ssrSars14 = new Patch(new IntPtr(0x1423C5AF3), [0x90, 0x90]); // RayAppendBuffer dispatch dimensions, 4 -> 3 wasteful. - //ssrSars12 = new Patch(new IntPtr(0x14228C323) + 0x3, [0x3]); // 4 -> 3 - //ssrSars13 = new Patch(new IntPtr(0x14228C32D) + 0x2, [0x3]); - // Clear trace buffer, 8 -> 7 wasteful - //ssrSars14 = new Patch(new IntPtr(0x14228C3F4) + 0x2, [0x7]); // 8 -> 7 - // Enable FULL_RES path for buffer only. Not sure exactly what this does yet. - // Probably increases buffer size if anything. (Maybe allows higher mip0 threshold to work?) - ssrRes3 = new Patch(new IntPtr(0x14228C19D), [0x31, 0xC0, 0x90, 0x90, 0x90]); + //new Patch(new IntPtr(0x14228C323) + 0x3, [0x3]); + //new Patch(new IntPtr(0x14228C32D) + 0x2, [0x3]); - // Skip mip mapping pass (part of _FULL_RES). - ssrRes4 = new Patch(new IntPtr(0x142282B53), [0x31, 0xC0, 0x90, 0x90, 0x90]); + // Clear trace buffer, 8 -> 7 wasteful + //new Patch(new IntPtr(0x14228C3F4) + 0x2, [0x7]); - // Depth mip texture resolution. - ssrShr3 = new Patch(new IntPtr(0x14269DE47), [0x90, 0x90]); - ssrShr4 = new Patch(new IntPtr(0x14269DE54), [0x90, 0x90]); - ssrShr5 = new Patch(new IntPtr(0x14269E07A), [0x90, 0x90]); - ssrShr6 = new Patch(new IntPtr(0x14269E080), [0x90, 0x90]); // Approximate mip resolution. - ssrShr7 = new Patch(new IntPtr(0x14269DED3) + 0x2, [0x3]); - ssrShr8 = new Patch(new IntPtr(0x14269DEDA) + 0x3, [0x3]); - // Compute dispatch dimensions. - ssrSars15 = new Patch(new IntPtr(0x142282FD8) + 0x3, [0x3]); // 4 -> 3 - ssrSars16 = new Patch(new IntPtr(0x142282FE5) + 0x2, [0x3]); - ssrSars17 = new Patch(new IntPtr(0x142283014) + 0x3, [0x3]); - ssrSars18 = new Patch(new IntPtr(0x142283018) + 0x3, [0x3]); - ssrSars19 = new Patch(new IntPtr(0x14228301C) + 0x3, [0x3]); - ssrSars20 = new Patch(new IntPtr(0x142283020) + 0x2, [0x3]); - ssrSars21 = new Patch(new IntPtr(0x14228329D) + 0x2, [0x3]); - ssrSars22 = new Patch(new IntPtr(0x1422832B3) + 0x3, [0x3]); - ssrSars23 = new Patch(new IntPtr(0x1422832BC) + 0x2, [0x3]); - ssrSars24 = new Patch(new IntPtr(0x1422832C8) + 0x2, [0x3]); + ssrShr7 = new Patch(new IntPtr(0x142592EBA) + 0x2, [0x3]); // 4 -> 3 + ssrShr8 = new Patch(new IntPtr(0x142592ED0) + 0x2, [0x3]); + // Mips pass 1 dispatch dimensions. + ssrSars15 = new Patch(new IntPtr(0x142283626) + 0x3, [0x03]); // 4 -> 3 + ssrSars16 = new Patch(new IntPtr(0x142283633) + 0x2, [0x03]); + // Mips pass 2 iRegion parameter. + ssrSars17 = new Patch(new IntPtr(0x142283667) + 0x2, [0x03]); + ssrSars18 = new Patch(new IntPtr(0x14228366A) + 0x3, [0x03]); + ssrSars19 = new Patch(new IntPtr(0x14228366E) + 0x3, [0x03]); + ssrSars20 = new Patch(new IntPtr(0x142283672) + 0x3, [0x03]); + // Mips pass 2 dispatch dimensions. + ssrSars21 = new Patch(new IntPtr(0x1422838E7) + 0x3, [0x03]); + ssrSars22 = new Patch(new IntPtr(0x1422838FC) + 0x2, [0x03]); + // Mips blur dispatch dimensions. + ssrSars23 = new Patch(new IntPtr(0x1422839B0), [0x8D, 0x0E, 0x44, 0x8D, 0x76, 0x01, 0x90]); // Resolve pass, 4 -> 3 wasteful. - //ssrSars25 = new Patch(new IntPtr(0x14228686D) + 0x3, [0x3]); - //ssrSars26 = new Patch(new IntPtr(0x142286877) + 0x2, [0x3]); + //new Patch(new IntPtr(0x14228686D) + 0x3, [0x3]); + //new Patch(new IntPtr(0x142286877) + 0x2, [0x3]); forceSSLRTemporalReset = new Patch(new IntPtr(0x14228CE53), [0xB9, 0x01, 0x00, 0x00, 0x00, 0x90, 0x90]); - createLight = new NativeFunction(0x1418A3EF0); - //createLightObject = Hook.Create(0x1418A3EF0, CreateLightObjectHook); - destroyLightObject = Hook.Create(0x141F87D90, DestroyLightObjectHook); - addToScene = new NativeAction(0x142219070); - removeFromScene = new NativeAction(0x142228F10); - updateLights = Hook.Create(0x141F88F30, UpdateLightsHook); - return new PluginData(); } @@ -2390,7 +2391,6 @@ namespace WorldTuningTool { ssrRes1.Enable(); ssrRes2.Enable(); - //ssrRes3.Enable(); ssrShr1.Enable(); ssrShr2.Enable(); ssrShr3.Enable(); @@ -2410,9 +2410,9 @@ namespace WorldTuningTool ssrSars9.Enable(); ssrSars10.Enable(); ssrSars11.Enable(); - //ssrSars12.Enable(); - //ssrSars13.Enable(); - //ssrSars14.Enable(); + ssrSars12.Enable(); + ssrSars13.Enable(); + ssrSars14.Enable(); ssrSars15.Enable(); ssrSars16.Enable(); ssrSars17.Enable(); @@ -2422,9 +2422,6 @@ namespace WorldTuningTool ssrSars21.Enable(); ssrSars22.Enable(); ssrSars23.Enable(); - ssrSars24.Enable(); - //ssrSars25.Enable(); - //ssrSars26.Enable(); } #endif fullResVolumeBlur = patches.FullResolutionVolumeBlur; @@ -4048,45 +4045,33 @@ namespace WorldTuningTool if (ImGui.CollapsingHeader("Tests")) { - if (ImGui.Checkbox("Continous SSLR Temporal Reset", ref continousSSLRTemporalReset)) + if (ImGui.Checkbox("Skip Mip Mapping for SSLR", ref skipSSLRMipMapping)) { - if (continousSSLRTemporalReset) + if (skipSSLRMipMapping) { - forceSSLRTemporalReset.Enable(); + ssrRes3.Enable(); } else { - forceSSLRTemporalReset.Disable(); + ssrRes3.Disable(); } } - if (ImGui.BeginItemTooltip()) - { - ImGui.Text("Don't reference tBlendMap in SSLR resolve."); - ImGui.EndTooltip(); - } - if (ImGui.Checkbox("Skip SSLR Mip Mapping", ref skipSSLRMipMapping)) + if (ImGui.Checkbox("Continous SSLR Temporal Reset", ref continousSSLRTemporalReset)) { - if (skipSSLRMipMapping) + if (continousSSLRTemporalReset) { - ssrRes4.Enable(); + forceSSLRTemporalReset.Enable(); } else { - ssrRes4.Disable(); + forceSSLRTemporalReset.Disable(); } } - - if (ImGui.Checkbox("Force unknown _FULL_RES (Probably Useless)", ref unknownFullResPath)) + if (ImGui.BeginItemTooltip()) { - if (unknownFullResPath) - { - ssrRes3.Enable(); - } - else - { - ssrRes3.Disable(); - } + ImGui.Text("Don't reference tBlendMap in SSLR resolve."); + ImGui.EndTooltip(); } ImGui.Separator(); -- cgit v1.2.3-101-g0448