diff options
Diffstat (limited to 'Plugin.cs')
| -rwxr-xr-x | Plugin.cs | 100 |
1 files changed, 82 insertions, 18 deletions
@@ -16,9 +16,7 @@ using System.Diagnostics; using ImGuiNET;
using SharpPluginLoader.Core;
-#if SHADER_FEATURES
using SharpPluginLoader.Core.Rendering;
-#endif
#if RESOURCE_ADJUSTMENT
using SharpPluginLoader.Core.Resources;
#endif
@@ -1562,11 +1560,11 @@ namespace WorldTuningTool private delegate void UpdateSSLRParams(nint stackOffset);
private Hook<UpdateSSLRParams>? updateSSLRParams;
private static Parameter[] sslrParameters = {
- newParameter<int>("SSLR Loop Count", 0xE628, ParameterType.INT),
+ newParameter<int>("SSLR Loop Count", 0xE628, ParameterType.INT, pStep(1)),
newParameter<float>("SSLR Loop Count Factor for CBR", 0xE62C, ParameterType.FLOAT),
newParameter<float>("SSLR Eliminate Depth", 0xE630, ParameterType.FLOAT),
- newParameter<float>("SSLR Accurate Threshold", 0xE644, ParameterType.FLOAT),
- newParameter<float>("SSLR Accurate Threshold (HQ)", 0xE64C, ParameterType.FLOAT),
+ newParameter<float>("SSLR Accurate Threshold", 0xE644, ParameterType.FLOAT, pStep(0.001f)),
+ newParameter<float>("SSLR Accurate Threshold (HQ)", 0xE64C, ParameterType.FLOAT, pStep(0.001f)),
newParameter<float>("SSLR Dither Radius", 0xE634, ParameterType.FLOAT),
newParameter<float>("SSLR Importance Bias", 0xE638, ParameterType.FLOAT),
newParameter<float>("SSLR Mip Scale", 0xE63C, ParameterType.FLOAT),
@@ -1815,11 +1813,11 @@ namespace WorldTuningTool private static void shadowResEnable(int multiplier)
{
+ Assert(multiplier != 1);
if (multiplier == currentShadowResMultiplier)
{
return;
}
- Assert(multiplier != 1);
switch (currentShadowResMultiplier)
{
case 1:
@@ -1912,6 +1910,7 @@ namespace WorldTuningTool private Patch ssrRes1;
private Patch ssrRes2;
private Patch ssrRes3;
+ private Patch ssrRes4;
private Patch ssrShr1;
private Patch ssrShr2;
private Patch ssrShr3;
@@ -1947,6 +1946,11 @@ namespace WorldTuningTool private Patch ssrSars25;
private Patch ssrSars26;
+ private bool skipSSLRMipMapping = false;
+ private bool unknownFullResPath = false;
+ private bool continousSSLRTemporalReset = false;
+ private Patch forceSSLRTemporalReset;
+
private bool fullResVolumeBlur = false;
private Patch volumeSars1;
private Patch volumeSars2;
@@ -2361,16 +2365,21 @@ namespace WorldTuningTool 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]);
- // RayAppendBuffer dispatch dimensions.
- ssrSars12 = new Patch(new IntPtr(0x14228C323) + 0x3, [0x3]); // 4 -> 3
- ssrSars13 = new Patch(new IntPtr(0x14228C32D) + 0x2, [0x3]);
- ssrSars14 = new Patch(new IntPtr(0x14228C3F4) + 0x2, [0x7]); // 8 -> 7
+ // 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]);
+ // Skip mip mapping pass (part of _FULL_RES).
+ ssrRes4 = new Patch(new IntPtr(0x142282B53), [0x31, 0xC0, 0x90, 0x90, 0x90]);
+
// Depth mip texture resolution.
ssrShr3 = new Patch(new IntPtr(0x14269DE47), [0x90, 0x90]);
ssrShr4 = new Patch(new IntPtr(0x14269DE54), [0x90, 0x90]);
@@ -2391,9 +2400,11 @@ namespace WorldTuningTool ssrSars23 = new Patch(new IntPtr(0x1422832BC) + 0x2, [0x3]);
ssrSars24 = new Patch(new IntPtr(0x1422832C8) + 0x2, [0x3]);
- // Idk yet.
- ssrSars25 = new Patch(new IntPtr(0x14228686D) + 0x3, [0x3]);
- ssrSars26 = new Patch(new IntPtr(0x142286877) + 0x2, [0x3]);
+ // Resolve pass, 4 -> 3 wasteful.
+ //ssrSars25 = new Patch(new IntPtr(0x14228686D) + 0x3, [0x3]);
+ //ssrSars26 = new Patch(new IntPtr(0x142286877) + 0x2, [0x3]);
+
+ forceSSLRTemporalReset = new Patch(new IntPtr(0x14228CE53), [0xB9, 0x01, 0x00, 0x00, 0x00, 0x90, 0x90]);
createLight = new NativeFunction<int, nint>(0x1418A3EF0);
//createLightObject = Hook.Create<CreateLightObject>(0x1418A3EF0, CreateLightObjectHook);
@@ -2415,7 +2426,7 @@ namespace WorldTuningTool {
ssrRes1.Enable();
ssrRes2.Enable();
- ssrRes3.Enable();
+ //ssrRes3.Enable();
ssrShr1.Enable();
ssrShr2.Enable();
ssrShr3.Enable();
@@ -2437,8 +2448,7 @@ namespace WorldTuningTool ssrSars11.Enable();
//ssrSars12.Enable();
//ssrSars13.Enable();
- ssrSars24.Enable();
- ssrSars14.Enable();
+ //ssrSars14.Enable();
ssrSars15.Enable();
ssrSars16.Enable();
ssrSars17.Enable();
@@ -2448,8 +2458,9 @@ namespace WorldTuningTool ssrSars21.Enable();
ssrSars22.Enable();
ssrSars23.Enable();
- ssrSars25.Enable();
- ssrSars26.Enable();
+ ssrSars24.Enable();
+ //ssrSars25.Enable();
+ //ssrSars26.Enable();
}
#endif
fullResVolumeBlur = patches.FullResolutionVolumeBlur;
@@ -4010,6 +4021,48 @@ namespace WorldTuningTool ImGui.Text("Some min/max values are set to avoid crashes, so be warned.");
ImGui.EndTooltip();
}
+
+ if (ImGui.Checkbox("Continous SSLR Temporal Reset", ref continousSSLRTemporalReset))
+ {
+ if (continousSSLRTemporalReset)
+ {
+ forceSSLRTemporalReset.Enable();
+ }
+ else
+ {
+ forceSSLRTemporalReset.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 (skipSSLRMipMapping)
+ {
+ ssrRes4.Enable();
+ }
+ else
+ {
+ ssrRes4.Disable();
+ }
+ }
+
+ if (ImGui.Checkbox("Force unknown _FULL_RES (Probably Useless)", ref unknownFullResPath))
+ {
+ if (unknownFullResPath)
+ {
+ ssrRes3.Enable();
+ }
+ else
+ {
+ ssrRes3.Disable();
+ }
+ }
+
ImGui.PushItemWidth(width * 0.15f);
ImGui.Text($"FPS: {MemoryUtil.GetRef<float>(sMain!.Instance + 0x68)}");
ImGui.Text($"Delta Time: {MemoryUtil.GetRef<float>(sMain!.Instance + 0x94)}");
@@ -4182,6 +4235,17 @@ namespace WorldTuningTool }
}
}
+ else
+ {
+ if (hash == "8703f55f-6c22fba7-1ef876f1-4767379e")
+ {
+ if (replaceShaderFromFile(info, $"{shaderPath}/sslr_resolve_no_jitter_min_only.shdr"))
+ {
+ info->Replacement.Type = ShaderSourceType.Binary;
+ Log.Info("SSLR resolve no jitter shader replaced.");
+ }
+ }
+ }
}
#endif
}
|