From 9e9ae166345de658f012aca9b6e8d8d546ce6c94 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Thu, 19 Feb 2026 18:02:50 -0500 Subject: Cleanup for version 4.0 beta2 Signed-off-by: Andrew Opalach --- Config.cs | 14 ++++++++++--- Plugin.cs | 67 +++++++++++++++++++++++++++++++++++++++++------------------ changelog.txt | 33 ++++++++++++++++------------- 3 files changed, 76 insertions(+), 38 deletions(-) diff --git a/Config.cs b/Config.cs index 2a10ecc..8570644 100755 --- a/Config.cs +++ b/Config.cs @@ -47,14 +47,20 @@ namespace MHWNewCamera EnableCombo = true; FreeCameraCombo = "RStick,LT"; DisableComboButton1UnlessButton2Held = false; +#if SIMPLE_KEYBOARD_LAYER + EnableMouse = true; + MouseSensitivity = 0.0225f; EnableKeyboard = true; KeyboardLookSensitivity = 19750; +#endif } public bool EnableCombo { get; set; } public String FreeCameraCombo { get; set; } public bool DisableComboButton1UnlessButton2Held { get; set; } #if SIMPLE_KEYBOARD_LAYER + public bool EnableMouse { get; set; } + public float MouseSensitivity { get; set; } public bool EnableKeyboard { get; set; } public int KeyboardLookSensitivity { get; set; } #endif @@ -76,12 +82,14 @@ namespace MHWNewCamera public GraphicalTweaks() { TripleShadowResolution = false; - ShadowRangeOffset = 0.6f; + ShadowRangeOffset = 0.5f; ApplyShadowRange = false; ShadowRadiusOffset = -0.0001f; ApplyShadowRadius = false; HigherShadowDetailInHoarfrost = false; EnableHQMode = false; + FullResolutionVolumeBlur = false; + HigherThanHighestVolumeRendering = false; DisableLODLimits = false; FoliageLODBias = 3.0f; TerrainLODBias = 16.0f; @@ -91,7 +99,6 @@ namespace MHWNewCamera ApplyLODFactors = false; LargerFoliageSwayRange = false; DisableReducedRateAnimations = false; - DisableVolumetricDownsample = false; } public bool TripleShadowResolution { get; set; } @@ -101,6 +108,8 @@ namespace MHWNewCamera public bool ApplyShadowRadius { get; set; } public bool HigherShadowDetailInHoarfrost { get; set; } public bool EnableHQMode { get; set; } + public bool FullResolutionVolumeBlur { get; set; } + public bool HigherThanHighestVolumeRendering { get; set; } public bool DisableLODLimits { get; set; } public float FoliageLODBias { get; set; } public float TerrainLODBias { get; set; } @@ -110,7 +119,6 @@ namespace MHWNewCamera public bool ApplyLODFactors { get; set; } public bool LargerFoliageSwayRange { get; set; } public bool DisableReducedRateAnimations { get; set; } - public bool DisableVolumetricDownsample { get; set; } } public struct Position diff --git a/Plugin.cs b/Plugin.cs index fe9631c..03c8c49 100755 --- a/Plugin.cs +++ b/Plugin.cs @@ -46,9 +46,7 @@ using SharpPluginLoader.Core.Configuration; // - Open Poses Menu // @TODO: -// - Cleanup volume rendering test stuff. // - Better hook for renderer params. -// - Alternate settings for your room. // - Centralize all bindings to get a better idea of how to structure custom binds. // - Use GetRef<>. // - Hide Hunter's Knife/Slinger. @@ -290,10 +288,10 @@ namespace MHWNewCamera #if MOUSE_AND_KEYBOARD_LAYER private static readonly MtObject sMhMouse = SingletonManager.GetSingleton("sMhMouse")!; private static readonly MtObject sMhKeyboard = SingletonManager.GetSingleton("sMhKeyboard")!; + private bool mouseEnabled = false; + private float mouseSensitivity; private bool keyboardEnabled = false; private int keyboardLookValue; - private bool mouseEnabled = true; - private float mouseSensitivity = 0.0225f; #endif private float plusRight = 0.0f; @@ -653,6 +651,8 @@ namespace MHWNewCamera typedCombo = binds.FreeCameraCombo.Replace(",", "+"); disableComboButton1 = binds.DisableComboButton1UnlessButton2Held; #if MOUSE_AND_KEYBOARD_LAYER + mouseEnabled = binds.EnableMouse; + mouseSensitivity = binds.MouseSensitivity; keyboardEnabled = binds.EnableKeyboard; keyboardLookValue = binds.KeyboardLookSensitivity; #endif @@ -681,12 +681,13 @@ namespace MHWNewCamera applyShadowRadius = graphics.ApplyShadowRadius; //lowShadowDetailOverride = graphics.HigherShadowDetailInHoarfrost; enableHQMode = graphics.EnableHQMode; + disableVolumeDownsample = graphics.FullResolutionVolumeBlur; + higherVolumeQuality = graphics.HigherThanHighestVolumeRendering; ssaoAdjustments = enableHQMode; ssrAdjustments = enableHQMode; disableLODLimits = graphics.DisableLODLimits; largerFoliageSwayRange = graphics.LargerFoliageSwayRange; disableReducedRateAnimations = graphics.DisableReducedRateAnimations; - disableVolumeDownsample = graphics.DisableVolumetricDownsample; ConfigManager.SaveConfig(this); @@ -989,8 +990,6 @@ namespace MHWNewCamera underwaterCamera5 = new Patch((nint)0x141FA5A74, [0x0F, 0x57, 0xF6, 0x31, 0xD2, 0x48, 0x8D, 0x4D, 0x80, 0xE8, 0x9E, 0x41, 0x38, 0xFE, 0xC1, 0xE8, 0x14, 0x66, 0x25, 0xD8, 0x03, 0xFF, 0xC8, 0x66, 0x3D, 0x48, 0x00, 0x77]); underwaterCheckHook = Hook.Create(0x1412AD500, UnderwaterCheckHook); // nint - value2ForVolumeQuality = new Patch((nint)0x142389652, [0xB8, 0x02, 0x00, 0x00, 0x00, 0x90]); - volumeSars1 = new Patch((nint)0x1424D0159, [0x90, 0x90]); volumeSars2 = new Patch((nint)0x1424D01A0, [0x90, 0x90]); volumeSars3 = new Patch((nint)0x1424D01C6, [0x90, 0x90]); @@ -1013,6 +1012,12 @@ namespace MHWNewCamera volumeSars9.Enable(); } + value2ForVolumeQuality = new Patch((nint)0x142389652, [0xB8, 0x02, 0x00, 0x00, 0x00, 0x90]); + if (higherVolumeQuality && !disableMod) + { + value2ForVolumeQuality.Enable(); + } + createLightingObject = Hook.Create(0x1424CE130, CreateLightingObjectHook); // nint destroyLightingObject = Hook.Create(0x1424CE380, DestroyLightingObjectHook); // nint, nint @@ -1226,8 +1231,6 @@ namespace MHWNewCamera debugLog($"OnUpdate() @ {frameTick}"); #endif - resetStatePerFrame(); - #if MOUSE_AND_KEYBOARD_LAYER if (keyboardEnabled) { @@ -1309,6 +1312,8 @@ namespace MHWNewCamera } } } + + resetStatePerFrame(); } private static Quaternion getForward(Vector3 pos, Vector3 target) @@ -1527,9 +1532,9 @@ namespace MHWNewCamera if (playerMovementLocked) { orbitDistance -= Ly; - if (orbitDistance < 0.01f) + if (orbitDistance < 3.00f) { - orbitDistance = 0.01f; + orbitDistance = 3.00f; } } orbitMovementRotation += Lx / 5.0f; @@ -3459,7 +3464,7 @@ namespace MHWNewCamera } info->NewSourceType = SourceType.BINARY; info->NewSourceLength = shaderData.Length; - info->NewSource = (byte*)Marshal.UnsafeAddrOfPinnedArrayElement(shaderData, 0); + info->NewSource = (byte *)Marshal.UnsafeAddrOfPinnedArrayElement(shaderData, 0); } else if (hash == "e2c8c13e-45bc99b2-4c3d7699-3d66188e") { @@ -3474,7 +3479,7 @@ namespace MHWNewCamera } info->NewSourceType = SourceType.BINARY; info->NewSourceLength = shaderData.Length; - info->NewSource = (byte*)Marshal.UnsafeAddrOfPinnedArrayElement(shaderData, 0); + info->NewSource = (byte *)Marshal.UnsafeAddrOfPinnedArrayElement(shaderData, 0); } } #endif @@ -3743,7 +3748,7 @@ namespace MHWNewCamera ImGui.Text("The scoutfly marker on menus will still be visible."); ImGui.EndTooltip(); } - if (!freeCamera) + if (!freeCamera || freeCameraFallback) { ImGui.PushStyleVar(ImGuiStyleVar.Alpha, ImGui.GetStyle().Alpha * 0.5f); } @@ -3752,6 +3757,11 @@ namespace MHWNewCamera ImGui.Checkbox("Unlock Player Movement", ref unlockMovementToggled); ImGui.Checkbox("Lock Vertical Movement and Apply Speed Modifier", ref lockVerticalToggled); ImGui.Checkbox("Orbit Player", ref orbitPlayer); + if (ImGui.BeginItemTooltip()) + { + ImGui.Text("Use left stick up/down to move the camera forward/back and d-pad up/down to set the Y target."); + ImGui.EndTooltip(); + } ImGui.SameLine(); ImGui.Checkbox("Ignore Camera Direction", ref orbitIgnoreCamera); if (ImGui.BeginItemTooltip()) @@ -3759,7 +3769,7 @@ namespace MHWNewCamera ImGui.Text("Left stick right/left will gradually shift your forward direction."); ImGui.EndTooltip(); } - if (!freeCamera) + if (!freeCamera || freeCameraFallback) { ImGui.PopStyleVar(); } @@ -4099,9 +4109,17 @@ namespace MHWNewCamera ImGui.PushItemWidth(width * 0.2f); if (ImGui.Checkbox("Enable Mouse", ref mouseEnabled)) { + Config.Settings.Binds binds = config.Binds; + binds.EnableMouse = mouseEnabled; + config.Binds = binds; + ConfigManager.SaveConfig(this); } if (ImGui.DragFloat("Mouse Sensitivity", ref mouseSensitivity, 0.001f, 0.0f, 0.0f, "%.4f")) { + Config.Settings.Binds binds = config.Binds; + binds.MouseSensitivity = mouseSensitivity; + config.Binds = binds; + ConfigManager.SaveConfig(this); } if (ImGui.Checkbox("Enable Keyboard", ref keyboardEnabled)) { @@ -4708,7 +4726,7 @@ namespace MHWNewCamera } if (ImGui.BeginItemTooltip()) { - ImGui.Text("This will inversely reduce the detail of shadows closer to the camera (like the player shadow), so it's a trade-off.\nValue is an offset. Recommended: 0.6."); + ImGui.Text("This will inversely reduce the detail of shadows closer to the camera (like the player shadow), so it's a trade-off.\nValue is an offset. Recommended: 0.5."); ImGui.EndTooltip(); } ImGui.SameLine(); @@ -4729,7 +4747,7 @@ namespace MHWNewCamera } if (ImGui.BeginItemTooltip()) { - ImGui.Text("Size of a shadows border (to be softened if HQ Mode is enabled).\nValue is an offset. Recommended: -0.0001 (if Shadow Range = 0.6)."); + ImGui.Text("Size of a shadows border (to be softened if HQ Mode is enabled).\nValue is an offset. Recommended: -0.0001 (if Shadow Range = 0.5)."); ImGui.EndTooltip(); } ImGui.PopItemWidth(); @@ -4794,7 +4812,7 @@ namespace MHWNewCamera volumeSars9.Disable(); } Config.GraphicalTweaks graphics = config.Graphics; - graphics.DisableVolumetricDownsample = disableVolumeDownsample; + graphics.FullResolutionVolumeBlur = disableVolumeDownsample; config.Graphics = graphics; ConfigManager.SaveConfig(this); } @@ -4814,6 +4832,10 @@ namespace MHWNewCamera { value2ForVolumeQuality.Disable(); } + Config.GraphicalTweaks graphics = config.Graphics; + graphics.HigherThanHighestVolumeRendering = higherVolumeQuality; + config.Graphics = graphics; + ConfigManager.SaveConfig(this); } if (ImGui.BeginItemTooltip()) { @@ -4958,12 +4980,17 @@ namespace MHWNewCamera nint obj = MemoryUtil.Read(sUmbra.Instance + 0x00149740); ImGui.Text($"Object Address: {obj:x}"); ImGui.Checkbox("Apply Adjust", ref applyShadowAdjust); + ImGui.InputFloat("Shadow Backforward Distance", ref shadowBackforwardDistance); + if (ImGui.BeginItemTooltip()) + { + ImGui.Text("Try increasing this if it looks like objects are being culled out of the shadow map at certain angles.\nThese values probably neeed to be entirely retuned per-area after increasing shadow range."); + ImGui.EndTooltip(); + } + ImGui.Text($"Original: {lastShadowBackforwardDistance}"); ImGui.InputFloat("Shadow Distance", ref shadowDistance); ImGui.Text($"Original: {lastShadowDistance}"); ImGui.InputFloat("Shadow Distribution", ref shadowDistribution); ImGui.Text($"Original: {lastShadowDistribution}"); - ImGui.InputFloat("Shadow Backforward Distance", ref shadowBackforwardDistance); - ImGui.Text($"Original: {lastShadowBackforwardDistance}"); /* ImGui.InputFloat("Broad Area Shadow Range", ref broadAreaShadowRange); ImGui.Text($"Original: {lastBroadAreaShadowRange}"); diff --git a/changelog.txt b/changelog.txt index ff50b70..d373369 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,21 +1,24 @@ -= 4.0 += 4.0 (Beta) MHWNewCamera_4.0_beta1.zip: 1/22/26, sha256-d3f16b30260b6aef1a981f1f6dc19f7067e13330c931c164ca4c3d254bb3eb92 + MHWNewCamera_4.0_beta2.zip: 2/19/26, sha256-749a815623e6c4cc0199f8c0fb10fb2b6fca4fa8e4c4dbd238431f75a60efbd2 == Changelog -* Add basic keyboard binds. -* Add option to override in-game View Mode (enable free camera from this mod instead). -* Add controller bind to switch perspective camera presets. -* Add bind to disable SSAO. -* Add the ability to control the game speed and time of day. -* Add option to adjust snow lod. -* Adjust how Increased Shadow Detail in Hoarfrost affects Shadow Range. It now doubles only the offset instead of the whole value. -* Add option to disable reduced rate animations of animals that are far from the camera. -* Add option to enable HQ Mode and accompanying SSAO/SSR adjustments. -* Add experimental underwater camera feature that mimics the screen filter of diving whenever the camera goes underwater. -* Add the ability to hide your weapon. +* Temporarily removed "Higher Shadow Detail in Hoarfrost Reach/Seliana Gathering Hub" because it relied on a very wasteful part of the shadow resolution patch that is now reverted. +* Basic mouse and keyboard support. +* Option to override in-game View Mode (enable free camera from this mod instead). +* Added binds for open gestures or poses menu, switch perspective camera presets, and disable SSAO. +* Added the ability to control the game speed and time of day. +* Added option to enable HQ Mode and accompanying SSAO/SSR adjustments. +* Added tweaks for volume rendering (full resolution blur pass and higher "Quality"). +* Added the ability to tweak snow LOD. +* Added option to disable reduced rate animations of animals that are far from the camera. +* Added experimental underwater camera feature that mimics the screen filter of diving whenever the camera goes underwater. +* Added the ability to hide your weapon. * Allow changing between passive and combat mode. -* Added function to control view and control player wetness. -* Add button to trigger the action of sitting in hot springs. As well as options to allow hot springs anywhere and disable the steam effect on your hunter. -* Add function to simulate crawling under a passageway anywhere combat controls are active. +* Added function to change player opacity. +* Added function to view and control player wetness. +* Added button to trigger the action of sitting in hot springs. As well as options to allow hot springs anywhere and to disable the steam effect on your hunter. +* Added function to simulate crawling under a passageway anywhere combat controls are active. +* Added orbit player mode. = 3.0 MHWNewCamera_3.0.zip: 11/18/25, sha256-2fb408248bbed3363c2deaa55bc6f7d76b6c261cd62e32001e346dc2219bfa19 -- cgit v1.2.3-101-g0448