diff options
Diffstat (limited to 'Plugin.cs')
| -rwxr-xr-x | Plugin.cs | 67 |
1 files changed, 47 insertions, 20 deletions
@@ -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<Config>(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<UnderwaterCheckDelegate>(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<CreateLightingObject>(0x1424CE130, CreateLightingObjectHook); // nint
destroyLightingObject = Hook.Create<DestroyLightingObject>(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<byte>(shaderData, 0);
+ info->NewSource = (byte *)Marshal.UnsafeAddrOfPinnedArrayElement<byte>(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<byte>(shaderData, 0);
+ info->NewSource = (byte *)Marshal.UnsafeAddrOfPinnedArrayElement<byte>(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<Config>(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<Config>(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<Config>(this);
}
@@ -4814,6 +4832,10 @@ namespace MHWNewCamera {
value2ForVolumeQuality.Disable();
}
+ Config.GraphicalTweaks graphics = config.Graphics;
+ graphics.HigherThanHighestVolumeRendering = higherVolumeQuality;
+ config.Graphics = graphics;
+ ConfigManager.SaveConfig<Config>(this);
}
if (ImGui.BeginItemTooltip())
{
@@ -4958,12 +4980,17 @@ namespace MHWNewCamera nint obj = MemoryUtil.Read<nint>(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}");
|