diff options
| author | 2026-01-17 16:23:39 -0500 | |
|---|---|---|
| committer | 2026-01-17 16:23:39 -0500 | |
| commit | 0931cc305c8165ec2d4f22448f29f37a4fb33bd0 (patch) | |
| tree | 32c835d18abfcb51ef724ca90efcabb645a1bd70 | |
| parent | 186a83ded716920f89ac97d7e81511bdb665fb9b (diff) | |
| download | NewCamera-0931cc305c8165ec2d4f22448f29f37a4fb33bd0.tar.gz NewCamera-0931cc305c8165ec2d4f22448f29f37a4fb33bd0.tar.bz2 NewCamera-0931cc305c8165ec2d4f22448f29f37a4fb33bd0.zip | |
Cleanup and some test stuff
Signed-off-by: Andrew Opalach <andrew@akon.city>
| -rwxr-xr-x | Config.cs | 7 | ||||
| -rwxr-xr-x | Plugin.cs | 888 |
2 files changed, 606 insertions, 289 deletions
@@ -112,9 +112,9 @@ namespace MHWNewCamera public Dictionary<String, SavedPosition> Positions { get; set; } = new Dictionary<String, SavedPosition>();
public bool TripleShadowResolution { get; set; } = false;
- public float ShadowRangeOffset { get; set; } = 0.5f;
+ public float ShadowRangeOffset { get; set; } = 0.7f;
public bool ApplyShadowRange { get; set; } = false;
- public float ShadowRadiusOffset { get; set; } = 0.0005f;
+ public float ShadowRadiusOffset { get; set; } = -0.0001f;
public bool ApplyShadowRadius { get; set; } = false;
public bool HigherShadowDetailInHoarfrost { get; set; } = false;
public bool SSAOAdjustments { get; set; } = false;
@@ -129,5 +129,8 @@ namespace MHWNewCamera public bool ApplyLODFactors { get; set; } = false;
public bool LargerFoliageSwayRange { get; set; } = false;
public bool DisableReducedRateAnimations { get; set; } = false;
+ public bool DisableVolumetricDownsample { get; set; } = false;
+
+ public bool OverrideViewMode { get; set; } = false;
}
}
@@ -19,16 +19,41 @@ using SharpPluginLoader.Core.Actions; using SharpPluginLoader.Core.Components;
using SharpPluginLoader.Core.Configuration;
+// Tentative List of Actions:
+// - Toggle Free Camera
+// - Exit Free Camera
+// - Unlock Player Movement
+// - Lock Camera Vertical Movement
+// - Apply Speed Modifier
+// - Unlock Input
+// - Toggle UI
+// - Toggle Depth of Field
+// - Toggle Motion Blur
+// - Toggle Reduced Near Clip
+// - Translate Camera
+// - Roll Camera
+// - Reset Roll
+// - Zoom
+// - Reset Zoom
+// - Teleport Player to Camera
+// - Teleport Camera to Player
+// - Crawl
+// - Sit in Hot Springs
+// - Adjust SSAO/General A/B Graphical Tweaks
+// - Freeze Game
+
// @TODO:
+// - Analyze SSAO between character select, character creator, and gameplay.
+// - Underwater camera crashes in The Rotten Vale.
+// - Crash related possibly to shadow change? dx11?
// - Crash leaving gallery?
// - Better name for unknownPtr.
-// - Hook for snow lod bias settings.
-// - hook for "is underwater".
// - Read lod bias setting from in-game value.
// - List out all binds and try to work out better mappings.
// - Layers concept?
// - Attempt to reduce noise in binds table.
// - Make left stick input a curve like Wilds.
+// - Ability to lock camera to a the player/a joint.
// - Option to ignore camera change (update position, test open book and close).
// - Simplify and document input handling/blocking logic.
// - Find a way to block other inputs while button1 is down (and blocked).
@@ -180,6 +205,8 @@ namespace MHWNewCamera private double cameraFrameZ;
private Vector3 cameraPosition;
private Vector3 cameraTarget;
+ private bool freeCameraFallback = false;
+ private bool lastFreeCameraFallback = false;
private double? preDetachFov = null;
private double? preDetachRoll = null;
private bool unlockMovementHeld = false;
@@ -232,6 +259,7 @@ namespace MHWNewCamera private Hook<ProcessCameraDelegate>? checkCameraHook;
private delegate void ViewModeDelegate(nint viewModeObject);
private Hook<ViewModeDelegate>? startViewModeHook;
+ private bool overrideViewMode = false;
/*
private NativeAction<nint> startViewMode;
private NativeAction<nint> stopViewMode;
@@ -296,6 +324,16 @@ namespace MHWNewCamera private Patch shadowRes3;
private Patch shadowRes4_3x;
+ /*
+ private Patch ssrRes1;
+ private Patch ssrRes1_1;
+ private Patch ssrRes2;
+ private Patch ssrRes2_1;
+ private Patch ssrRes3;
+ private Patch ssrRes3_1;
+ private Patch ssrRes4;
+ */
+
private float shadowBiasOffset = 0.0f;
private float shadowRadiusOffset = 0.0f;
private bool applyShadowBias = false;
@@ -326,6 +364,9 @@ namespace MHWNewCamera shadowRes4_3x.Disable();
}
+ private int internalShadowSampleNumHQ; // +0xE5CC
+ //private int shadowSampleNumHQ = 32;
+
private bool ssaoAdjustments = false;
private SSAOParameters internalSSAOParams;
@@ -340,7 +381,8 @@ namespace MHWNewCamera private float prevTerrainLODBias = 0.0f;
private float foliageLODFactor;
private float terrainLODFactor;
- private float snowField4GlobalLODParam = 8.0f; // +0x5718
+ private float internalSnowField4GlobalLODParam; // +0x5718
+ private float snowField4GlobalLODParam = 8.0f;
//private float snowField4AllowTesselationHQ; // +0x5741
//private float snowField4LODBiasHQ; // +0x5748
private bool applyLODFactors;
@@ -370,12 +412,33 @@ namespace MHWNewCamera private bool disableReducedRateAnimations = false;
private Patch zeroFrameSkip;
- private bool enableUnderWaterCamera = false;
+ private bool enableUnderwaterCamera = false;
private Patch underwaterCamera1;
private Patch underwaterCamera2;
private Patch underwaterCamera3;
private Patch underwaterCamera4;
private Patch underwaterCamera5;
+ private delegate void UnderwaterCheckDelegate(nint unknownPtr);
+ private Hook<UnderwaterCheckDelegate>? underwaterCheckHook;
+ private bool cameraIsUnderwater = false;
+
+ private void underwaterCameraEnable()
+ {
+ underwaterCamera1.Enable();
+ underwaterCamera2.Enable();
+ underwaterCamera3.Enable();
+ underwaterCamera4.Enable();
+ underwaterCamera5.Enable();
+ }
+
+ private void underwaterCameraDisable()
+ {
+ underwaterCamera1.Disable();
+ underwaterCamera2.Disable();
+ underwaterCamera3.Disable();
+ underwaterCamera4.Disable();
+ underwaterCamera5.Disable();
+ }
private bool disableVolumeDownsample = false;
private Patch zeroVolumetricDownsample;
@@ -526,6 +589,8 @@ namespace MHWNewCamera disableLODLimits = config.DisableLODLimits;
largerFoliageSwayRange = config.LargerFoliageSwayRange;
disableReducedRateAnimations = config.DisableReducedRateAnimations;
+ disableVolumeDownsample = config.DisableVolumetricDownsample;
+ overrideViewMode = config.OverrideViewMode;
ConfigManager.SaveConfig<Config>(this);
@@ -652,8 +717,8 @@ namespace MHWNewCamera collisionCheckHook = Hook.Create<CollisionCheckDelegate>(0x1411C4E50, CollisionCheckHook);
- //cameraEffectHook = Hook.Create<CameraEffectDelegate>(0x1416D4890, CameraEffectHook);
- cameraEffectHook = Hook.Create<CameraEffectDelegate>(0x141AB6AE0, CameraEffectHook);
+ //cameraEffectHook = Hook.Create<CameraEffectDelegate>(0x1416D4890, CameraEffectHook); // Wiggle directly.
+ cameraEffectHook = Hook.Create<CameraEffectDelegate>(0x141AB6AE0, CameraEffectHook); // Upper function.
unchecked
{
@@ -734,6 +799,24 @@ namespace MHWNewCamera tripleShadowResEnable();
}
+ /*
+ ssrRes1 = new Patch((nint)0x14228894D, [0x0F, 0x85, 0xB9, 0xAA, 0x30, 0x00]);
+ ssrRes1_1 = new Patch((nint)0x14259340C, [0xC6, 0x81, 0x28, 0x02, 0x00, 0x00, 0x00, 0x90, 0x90, 0x90]);
+ ssrRes2 = new Patch((nint)0x14228897D, [0x0F, 0x85, 0x99, 0xAA, 0x30, 0x00]);
+ ssrRes2_1 = new Patch((nint)0x14259341C, [0xC6, 0x81, 0x30, 0x02, 0x00, 0x00, 0x00, 0x90, 0x90, 0x90]);
+ ssrRes3 = new Patch((nint)0x1422889AD, [0x0F, 0x85, 0x79, 0xAA, 0x30, 0x00]);
+ ssrRes3_1 = new Patch((nint)0x14259342C, [0xC6, 0x81, 0x2C, 0x02, 0x00, 0x00, 0x00, 0x90, 0x90, 0x90]);
+ ssrRes4 = new Patch((nint)0x14259268C, [0x41, 0xC7, 0x86, 0x28, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xC7, 0x86, 0x2C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xC7, 0x86, 0x30, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xC7, 0x86, 0x34, 0x02, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0xC7, 0x86, 0x38, 0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x41, 0xC6, 0x86, 0x3C, 0x02, 0x00, 0x00, 0x01]);
+
+ ssrRes1.Enable();
+ ssrRes1_1.Enable();
+ ssrRes2.Enable();
+ ssrRes2_1.Enable();
+ ssrRes3.Enable();
+ ssrRes3_1.Enable();
+ ssrRes4.Enable();
+ */
+
// 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
@@ -780,12 +863,17 @@ namespace MHWNewCamera underwaterCamera3 = new Patch((nint)0x141FA5A7E, [0x90, 0x90]); // Nop check.
underwaterCamera4 = new Patch((nint)0x141FA5BA0, [0x40, 0x84, 0xF6, 0x90, 0x74]); // jae -> je.
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);
zeroVolumetricDownsample = new Patch((nint)0x1424D09B2, [0x31, 0xDB, 0x90, 0x90, 0x90, 0x90, 0x90]);
/*
zeroVolumetricDownsample2 = new Patch((nint)0x1424CE53F, [0xE9, 0x6B, 0x0C, 0x00, 0x00, 0x90]);
zeroVolumetricDownsample3 = new Patch((nint)0x1424CF0D1, [0x90, 0x90, 0x90, 0x90, 0x90]);
*/
+ if (disableVolumeDownsample)
+ {
+ zeroVolumetricDownsample.Enable();
+ }
// Noop collision checks.
addr = PatternScanner.FindFirst(Pattern.FromString("F3 0F 11 06 F3 0F 10 48 04 F3 0F 58 4E 04 F3 0F 11 4E 04 F3 0F 10 40 08 F3 0F 58 46 08 F3 0F 11 46 08 44 8B AF E0 0B 00 00"));
@@ -839,7 +927,6 @@ namespace MHWNewCamera }
}
- // Credit to Otis_Inf.
private bool getDisableFadingObjects(int viewportIndex)
{
Viewport vp = CameraSystem.GetViewport(viewportIndex);
@@ -911,7 +998,7 @@ namespace MHWNewCamera MemoryUtil.WriteBytes(baseAddr + 0x220, BitConverter.GetBytes(prevTerrainLODBias));
MemoryUtil.WriteBytes(baseAddr + 0x224, BitConverter.GetBytes(1.0f));
MemoryUtil.WriteBytes(baseAddr + 0x228, BitConverter.GetBytes(1.0f));
- MemoryUtil.WriteBytes(baseAddr + 0x5718, BitConverter.GetBytes(8.0f));
+ MemoryUtil.WriteBytes(baseAddr + 0x5718, BitConverter.GetBytes(internalSnowField4GlobalLODParam));
}
}
@@ -942,6 +1029,31 @@ namespace MHWNewCamera debugLog($"OnUpdate() @ {frameTick}");
#endif
+ lastFreeCameraFallback = freeCameraFallback;
+ if (freeCameraFallback && vCamera != null)
+ {
+ if (!freeCamera)
+ {
+ Quaternion forward = Quaternion.Normalize(getForward(vCamera.Position, vCamera.Target));
+ cameraYaw = Double.RadiansToDegrees(Math.Atan2(forward.Z, forward.X));
+ cameraPitch = Double.RadiansToDegrees(Math.Asin(forward.Y));
+ if (enableFreeCamera)
+ {
+ setupFreeCamera(vCamera, vCameraViewportIndex);
+ }
+ }
+ if (freeCamera)
+ {
+ updateFreeCamera(vCamera);
+ setCameraRoll(vCamera);
+ if (!enableFreeCamera)
+ {
+ disableFreeCamera();
+ }
+ }
+ }
+ freeCameraFallback = true;
+
#if SIMPLE_KEYBOARD_LAYER
if (keyboardEnabled)
{
@@ -976,6 +1088,9 @@ namespace MHWNewCamera }
#endif
+ //nint baseAddr = MemoryUtil.Read<nint>(0x1451C4368);
+ //MemoryUtil.WriteBytes(baseAddr + 0xB4BC, BitConverter.GetBytes(1.75f));
+
primaryPad = 0x0;
}
@@ -1056,6 +1171,32 @@ namespace MHWNewCamera MemoryUtil.WriteBytes(baseAddr + 0x3E38, BitConverter.GetBytes(target.Z)); // 0.0
}
+ private void setupFreeCamera(Camera camera, int viewportIndex)
+ {
+ freeCamera = true;
+ cameraPosition = camera.Position;
+ cameraTarget = camera.Target;
+ preDetachFov = cameraFov;
+ preDetachRoll = cameraRoll;
+ // The value of cameraFov is effectively a new default and scales accordingly
+ // based on the in-game FOV. Take the calculated FOV here because that's what is
+ // actually shown, which avoids a jump when toggling freecam. This is also why
+ // we don't enable freecam until after applying a offset on this update.
+ cameraFov = camera.FieldOfView;
+ setDisableFadingObjects(viewportIndex, true);
+ setDisableCharacterFade(true);
+ swapMinimapFollowsCamera.Enable();
+ /*
+ //MemoryUtil.WriteBytes(psuedoViewModeObject + 0x10, BitConverter.GetBytes(vCamera.Instance));
+ Player? player = Player.MainPlayer;
+ if (player != null)
+ {
+ MemoryUtil.WriteBytes(psuedoViewModeObject + 0x118, BitConverter.GetBytes(player.Instance));
+ }
+ //startViewMode.Invoke(psuedoViewModeObject);
+ */
+ }
+
private void disableFreeCamera()
{
freeCamera = false;
@@ -1089,9 +1230,9 @@ namespace MHWNewCamera private void updateFreeCamera(Camera camera)
{
- //float deltaTime = camera.DeltaTime;
+ float deltaTime = camera.DeltaTime;
//float deltaTime = 60.0f / MemoryUtil.Read<float>(sMain.Instance + 0x68);
- float deltaTime = MemoryUtil.Read<float>(sMain.Instance + 0x94);
+ //float deltaTime = MemoryUtil.Read<float>(sMain.Instance + 0x94);
bool lockVerticalAndModifySpeed = buttonWasDown(Button.L2) || lockVerticalToggled;
double adjustedSpeed = cameraSpeed * deltaTime * (lockVerticalAndModifySpeed ? cameraSpeedModifier : 1.0f);
@@ -1564,28 +1705,7 @@ namespace MHWNewCamera cameraPitch = Double.RadiansToDegrees(Math.Asin(forward.Y));
if (enableFreeCamera)
{
- freeCamera = true;
- cameraPosition = vCamera.Position;
- cameraTarget = vCamera.Target;
- preDetachFov = cameraFov;
- preDetachRoll = cameraRoll;
- // The value of cameraFov is effectively a new default and scales accordingly
- // based on the in-game FOV. Take the calculated FOV here because that's what is
- // actually shown, which avoids a jump when toggling freecam. This is also why
- // we don't enable freecam until after applying a offset on this update.
- cameraFov = vCamera.FieldOfView;
- setDisableFadingObjects(vCameraViewportIndex, true);
- setDisableCharacterFade(true);
- swapMinimapFollowsCamera.Enable();
- /*
- //MemoryUtil.WriteBytes(psuedoViewModeObject + 0x10, BitConverter.GetBytes(vCamera.Instance));
- Player? player = Player.MainPlayer;
- if (player != null)
- {
- MemoryUtil.WriteBytes(psuedoViewModeObject + 0x118, BitConverter.GetBytes(player.Instance));
- }
- //startViewMode.Invoke(psuedoViewModeObject);
- */
+ setupFreeCamera(vCamera, vCameraViewportIndex);
}
}
// No else if because we want to updateFreeCamera() if freeCamera was enabled above.
@@ -1594,10 +1714,24 @@ namespace MHWNewCamera updateFreeCamera(vCamera);
}
}
+
+ freeCameraFallback = false;
}
private void CheckCameraHook(nint cameraPointer)
{
+ if (disableMod)
+ {
+ checkCameraHook!.Original(cameraPointer);
+ return;
+ }
+
+#if HOOK_ORDER_ASSERTS
+ debugLog($"CheckCameraHook({cameraPointer:x}) @ {frameTick}");
+ Trace.Assert(hookOrder == 1);
+ hookOrder = 2;
+#endif
+
/*
if (vCamera != null && freeCamera)
{
@@ -1614,11 +1748,7 @@ namespace MHWNewCamera cameraPosition.Z = MemoryUtil.Read<float>(psuedoViewModeObject + 0x98);
}
*/
-#if HOOK_ORDER_ASSERTS
- debugLog($"CheckCameraHook({cameraPointer:x}) @ {frameTick}");
- Trace.Assert(hookOrder == 1);
- hookOrder = 2;
-#endif
+
if (!freeCamera)
{
checkCameraHook!.Original(cameraPointer);
@@ -1627,14 +1757,16 @@ namespace MHWNewCamera private void StartViewModeHook(nint viewModeObject)
{
- if (disableMod)
+ if (disableMod || !overrideViewMode)
{
startViewModeHook!.Original(viewModeObject);
return;
}
+
#if HOOK_ORDER_ASSERTS
debugLog($"StartViewMode({viewModeObject:x}) @ {frameTick}");
#endif
+
if (vCamera != null)
{
enableFreeCamera = true;
@@ -1648,15 +1780,19 @@ namespace MHWNewCamera setCameraTentHook!.Original(unknownPtr);
return;
}
+
#if HOOK_ORDER_ASSERTS
// The order of this hook between SetCameraHook() and CalculateCameraHook() is inconsistent.
debugLog($"SetCameraTentHook({unknownPtr:x}) @ {frameTick}");
#endif
+
if (freeCamera && vCamera != null)
{
setTentBasePos(cameraPosition, cameraTarget);
}
+
setCameraTentHook!.Original(unknownPtr);
+
if (freeCamera && vCamera != null)
{
vCamera.Position = cameraPosition;
@@ -1664,6 +1800,8 @@ namespace MHWNewCamera vCamera.FieldOfView = (float)cameraFov;
setCameraRoll(vCamera);
}
+
+ freeCameraFallback = false;
}
private void SetCameraCutsceneHook(nint unknownPtr)
@@ -1673,10 +1811,13 @@ namespace MHWNewCamera setCameraCutsceneHook!.Original(unknownPtr);
return;
}
+
#if HOOK_ORDER_ASSERTS
debugLog($"SetCameraCutsceneHook({unknownPtr:x}) @ {frameTick}");
#endif
+
setCameraCutsceneHook!.Original(unknownPtr);
+
if (freeCamera && vCamera != null)
{
vCamera.Position = cameraPosition;
@@ -1684,12 +1825,15 @@ namespace MHWNewCamera vCamera.FieldOfView = (float)cameraFov;
setCameraRoll(vCamera);
}
+
+ freeCameraFallback = false;
}
/*
private void CalculateViewHook(nint unknownPtr)
{
calculateViewHook!.Original(unknownPtr);
+ if (disableMod) return;
if (vCameraViewportIndex >= 0 && cameraRoll != 0.0f)
{
Viewport vp = CameraSystem.GetViewport(vCameraViewportIndex);
@@ -1705,9 +1849,11 @@ namespace MHWNewCamera shadowCascadeHook!.Original(unknownPtr, unknownPtr2);
return;
}
+
#if HOOK_ORDER_ASSERTS
debugLog($"ShadowCascadeHook({unknownPtr:x}, {unknownPtr2:x}) @ {frameTick}");
#endif
+
nint rax = MemoryUtil.Read<nint>(unknownPtr2 + 0x170);
nint shadowCascadeValue = rax >> 32;
if (shadowCascadeValue != 3)
@@ -1716,6 +1862,7 @@ namespace MHWNewCamera lastShadowBias = MemoryUtil.Read<float>(unknownPtr2 + 0x17C);
lastShadowRadius = MemoryUtil.Read<float>(unknownPtr2 + 0x1EC);
}
+
float biasOverride = lastShadowBias + shadowBiasOffset;
if (lowShadowDetailOverride && shadowCascadeValue == 1)
{
@@ -1724,6 +1871,7 @@ namespace MHWNewCamera biasOverride += shadowBiasOffset;
//biasOverride *= 2.0f;
}
+
if (shadowCascadeValue != 3)
{
if (applyShadowBias)
@@ -1737,6 +1885,13 @@ namespace MHWNewCamera MemoryUtil.WriteBytes(unknownPtr2 + 0x1EC, BitConverter.GetBytes(radiusOverride));
}
}
+
+ if (applyLODFactors) // @HACK
+ {
+ nint baseAddr = MemoryUtil.Read<nint>(0x1451C4368);
+ MemoryUtil.WriteBytes(baseAddr + 0x5718, BitConverter.GetBytes(snowField4GlobalLODParam));
+ }
+
shadowCascadeHook!.Original(unknownPtr, unknownPtr2);
}
@@ -1801,11 +1956,18 @@ namespace MHWNewCamera private void RendererSetHook(nint unknownPtr, nint unknownPtr2, nint unknownPtr3)
{
+ if (disableMod)
+ {
+ rendererSetHook!.Original(unknownPtr, unknownPtr2, unknownPtr3);
+ return;
+ }
bool doSet = MemoryUtil.Read<nint>(unknownPtr + 0x530) == 0x0;
rendererSetHook!.Original(unknownPtr, unknownPtr2, unknownPtr3);
if (doSet)
{
nint baseAddr = MemoryUtil.Read<nint>(0x1451C4368);
+ internalShadowSampleNumHQ = MemoryUtil.Read<int>(baseAddr + 0xE5CC);
+ MemoryUtil.WriteBytes(baseAddr + 0xE5CC, BitConverter.GetBytes(16));
internalSSAOParams.ssaoDepthBias = MemoryUtil.Read<float>(baseAddr + 0xB4B0);
internalSSAOParams.ssaoSlopedDepthBias = MemoryUtil.Read<float>(baseAddr + 0xB4B4);
internalSSAOParams.ssaoMaxDepthBias = MemoryUtil.Read<float>(baseAddr + 0xB4B8);
@@ -1845,6 +2007,7 @@ namespace MHWNewCamera setSSRAdjustements(true);
}
setHQMode(enableHQMode);
+ internalSnowField4GlobalLODParam = MemoryUtil.Read<float>(baseAddr + 0x5718);
if (applyLODFactors)
{
setLODFactors(true);
@@ -2191,49 +2354,79 @@ namespace MHWNewCamera {
return checkMovementHook!.Original(stickValue);
}
+
#if HOOK_ORDER_ASSERTS
debugLog($"CheckMovementHook({stickValue}) @ {frameTick}");
#endif
+
if (freeCamera && !((unlockMovementHeld || unlockMovementToggled) && !unlockMovementPause))
{
stickValue = 0;
}
+
return checkMovementHook!.Original(stickValue);
}
private void CollisionCheckHook(nint unknownPtr, nint unknownPtr2)
{
+ if (disableMod)
+ {
+ collisionCheckHook!.Original(unknownPtr, unknownPtr2);
+ return;
+ }
+
+#if HOOK_ORDER_ASSERTS
+ debugLog($"CollisionCheckHook({unknownPtr:x}, {unknownPtr2:x}) @ {frameTick}");
+#endif
+
Player? player = Player.MainPlayer;
if (enableCrawl && player != null)
{
procEnvironmentCollision.Invoke(player.Instance, psuedoObject1);
procEnvironmentCollision.Invoke(player.Instance, psuedoObject2);
}
+
collisionCheckHook!.Original(unknownPtr, unknownPtr2);
}
- // @TODO: Crashes in rotten vale?
+ private void UnderwaterCheckHook(nint unknownPtr)
+ {
+ underwaterCheckHook!.Original(unknownPtr);
+ if (disableMod) return;
+#if HOOK_ORDER_ASSERTS
+ debugLog($"UnderwaterCheckHook({unknownPtr:x}) @ {frameTick}");
+#endif
+ cameraIsUnderwater = MemoryUtil.Read<byte>(unknownPtr + 0x1E83) == 0x1;
+ }
+
private void CameraEffectHook(nint unknownPtr, nint unknownPtr2, nint unknownPtr3)
{
- nint baseAddr = MemoryUtil.Read<nint>(0x14500E180);
- bool underwater = MemoryUtil.Read<byte>(baseAddr + 0x9F8) == 0x1;
+ if (disableMod)
+ {
+ cameraEffectHook!.Original(unknownPtr, unknownPtr2, unknownPtr3);
+ return;
+ }
+
+#if HOOK_ORDER_ASSERTS
+ debugLog($"CameraEffectHook({unknownPtr:x}, {unknownPtr2:x}, {unknownPtr3:x}) @ {frameTick}");
+#endif
byte[]? underwaterValues = null;
nint targetAddr = 0x0;
- nint addr1 = MemoryUtil.Read<nint>(unknownPtr + 0x550);
+ nint rax = MemoryUtil.Read<nint>(unknownPtr + 0x550);
int index1 = MemoryUtil.Read<int>(unknownPtr + 0xA50);
- nint addr2 = MemoryUtil.Read<nint>(addr1 + (index1 * 0x8));
- if (addr2 != 0x0)
+ rax = MemoryUtil.Read<nint>(rax + (index1 * 0x8));
+ if (rax != 0x0)
{
- nint addr3 = MemoryUtil.Read<nint>(addr2 + 0x188);
- if (addr3 != 0x0)
+ rax = MemoryUtil.Read<nint>(rax + 0x188);
+ if (rax != 0x0)
{
- targetAddr = addr3 + 0x140;
+ targetAddr = rax + 0x140;
}
}
- if (underwater)
+ if (cameraIsUnderwater)
{
underwaterValues = MemoryUtil.ReadArray<byte>(targetAddr + 0x8, 120);
// Straight copy-paste from The Great Forest.
@@ -2242,7 +2435,7 @@ namespace MHWNewCamera cameraEffectHook!.Original(unknownPtr, unknownPtr2, unknownPtr3);
- if (underwater && underwaterValues != null)
+ if (cameraIsUnderwater && underwaterValues != null)
{
MemoryUtil.WriteBytes(targetAddr + 0x8, underwaterValues);
}
@@ -2322,11 +2515,6 @@ namespace MHWNewCamera {
setDisableFadingObjects(i, disableFadingObjects);
}
- if (ImGui.BeginItemTooltip())
- {
- ImGui.Text("Credit to Otis_Inf.");
- ImGui.EndTooltip();
- }
}
if (vp.Camera != null)
{
@@ -2351,7 +2539,13 @@ namespace MHWNewCamera }
if (debug) ImGui.InputFloat("Aspect Ratio", ref camera.AspectRatio);
ImGui.InputFloat("Near Clip", ref camera.NearClip);
- ImGui.InputFloat("Alternate Near Clip", ref alternateNearClip);
+ if (ImGui.DragFloat("Alternate Near Clip", ref alternateNearClip, 0.05f))
+ {
+ if (camera.NearClip != DEFAULT_NEAR_CLIP)
+ {
+ camera.NearClip = alternateNearClip;
+ }
+ }
ImGui.InputFloat("Far Clip", ref camera.FarClip);
if (usedByFreeCamera)
{
@@ -2519,6 +2713,149 @@ namespace MHWNewCamera }
}
+ private void tryToDisableMod(Player? player)
+ {
+ disableAllCollisionHooks();
+ if (freeCamera)
+ {
+ disableFreeCamera();
+ }
+ for (int i = 0; i < 8; i++)
+ {
+ Viewport vp = CameraSystem.GetViewport(i);
+ if (vp.Camera != null)
+ {
+ vp.Camera.Move = true;
+ }
+ setDisableFadingObjects(i, false);
+ }
+ if (player != null)
+ {
+ player.Rotation.X = 0.0f;
+ player.Rotation.Z = 0.0f;
+ }
+ if (tripleShadowRes)
+ {
+ tripleShadowResDisable();
+ }
+ if (ssaoAdjustments)
+ {
+ setSSAOAdjustements(false);
+ }
+ if (ssrAdjustments)
+ {
+ setSSRAdjustements(false);
+ }
+ if (enableHQMode)
+ {
+ setHQMode(false);
+ }
+ if (disableLODLimits)
+ {
+ disableLODLimitsDisable();
+ }
+ if (areLODFactorsSet() && !areLODFactorsDefault())
+ {
+ setLODFactors(false);
+ }
+ if (largerFoliageSwayRange)
+ {
+ addressHigherValueForFoliageSway.Disable();
+ }
+ if (disableReducedRateAnimations)
+ {
+ zeroFrameSkip.Disable();
+ }
+ if (disableVolumeDownsample)
+ {
+ zeroVolumetricDownsample.Disable();
+ }
+ if (disableCharacterFade)
+ {
+ noopCharacterFade.Disable();
+ }
+ if (dofDisabled)
+ {
+ jmpOverDof.Disable();
+ }
+ if (enableUnderwaterCamera)
+ {
+ underwaterCameraDisable();
+ }
+ if (allowHotSpringsAnywhere)
+ {
+ jmpOverHotSpringsEval.Disable();
+ }
+ if (disableHotSpringsSteam)
+ {
+ jmpOverHotSpringsSteam.Disable();
+ }
+ }
+
+ private void tryToEnableMod()
+ {
+ if (tripleShadowRes)
+ {
+ tripleShadowResEnable();
+ }
+ if (ssaoAdjustments)
+ {
+ setSSAOAdjustements(true);
+ }
+ if (ssrAdjustments)
+ {
+ setSSRAdjustements(true);
+ }
+ if (enableHQMode)
+ {
+ setHQMode(true);
+ }
+ if (disableLODLimits)
+ {
+ disableLODLimitsEnable();
+ }
+ if (applyLODFactors && !areLODFactorsDefault())
+ {
+ setLODFactors(true);
+ }
+ if (largerFoliageSwayRange)
+ {
+ addressHigherValueForFoliageSway.Enable();
+ }
+ if (disableReducedRateAnimations)
+ {
+ zeroFrameSkip.Enable();
+ }
+ if (disableVolumeDownsample)
+ {
+ zeroVolumetricDownsample.Enable();
+ }
+ if (pCameraViewportIndex >= 0)
+ {
+ setDisableFadingObjects(pCameraViewportIndex, disableFading);
+ }
+ if (disableCharacterFade)
+ {
+ noopCharacterFade.Enable();
+ }
+ if (dofDisabled)
+ {
+ jmpOverDof.Enable();
+ }
+ if (enableUnderwaterCamera)
+ {
+ underwaterCameraEnable();
+ }
+ if (allowHotSpringsAnywhere)
+ {
+ jmpOverHotSpringsEval.Enable();
+ }
+ if (disableHotSpringsSteam)
+ {
+ jmpOverHotSpringsSteam.Enable();
+ }
+ }
+
public void OnImGuiRender()
{
#if HOOK_ORDER_ASSERTS
@@ -2536,72 +2873,11 @@ namespace MHWNewCamera {
if (disableMod)
{
- disableAllCollisionHooks();
- if (freeCamera)
- {
- disableFreeCamera();
- }
- for (int i = 0; i < 8; i++)
- {
- Viewport vp = CameraSystem.GetViewport(i);
- if (vp.Camera != null)
- {
- vp.Camera.Move = true;
- }
- setDisableFadingObjects(i, false);
- }
- if (player != null)
- {
- player.Rotation.X = 0.0f;
- player.Rotation.Z = 0.0f;
- }
- if (areLODFactorsSet() && !areLODFactorsDefault())
- {
- setLODFactors(false);
- }
- if (tripleShadowRes)
- {
- tripleShadowResDisable();
- }
- if (disableLODLimits)
- {
- disableLODLimitsDisable();
- }
- if (largerFoliageSwayRange)
- {
- addressHigherValueForFoliageSway.Disable();
- }
- if (disableCharacterFade)
- {
- noopCharacterFade.Disable();
- }
+ tryToDisableMod(player);
}
else
{
- if (applyLODFactors && !areLODFactorsDefault())
- {
- setLODFactors(true);
- }
- if (tripleShadowRes)
- {
- tripleShadowResEnable();
- }
- if (disableLODLimits)
- {
- disableLODLimitsEnable();
- }
- if (largerFoliageSwayRange)
- {
- addressHigherValueForFoliageSway.Enable();
- }
- if (pCameraViewportIndex >= 0)
- {
- setDisableFadingObjects(pCameraViewportIndex, disableFading);
- }
- if (disableCharacterFade)
- {
- noopCharacterFade.Enable();
- }
+ tryToEnableMod();
}
config.DisableMod = disableMod;
ConfigManager.SaveConfig<Config>(this);
@@ -2666,7 +2942,7 @@ namespace MHWNewCamera }
if (ImGui.BeginItemTooltip())
{
- ImGui.Text("Disable transparency fading when the camera gets close to something.\nApplies to Objects, Players, Palicos and NPCs. Credit to Otis_Inf for Objects.\nEnabled by default while in free camera.");
+ ImGui.Text("Disable transparency fading when the camera gets close to something.\nApplies to Objects, Players, Palicos and NPCs.\nEnabled by default while in free camera.");
ImGui.EndTooltip();
}
if (freeCamera)
@@ -2768,7 +3044,7 @@ namespace MHWNewCamera ImGui.Text("Value to multiply speed by when LT is held.");
ImGui.EndTooltip();
}
- ImGui.DragFloat("Camera Sensitivity", ref cameraSensitivity, 0.0025f, 0.0f);
+ ImGui.DragFloat("Camera Sensitivity", ref cameraSensitivity, 0.001f, 0.0f);
if (ImGui.BeginItemTooltip())
{
ImGui.Text("Look sensitivity in free camera.");
@@ -2786,7 +3062,7 @@ namespace MHWNewCamera }
if (ImGui.BeginItemTooltip())
{
- ImGui.Text("-1.0 = Wrap around (go upside down).");
+ ImGui.Text($"-1.0 = Wrap around (go upside down), Max: {Config.Settings.MAX_PITCH_LIMIT:0.00}.");
ImGui.EndTooltip();
}
ImGui.DragInt("Stick Deadzone", ref stickDeadzone, 5, 0);
@@ -2885,7 +3161,7 @@ namespace MHWNewCamera }
if (ImGui.BeginItemTooltip())
{
- ImGui.Text("Hold Select + Press B. Works to disable depth of field in cutscenes. Credit to Otis_Inf.");
+ ImGui.Text("Hold Select + Press B. Works to disable depth of field in cutscenes.");
ImGui.EndTooltip();
}
if (vCamera != null)
@@ -2913,6 +3189,11 @@ namespace MHWNewCamera ImGui.Separator();
ImGui.Text("When Close to the Camera");
+ if (ImGui.BeginItemTooltip())
+ {
+ ImGui.Text("These are temporary to being in free camera. Set \"Disable Fading\" in the camera settings above for them to persist.");
+ ImGui.EndTooltip();
+ }
if (vCameraViewportIndex >= 0)
{
bool disableFadingObjects = getDisableFadingObjects(vCameraViewportIndex);
@@ -3124,15 +3405,15 @@ namespace MHWNewCamera ImGui.TableNextRow();
ImGui.TableSetColumnIndex(0);
- ImGui.Text("Num 8/2/4/6");
+ ImGui.Text("Arrow Up/Down/Left/Right");
ImGui.TableSetColumnIndex(1);
- ImGui.Text("Look");
+ ImGui.Text("Move Camera");
ImGui.TableNextRow();
ImGui.TableSetColumnIndex(0);
- ImGui.Text("Arrow Up/Down/Left/Right");
+ ImGui.Text("Num 8/2/4/6");
ImGui.TableSetColumnIndex(1);
- ImGui.Text("Move Camera");
+ ImGui.Text("Look");
ImGui.TableNextRow();
ImGui.TableSetColumnIndex(0);
@@ -3176,6 +3457,49 @@ namespace MHWNewCamera ImGui.PopID();
#endif
+ ImGui.PushID("World");
+ if (ImGui.CollapsingHeader("World"))
+ {
+ nint timeAddr = MemoryUtil.Read<nint>(sMain.Instance + 0xAF878);
+ float gameTime = MemoryUtil.Read<float>(timeAddr + 0x38);
+ if (ImGui.SliderFloat("Time of Day", ref gameTime, 0.0f, 24.0f))
+ {
+ MemoryUtil.WriteBytes(timeAddr + 0x38, BitConverter.GetBytes(gameTime));
+ }
+ float gameSpeed = MemoryUtil.Read<float>(sMain.Instance + 0xA4);
+ if (ImGui.InputFloat("Game Speed", ref gameSpeed, 0.0f, 0.0f, null, ImGuiInputTextFlags.EnterReturnsTrue))
+ {
+ MemoryUtil.WriteBytes(sMain.Instance + 0xA4, BitConverter.GetBytes(gameSpeed));
+ }
+ if (ImGui.Checkbox("Override View Mode", ref overrideViewMode))
+ {
+ config.OverrideViewMode = overrideViewMode;
+ ConfigManager.SaveConfig<Config>(this);
+ }
+ if (ImGui.BeginItemTooltip())
+ {
+ ImGui.Text("Replace in-game \"View Mode\" with the free camera from this mod.");
+ ImGui.EndTooltip();
+ }
+ if (ImGui.Checkbox("Underwater Camera", ref enableUnderwaterCamera))
+ {
+ if (enableUnderwaterCamera)
+ {
+ underwaterCameraEnable();
+ }
+ else
+ {
+ underwaterCameraDisable();
+ }
+ }
+ if (ImGui.BeginItemTooltip())
+ {
+ ImGui.Text("Trigger underwater screen filter when the camera goes underwater.");
+ ImGui.EndTooltip();
+ }
+ }
+ ImGui.PopID();
+
ImGui.PushID("Player");
if (ImGui.CollapsingHeader("Player") && player != null)
{
@@ -3419,6 +3743,11 @@ namespace MHWNewCamera jmpOverHotSpringsSteam.Disable();
}
}
+ if (ImGui.BeginItemTooltip())
+ {
+ ImGui.Text("It will take a couple seconds to fade away.");
+ ImGui.EndTooltip();
+ }
}
ImGui.PopID();
@@ -3430,7 +3759,7 @@ namespace MHWNewCamera ImGui.PopID();
ImGui.PushID("Graphics");
- if (ImGui.CollapsingHeader("Graphical Enhancements"))
+ if (ImGui.CollapsingHeader("Graphical Tweaks"))
{
if (ImGui.Checkbox("3x Shadow Resolution (Requires Reload)", ref tripleShadowRes))
{
@@ -3465,7 +3794,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.5.");
+ 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.7.");
ImGui.EndTooltip();
}
if (ImGui.Checkbox("##Apply Radius", ref applyShadowRadius))
@@ -3481,7 +3810,7 @@ namespace MHWNewCamera }
if (ImGui.BeginItemTooltip())
{
- ImGui.Text("Amount of softening for realtime shadows.\nValue is an offset. Recommended: 0.0005.");
+ ImGui.Text("Size of a shadows border (to be softened if HQ Mode is enabled).\nValue is an offset. Recommended: -0.0001.");
ImGui.EndTooltip();
}
ImGui.PopItemWidth();
@@ -3594,11 +3923,6 @@ namespace MHWNewCamera ImGui.PopItemFlag();
ImGui.PopStyleVar();
}
- if (ImGui.BeginItemTooltip())
- {
- ImGui.Text("Credit to Otis_Inf.");
- ImGui.EndTooltip();
- }
if (ImGui.Checkbox("Larger Foliage Sway Range", ref largerFoliageSwayRange))
{
@@ -3638,31 +3962,6 @@ namespace MHWNewCamera ImGui.EndTooltip();
}
- if (ImGui.Checkbox("Underwater Camera", ref enableUnderWaterCamera))
- {
- if (enableUnderWaterCamera)
- {
- underwaterCamera1.Enable();
- underwaterCamera2.Enable();
- underwaterCamera3.Enable();
- underwaterCamera4.Enable();
- underwaterCamera5.Enable();
- }
- else
- {
- underwaterCamera1.Disable();
- underwaterCamera2.Disable();
- underwaterCamera3.Disable();
- underwaterCamera4.Disable();
- underwaterCamera5.Disable();
- }
- }
- if (ImGui.BeginItemTooltip())
- {
- ImGui.Text("Trigger underwater screen filter when the camera goes underwater.");
- ImGui.EndTooltip();
- }
-
if (ImGui.Checkbox("Disable Volumetric Downsample and Blur", ref disableVolumeDownsample))
{
if (disableVolumeDownsample)
@@ -3673,6 +3972,8 @@ namespace MHWNewCamera {
zeroVolumetricDownsample.Disable();
}
+ config.DisableVolumetricDownsample = disableVolumeDownsample;
+ ConfigManager.SaveConfig<Config>(this);
}
if (ImGui.BeginItemTooltip())
{
@@ -3685,87 +3986,126 @@ namespace MHWNewCamera ImGui.PushID("Debug");
if (ImGui.CollapsingHeader("DEBUG"))
{
- float gameSpeed = MemoryUtil.Read<float>(sMain.Instance + 0xA4);
- if (ImGui.InputFloat("Game Speed", ref gameSpeed, 0.0f, 0.0f, null, ImGuiInputTextFlags.EnterReturnsTrue))
- {
- MemoryUtil.WriteBytes(sMain.Instance + 0xA4, BitConverter.GetBytes(gameSpeed));
- }
+ ImGui.Text("Graphics:");
+
ImGui.Text($"Fps: {MemoryUtil.Read<float>(sMain.Instance + 0x58)}");
ImGui.Text($"Max Fps: {MemoryUtil.Read<float>(sMain.Instance + 0x5C)}");
ImGui.Text($"Actual Fps: {MemoryUtil.Read<float>(sMain.Instance + 0x64)}");
ImGui.Text($"Real Fps: {MemoryUtil.Read<float>(sMain.Instance + 0x68)}");
- ImGui.Text($"Delta Time Adjust: {MemoryUtil.Read<float>(sMain.Instance + 0x92)}");
+ ImGui.Text($"Delta Time Adjust: {MemoryUtil.Read<byte>(sMain.Instance + 0x92) == 0x1}");
ImGui.Text($"Delta Time: {MemoryUtil.Read<float>(sMain.Instance + 0x94)}");
- ImGui.Text($"Delta Time Border: {MemoryUtil.Read<float>(sMain.Instance + 0x98)}");
- ImGui.Text($"Delta Time Limit: {MemoryUtil.Read<float>(sMain.Instance + 0x9C)}");
+ //ImGui.Text($"Delta Time Border: {MemoryUtil.Read<float>(sMain.Instance + 0x98)}");
+ //ImGui.Text($"Delta Time Limit: {MemoryUtil.Read<float>(sMain.Instance + 0x9C)}");
ImGui.Text($"Delta Sec: {MemoryUtil.Read<float>(sMain.Instance + 0xA0)}");
- nint timeAddr = MemoryUtil.Read<nint>(sMain.Instance + 0xAF878);
- float gameTime = MemoryUtil.Read<float>(timeAddr + 0x38);
- if (ImGui.SliderFloat("Game Time", ref gameTime, 0.0f, 24.0f))
- {
- MemoryUtil.WriteBytes(timeAddr + 0x38, BitConverter.GetBytes(gameTime));
- }
- /*
- if (ImGui.InputFloat("Game Time", ref gameTime, 0.0f, 0.0f, null, ImGuiInputTextFlags.EnterReturnsTrue))
+ ImGui.Text($"prevFoliageLODBias: {prevFoliageLODBias}");
+ ImGui.Text($"prevTerrainLODBias: {prevTerrainLODBias}");
+ ImGui.Text($"shadowCascadeValue: {lastShadowCascadeValue}");
+ ImGui.Text($"shadowBias: {lastShadowBias}");
+ ImGui.Text($"shadowRadius: {lastShadowRadius}");
+
+ if (ImGui.CollapsingHeader("Renderer Parameters"))
{
- MemoryUtil.WriteBytes(timeAddr + 0x38, BitConverter.GetBytes(gameTime));
+ nint baseAddr = MemoryUtil.Read<nint>(0x1451C4368);
+ ImGui.Text($"Address: {baseAddr:x}");
+ ImGui.PushItemWidth(width * 0.2f);
+ drawRenderParameter<int>("Primary Shadow Sample Num", baseAddr, 0xE5C4);
+ drawRenderParameter<int>("Primary Shadow Sample Num HQ", baseAddr, 0xE5CC);
+ drawRenderParameter<byte>("Primary Shadow HQ", baseAddr, 0xE5C0);
+ if (ImGui.BeginItemTooltip())
+ {
+ ImGui.Text("This seems to refer to softening the edges of shadows.");
+ ImGui.EndTooltip();
+ }
+ drawRenderParameter<byte>("Primary Shadow HQ HQ", baseAddr, 0xE5C2);
+ drawRenderParameter<float>("LOD Length Bias HQ", baseAddr, 0x1FC);
+ drawRenderParameter<float>("LOD Pixel Size Bias HQ", baseAddr, 0x1FC);
+ drawRenderParameter<float>("SSAO Depth Bias", baseAddr, 0xB4B0);
+ drawRenderParameter<float>("SSAO Sloped Depth Bias", baseAddr, 0xB4B4);
+ drawRenderParameter<float>("SSAO Max Depth Bias", baseAddr, 0xB4B8);
+ drawRenderParameter<float>("SSAO Dispersion", baseAddr, 0xB4BC);
+ drawRenderParameter<float>("SSAO Effect", baseAddr, 0xB430);
+ drawRenderParameter<float>("SSAO Effect GI", baseAddr, 0xB434);
+ drawRenderParameter<float>("SSAO Depth Difference", baseAddr, 0xB4C0);
+ drawRenderParameter<float>("SSAO Samples Per Pixel", baseAddr, 0xB4C4);
+ drawRenderParameter<int>("SSAO Max Sample Num", baseAddr, 0xB4C8);
+ drawRenderParameter<int>("SSAO Max Sample Num HQ", baseAddr, 0xB4D0);
+ drawRenderParameter<float>("SSAO Radius", baseAddr, 0xB4D4);
+ drawRenderParameter<float>("SSAO Bias", baseAddr, 0xB4D8);
+ drawRenderParameter<float>("SSAO Intensity", baseAddr, 0xB4E0);
+ drawRenderParameter<byte>("SSAO Use HiZ", baseAddr, 0xB4E5);
+ drawRenderParameter<float>("SSAO Edge Atten Rate", baseAddr, 0xB4DC);
+ drawRenderParameter<int>("SSLR Loop Count", baseAddr, 0xE628);
+ drawRenderParameter<float>("SSLR Loop Count Factor For CBR", baseAddr, 0xE62C);
+ drawRenderParameter<float>("SSLR Eliminate Depth", baseAddr, 0xE630);
+ drawRenderParameter<float>("SSLR Accurate Threshold", baseAddr, 0xE644);
+ drawRenderParameter<float>("SSLR Accurate Threshold HQ", baseAddr, 0xE64C);
+ drawRenderParameter<float>("SSLR Dither Radius", baseAddr, 0xE634);
+ drawRenderParameter<float>("SSLR Importance Bias", baseAddr, 0xE638);
+ drawRenderParameter<float>("SSLR Mip Scale", baseAddr, 0xE63C);
+ drawRenderParameter<float>("SSLR Mip Bias", baseAddr, 0xE640);
+ drawRenderParameter<byte>("SSLR Dither Resolve", baseAddr, 0xB43F);
+ drawRenderParameter<float>("SSLR Edge Atten Rate", baseAddr, 0xB428);
+ drawRenderParameter<int>("SSLR Mip 0 Count Threshold", baseAddr, 0xB438);
+ drawRenderParameter<float>("SSLR Depth Eliminate Rate", baseAddr, 0xB42C);
+ drawRenderParameter<byte>("SSLR Use Mipmap", baseAddr, 0xE650);
+ drawRenderParameter<byte>("SSLR GBuffer Jitter", baseAddr, 0xB440);
+ /*
+ drawRenderParameter<float>("Checkerboard Alpha Unroll Near", baseAddr, 0xE964);
+ drawRenderParameter<float>("Checkerboard Alpha Unroll Far", baseAddr, 0xE968);
+ drawRenderParameter<float>("Checkerboard History Blend Rate", baseAddr, 0xE96C);
+ drawRenderParameter<byte>("Checkerboard Sanitize Color", baseAddr, 0xE972);
+ drawRenderParameter<byte>("Checkerboard Blend Dither", baseAddr, 0xE973);
+ drawRenderParameter<float>("Checkerboard BBox Strength", baseAddr, 0xE974);
+ drawRenderParameter<float>("Checkerboard Dither Passthru Weight", baseAddr, 0xE978);
+ drawRenderParameter<float>("Checkerboard Dither Filtered Weight", baseAddr, 0xE97C);
+ drawRenderParameter<byte>("Checkerboard Continous History Reset", baseAddr, 0xE971);
+ */
+ ImGui.PopItemWidth();
}
- */
- if (pCamera != null)
+ ImGui.Separator();
+
+ if (vCamera != null || pCamera != null)
{
- //ImGui.Text($"viewModeObject: {psuedoViewModeObject:x}");
- ImGui.Text("Perspective Camera");
- ImGui.Text($"Player Camera: {pCamera.Instance:x}");
- ImGui.Text($"Applying Offset: {applyPerspective}");
- ImGui.Text($"previousCameraAnimState: {previousCameraAnimState}");
- ImGui.DragFloat("X Offset", ref cameraXOffset, 0.425f);
- ImGui.DragFloat("Y Offset", ref cameraYOffset, 0.425f);
- ImGui.DragFloat("Z Offset", ref cameraZOffset, 0.425f);
+ ImGui.Text("Camera:");
+ if (vCamera != null)
+ {
+ ImGui.Text($"Visible Camera: {vCamera.Instance:x}");
+ ImGui.Text($"freeCameraFallback: {lastFreeCameraFallback}");
+ //ImGui.Text($"viewModeObject: {psuedoViewModeObject:x}");
+ }
+ if (pCamera != null)
+ {
+ ImGui.Text($"Player Camera: {pCamera.Instance:x}");
+ ImGui.Text($"Applying Offset: {applyPerspective}");
+ ImGui.Text($"previousCameraAnimState: {previousCameraAnimState}");
+ ImGui.DragFloat("X Offset", ref cameraXOffset, 0.425f);
+ ImGui.DragFloat("Y Offset", ref cameraYOffset, 0.425f);
+ ImGui.DragFloat("Z Offset", ref cameraZOffset, 0.425f);
+ }
ImGui.Separator();
}
- if (ImGui.CollapsingHeader("Monsters"))
+ ImGui.PushID("Viewports");
+ ImGui.Text("Viewports:");
+ for (int i = 0; i < 8; i++)
{
- Monster[] monsters = Monster.GetAllMonsters();
- foreach (Monster monster in monsters)
+ ImGui.PushID($"Viewport{i}");
+ if (ImGui.CollapsingHeader($"Viewport #{i} ({((i == vCameraViewportIndex) ? "visible" : "inactive")})"))
{
- ImGui.PushID(monster.Instance);
- ImGui.Text($"{monster.Name}: Instance: {monster.Instance:x}");
- if (monster.AnimationLayer != null)
- {
- ImGui.Text($" AnimationLayer: {monster.AnimationLayer.Instance:x}");
- }
- ActionInfo currentActionInfo = monster.ActionController.CurrentAction;
- SharpPluginLoader.Core.Actions.Action? currentAction = null;
- if (currentActionInfo.ActionSet >= 0 && currentActionInfo.ActionSet <= 3)
- {
- ActionList actionList = monster.ActionController.GetActionList(currentActionInfo.ActionSet);
- if (currentActionInfo.ActionId >= 0 && currentActionInfo.ActionId < actionList.Count)
- {
- currentAction = actionList[currentActionInfo.ActionId];
- }
- }
- if (currentAction != null)
- {
- ImGui.Text($" Action: {currentAction.Instance:x}, Flags: {currentAction.Flags:x}");
- ImGui.Text($" Active Time: {currentAction.ActiveTime}");
- ImGui.Text($" Delta Sec: {currentAction.DeltaSec}");
- }
- ImGui.DragFloat3("Position", ref monster.Position, 0.5f);
- if (player != null)
- {
- ImGui.DragFloat3("Player Reference", ref player.Position, 0.5f);
- }
- ImGui.PopID();
+ drawViewportInfo(i, width, config, true);
}
+ ImGui.PopID();
}
+ ImGui.PopID();
+
+ ImGui.Separator();
if (player != null)
{
ImGui.PushID("Player");
- ImGui.Text("Player");
+ ImGui.Text("Player:");
ImGui.Text($"Pointer: {player.Instance:x}");
ImGui.Text($"ActionController: {player.ActionController.Instance:x}");
@@ -3818,81 +4158,46 @@ namespace MHWNewCamera ImGui.Separator();
}
- ImGui.PushID("Viewports");
- ImGui.Text("Viewports");
- for (int i = 0; i < 8; i++)
+ /*
+ if (ImGui.CollapsingHeader("Monsters"))
{
- ImGui.PushID($"Viewport{i}");
- if (ImGui.CollapsingHeader($"Viewport #{i} ({((i == vCameraViewportIndex) ? "visible" : "inactive")})"))
+ Monster[] monsters = Monster.GetAllMonsters();
+ foreach (Monster monster in monsters)
{
- drawViewportInfo(i, width, config, true);
+ ImGui.PushID(monster.Instance);
+ ImGui.Text($"{monster.Name}: Instance: {monster.Instance:x}");
+ if (monster.AnimationLayer != null)
+ {
+ ImGui.Text($" AnimationLayer: {monster.AnimationLayer.Instance:x}");
+ }
+ ActionInfo currentActionInfo = monster.ActionController.CurrentAction;
+ SharpPluginLoader.Core.Actions.Action? currentAction = null;
+ if (currentActionInfo.ActionSet >= 0 && currentActionInfo.ActionSet <= 3)
+ {
+ ActionList actionList = monster.ActionController.GetActionList(currentActionInfo.ActionSet);
+ if (currentActionInfo.ActionId >= 0 && currentActionInfo.ActionId < actionList.Count)
+ {
+ currentAction = actionList[currentActionInfo.ActionId];
+ }
+ }
+ if (currentAction != null)
+ {
+ ImGui.Text($" Action: {currentAction.Instance:x}, Flags: {currentAction.Flags:x}");
+ ImGui.Text($" Active Time: {currentAction.ActiveTime}");
+ ImGui.Text($" Delta Sec: {currentAction.DeltaSec}");
+ }
+ ImGui.DragFloat3("Position", ref monster.Position, 0.5f);
+ if (player != null)
+ {
+ ImGui.DragFloat3("Player Reference", ref player.Position, 0.5f);
+ }
+ ImGui.PopID();
}
- ImGui.PopID();
}
- ImGui.PopID();
-
- ImGui.Separator();
-
- ImGui.Text("Graphics");
- ImGui.Text($"prevFoliageLODBias: {prevFoliageLODBias}");
- ImGui.Text($"prevTerrainLODBias: {prevTerrainLODBias}");
- ImGui.Text($"shadowCascadeValue: {lastShadowCascadeValue}");
- ImGui.Text($"shadowBias: {lastShadowBias}");
- ImGui.Text($"shadowRadius: {lastShadowRadius}");
-
- if (ImGui.CollapsingHeader("Renderer Parameters"))
- {
- nint baseAddr = MemoryUtil.Read<nint>(0x1451C4368);
- ImGui.Text($"Address: {baseAddr:x}");
- ImGui.PushItemWidth(width * 0.2f);
- drawRenderParameter<float>("SSAO Depth Bias", baseAddr, 0xB4B0);
- drawRenderParameter<float>("SSAO Sloped Depth Bias", baseAddr, 0xB4B4);
- drawRenderParameter<float>("SSAO Max Depth Bias", baseAddr, 0xB4B8);
- drawRenderParameter<float>("SSAO Dispersion", baseAddr, 0xB4BC);
- drawRenderParameter<float>("SSAO Effect", baseAddr, 0xB430);
- drawRenderParameter<float>("SSAO Effect GI", baseAddr, 0xB434);
- drawRenderParameter<float>("SSAO Depth Difference", baseAddr, 0xB4C0);
- drawRenderParameter<float>("SSAO Samples Per Pixel", baseAddr, 0xB4C4);
- drawRenderParameter<int>("SSAO Max Sample Num", baseAddr, 0xB4C8);
- drawRenderParameter<int>("SSAO Max Sample Num HQ", baseAddr, 0xB4D0);
- drawRenderParameter<float>("SSAO Radius", baseAddr, 0xB4D4);
- drawRenderParameter<float>("SSAO Bias", baseAddr, 0xB4D8);
- drawRenderParameter<float>("SSAO Intensity", baseAddr, 0xB4E0);
- drawRenderParameter<byte>("SSAO Use HiZ", baseAddr, 0xB4E5);
- drawRenderParameter<float>("SSAO Edge Atten Rate", baseAddr, 0xB4DC);
- drawRenderParameter<int>("SSLR Loop Count", baseAddr, 0xE628);
- drawRenderParameter<float>("SSLR Loop Count Factor For CBR", baseAddr, 0xE62C);
- drawRenderParameter<float>("SSLR Eliminate Depth", baseAddr, 0xE630);
- drawRenderParameter<float>("SSLR Accurate Threshold", baseAddr, 0xE644);
- drawRenderParameter<float>("SSLR Accurate Threshold HQ", baseAddr, 0xE64C);
- drawRenderParameter<float>("SSLR Dither Radius", baseAddr, 0xE634);
- drawRenderParameter<float>("SSLR Importance Bias", baseAddr, 0xE638);
- drawRenderParameter<float>("SSLR Mip Scale", baseAddr, 0xE63C);
- drawRenderParameter<float>("SSLR Mip Bias", baseAddr, 0xE640);
- drawRenderParameter<byte>("SSLR Dither Resolve", baseAddr, 0xB43F);
- drawRenderParameter<float>("SSLR Edge Atten Rate", baseAddr, 0xB428);
- drawRenderParameter<int>("SSLR Mip 0 Count Threshold", baseAddr, 0xB438);
- drawRenderParameter<float>("SSLR Depth Eliminate Rate", baseAddr, 0xB42C);
- drawRenderParameter<byte>("SSLR Use Mipmap", baseAddr, 0xE650);
- drawRenderParameter<byte>("SSLR GBuffer Jitter", baseAddr, 0xB440);
- /*
- drawRenderParameter<float>("Checkerboard Alpha Unroll Near", baseAddr, 0xE964);
- drawRenderParameter<float>("Checkerboard Alpha Unroll Far", baseAddr, 0xE968);
- drawRenderParameter<float>("Checkerboard History Blend Rate", baseAddr, 0xE96C);
- drawRenderParameter<byte>("Checkerboard Sanitize Color", baseAddr, 0xE972);
- drawRenderParameter<byte>("Checkerboard Blend Dither", baseAddr, 0xE973);
- drawRenderParameter<float>("Checkerboard BBox Strength", baseAddr, 0xE974);
- drawRenderParameter<float>("Checkerboard Dither Passthru Weight", baseAddr, 0xE978);
- drawRenderParameter<float>("Checkerboard Dither Filtered Weight", baseAddr, 0xE97C);
- drawRenderParameter<byte>("Checkerboard Continous History Reset", baseAddr, 0xE971);
- */
- ImGui.PopItemWidth();
- }
-
- ImGui.Separator();
+ */
ImGui.PushID("Pad");
- ImGui.Text("Pad");
+ ImGui.Text("Pad:");
ImGui.Text($"Pointer: {controllerAddr():x}");
int PadRx = MemoryUtil.Read<int>(controllerAddr() + 0x1B0);
int PadRy = MemoryUtil.Read<int>(controllerAddr() + 0x1B4);
@@ -3913,6 +4218,15 @@ namespace MHWNewCamera ImGui.PopID();
}
ImGui.PopID();
+
+ ImGui.PushID("Credits");
+ if (ImGui.CollapsingHeader("Credits"))
+ {
+ ImGui.Text("SharpPluginLoader Authors: Framework for this mod and reference for various memory locations.");
+ ImGui.Text("Otis_Inf: Initial LOD and object fading adjustment locations. As well as time of day and game speed.");
+ ImGui.Text("MonsterHunterWorldModding/wiki Authors.");
+ }
+ ImGui.PopID();
}
}
}
|