From 4f31c9e16b58eeb1e914d58a4e92b8adc6529450 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Mon, 6 Apr 2026 15:27:06 -0400 Subject: Cleanup volume upsample stuff Signed-off-by: Andrew Opalach --- Plugin.cs | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'Plugin.cs') diff --git a/Plugin.cs b/Plugin.cs index a7d4394..30d9a88 100755 --- a/Plugin.cs +++ b/Plugin.cs @@ -1,4 +1,5 @@ //#define ENABLE_ASSERTS +//#define ADDR_ASSERTS //#define SHADER_FEATURES using System.Numerics; @@ -1069,6 +1070,8 @@ namespace WorldTuningTool new Parameter("LOD Length Platform Bias[2]", 0x22C + (4 * 2), ParameterType.FLOAT, false), new Parameter("LOD Pixel Size Platform Bias[2]", 0x244 + (4 * 2), ParameterType.FLOAT, false), new Parameter("Fake Light Intensity", 0xEC40, ParameterType.FLOAT, false), + // MonsterHunterWorld.exe+1B18711 - mov [rbx+0000EC44],3F800000 (Other unknown reference). + new Parameter("Fake Light Intensity (Gameplay)", new IntPtr(0x141B1A19F) + 0x6, ParameterType.PATCH_FLOAT, false), new Parameter("Fake Light Blend", new IntPtr(0x141CDE0CE) + 0x6, ParameterType.PATCH_FLOAT, false), new Parameter("Contact Shadows Enabled", 0xB4EC, ParameterType.BOOL, false), new Parameter("Force Disable Contact Shadows", 0xB4ED, ParameterType.BOOL, false), @@ -1597,6 +1600,10 @@ namespace WorldTuningTool 0xB8, 0x40, 0x15, 0x00, 0x00, 0xEB, 0x21 // This case is used for Low, Medium and High in-game. ]); + // The volume blur filter is created at a different place in the code and happens at a different + // time (area change/createLightingObject() vs change of Volume Quality setting). It's also rendered + // in a seperate pass that happens after the initial volume rendering. So keep that in mind if inspecting + // a frame in renderdoc. volumeSars1 = new Patch(new IntPtr(0x1424D0159), [0x90, 0x90]); volumeSars2 = new Patch(new IntPtr(0x1424D01A0), [0x90, 0x90]); volumeSars3 = new Patch(new IntPtr(0x1424D01C6), [0x90, 0x90]); @@ -1606,13 +1613,28 @@ namespace WorldTuningTool volumeSars7 = new Patch(new IntPtr(0x1424D02C6), [0x90, 0x90]); volumeSars8 = new Patch(new IntPtr(0x1424D0321), [0x90, 0x90]); volumeSars9 = new Patch(new IntPtr(0x1424D034A), [0x90, 0x90]); + /* As far as I can tell this is limited by buffers created cpu-side, seems like it + * would be an extremely hard change. + froxelRes1 = new Patch(new IntPtr(0x142384F15) + 0x1, [0x02]); // 4 -> 2 + froxelRes2 = new Patch(new IntPtr(0x142389711) + 0x1, [0x02]); // 4 -> 2 + froxelRes3 = new Patch(new IntPtr(0x142389878) + 0x1, [0x02]); // 4 -> 2 + froxelRes4 = new Patch(new IntPtr(0x14238989E) + 0x1, [0x02]); // 4 -> 2 + froxelRes5 = new Patch(new IntPtr(0x1423898D8) + 0x1, [0x02]); // 4 -> 2 + froxelRes6 = new Patch(new IntPtr(0x14238992B) + 0x1, [0x02]); // 4 -> 2 + froxelRes7 = new Patch(new IntPtr(0x14238FED1) + 0x4, [0x7B, 0xFF, 0xAB, 0x00]); // 0.25 -> 0.50 + froxelRes8 = new Patch(new IntPtr(0x14239009C) + 0x4, [0xB0, 0xFD, 0xAB, 0X00]); // 0.25 -> 0.50 + */ + /* Would require a complicated shader edit to maybe work. Similar to SSLR. + checkerRes1 = new Patch(new IntPtr(0x14238580D) + 0x4, [0x43]); // 0.5 -> 1.0 + checkerRes2 = new Patch(new IntPtr(0x14238FFC3) + 0x4, [0x8D]); // 0.5 -> 1.0 + */ value2ForVolumeQuality = new Patch(new IntPtr(0x142389652), [0xB8, 0x02, 0x00, 0x00, 0x00, 0x90]); // Gameplay. addr = PatternScanner.FindFirst(Pattern.FromString("80 BB 34 EC 00 00 00 88 8B 31 EC 00 00 C6 83 30 EC 00 00 00 74 1C C6 83 34 EC 00 00 00 48 8B 0D 68 4B 4F 03 80 B9 58 02 00 00 00 75 05 E8 5A F5 01 00 48 8B CB E8 E2 05 00 00 83 BB DC EB 00 00 06 74 0A C7 83 DC EB 00 00 06 00 00 00")); #if ADDR_ASSERTS - ssert(addr == 0x141B1A0B4); + Assert(addr == 0x141B1A0B4); #endif defaultViewModeLODLimit = new Patch(addr + 0x40, [0x07, 0x74, 0x0A, 0xC7, 0x83, 0xDC, 0xEB, 0x00, 0x00, 0x07]); @@ -2636,7 +2658,7 @@ namespace WorldTuningTool string hash = new string(info->DxbcHash); if (!shadersLoadedOnce && hash == "2e4e18fd-6ea5eeae-2de3d65c-26ab36dd") { - if (replaceShaderFromFile(info, $"{shaderPath}/volume_upsample.shdr")) { + if (replaceShaderFromFile(info, $"{shaderPath}/volume_upsample1.shdr")) { info->Replacement.Type = ShaderSourceType.BINARY; Log.Info("Volume upsample shader 1 replaced."); } -- cgit v1.2.3-101-g0448