Skip to content

Commit

Permalink
blacklist: add shadow distance tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Jul 18, 2024
1 parent e2de293 commit 470d145
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ DisableNegativeMouseAcceleration = 1
UltraWideSupport = 1 // Damage overlay and fading will be disabled in ultrawide
FOVFactor = 1.0 // [0.5, 2.5]
ScreenCullBias = 0.0 // 0.0 achieves the best draw distance, game default value is 1.0, but it makes distant objects disappear
ShadowCullDist = 110.0 // 110.0 for increased draw distance of shadows, game default value is 90.0

[UNLOCKS]
UnlockDLC = 1 // Unlocks all DLC content that is not possible to obtain after server shutdown
Expand Down
5 changes: 5 additions & 0 deletions source/SplinterCellBlacklist.FusionMod/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ void Init()
auto bUltraWideSupport = iniReader.ReadInteger("MAIN", "UltraWideSupport", 1) != 0;
static auto fFOVFactor = std::clamp(iniReader.ReadFloat("MAIN", "FOVFactor", 1.0f), 0.5f, 2.5f);
fScreenCullBias = std::clamp(iniReader.ReadFloat("MAIN", "ScreenCullBias", 0.0f), 0.0f, 1.0f);
static float fShadowCullDist = std::clamp(iniReader.ReadFloat("MAIN", "ShadowCullDist", 110.0f), 90.0f, 120.0f);

sExtractionWaveConfigs = iniReader.ReadString("EXTRACTION", "ExtractionWaveConfigs", "Default");
nExtractionWaveEnemyMultiplier = std::clamp(iniReader.ReadInteger("EXTRACTION", "ExtractionWaveEnemyMultiplier", 1), 1, 9999);
Expand Down Expand Up @@ -768,6 +769,10 @@ void Init()
pattern = hook::pattern("55 8B EC E8 ? ? ? ? 8B C8 E8 ? ? ? ? 80 7D 08 00");
l3d::GetResource = (l3d::LeadOptions*(*)())injector::GetBranchDestination(pattern.get_first(3), true).as_int();
shTriggerScreenCullBias = safetyhook::create_inline(pattern.get_first(), TriggerScreenCullBias);

// Shadow Cull
pattern = hook::pattern("F3 0F 10 0D ? ? ? ? F3 0F 11 85 ? ? ? ? 66 0F 6E 81");
injector::WriteMemory(pattern.get_first(4), &fShadowCullDist, true);
}

if (bToggleRadarHotkey && false)
Expand Down

3 comments on commit 470d145

@Keith94
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the range?

@ThirteenAG
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

90.0f, 120.0f

It's not really a distance, but it improves culling from what I can tell, with a small impact on quality.

Splinter Cell  Blacklist Screenshot 2024 07 19 - 01 42 34 31

Splinter Cell  Blacklist Screenshot 2024 07 19 - 01 42 38 61

@Keith94
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely missed that. Nice find!

Please sign in to comment.