Skip to content
This repository was archived by the owner on Jul 7, 2025. It is now read-only.

Commit c7114f0

Browse files
committed
Reduce CSM split distance slightly to hit a balance of quality and distance.
1 parent f661998 commit c7114f0

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

src/dllmain.cpp

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -934,23 +934,25 @@ void Graphics()
934934
}
935935
}
936936

937-
// Post Processing
938-
std::uint8_t* PostProcessingScanResult = Memory::PatternScan(exeModule, "80 ?? ?? FE C5 ?? ?? 48 8B ?? ?? ?? 48 8B ?? ?? ?? 48 8B ?? ?? ?? C5 ?? ?? ?? ?? ?? 48 83 ?? ??");
939-
if (PostProcessingScanResult) {
940-
spdlog::info("Post Processing: Address is {:s}+{:x}", sExeName.c_str(), PostProcessingScanResult - (std::uint8_t*)exeModule);
941-
static SafetyHookMid PostProcessingMidHook{};
942-
PostProcessingMidHook = safetyhook::create_mid(PostProcessingScanResult,
943-
[](SafetyHookContext& ctx) {
944-
SDK::FPostProcessSettings* PP = (SDK::FPostProcessSettings*)ctx.rbx;
937+
if (bAutoVignette || fVignetteStrength != 1.00f) {
938+
// Post Processing
939+
std::uint8_t* PostProcessingScanResult = Memory::PatternScan(exeModule, "80 ?? ?? FE C5 ?? ?? 48 8B ?? ?? ?? 48 8B ?? ?? ?? 48 8B ?? ?? ?? C5 ?? ?? ?? ?? ?? 48 83 ?? ??");
940+
if (PostProcessingScanResult) {
941+
spdlog::info("Post Processing: Address is {:s}+{:x}", sExeName.c_str(), PostProcessingScanResult - (std::uint8_t*)exeModule);
942+
static SafetyHookMid PostProcessingMidHook{};
943+
PostProcessingMidHook = safetyhook::create_mid(PostProcessingScanResult,
944+
[](SafetyHookContext& ctx) {
945+
SDK::FPostProcessSettings* PP = (SDK::FPostProcessSettings*)ctx.rbx;
945946

946-
if (!bAutoVignette && fVignetteStrength != 1.00f)
947-
PP->LensVignetteIntensity = fVignetteStrength;
948-
else if (bAutoVignette && fAspectRatio > fNativeAspect)
949-
PP->LensVignetteIntensity = 1.00f / fAspectMultiplier;
950-
});
951-
}
952-
else {
953-
spdlog::error("Post Processing: Pattern scan failed.");
947+
if (!bAutoVignette && fVignetteStrength != 1.00f)
948+
PP->LensVignetteIntensity = fVignetteStrength;
949+
else if (bAutoVignette && fAspectRatio > fNativeAspect)
950+
PP->LensVignetteIntensity = 1.00f / fAspectMultiplier;
951+
});
952+
}
953+
else {
954+
spdlog::error("Post Processing: Pattern scan failed.");
955+
}
954956
}
955957

956958
if (iShadowResolution != 2048 || bShadowDistTweak) {
@@ -971,9 +973,9 @@ void Graphics()
971973
// Adjust near split
972974
float splitNear = *reinterpret_cast<float*>(&ctx.rax);
973975

974-
// If near split distance is 500, change it to 2000
976+
// If near split distance is 500, change it to 1500
975977
if (splitNear >= 499.00f && splitNear <= 501.00f) {
976-
splitNear = 2000.00f;
978+
splitNear = 1500.00f;
977979
ctx.rax = *reinterpret_cast<uintptr_t*>(&splitNear);
978980
}
979981
}
@@ -986,9 +988,9 @@ void Graphics()
986988
// Adjust mid split
987989
float splitMid = *reinterpret_cast<float*>(&ctx.rax);
988990

989-
// If mid split distance is 5000, change it to 7500
991+
// If mid split distance is 5000, change it to 7000
990992
if (splitMid >= 4999.00f && splitMid <= 5001.00f) {
991-
splitMid = 7500.00f;
993+
splitMid = 7000.00f;
992994
ctx.rax = *reinterpret_cast<uintptr_t*>(&splitMid);
993995
}
994996
}

0 commit comments

Comments
 (0)