Skip to content

Commit 12a23ee

Browse files
authored
Add a game option to tweak the rendering distance for shadows (#6763)
1 parent a1ec9de commit 12a23ee

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- (#6763) Introduce a new slider to adjust the rendering distance of shadows
2+
3+
Strogo made the observation that the extensive (default) rendering distance of shadows can have a significant impact on the framerate. We increased the default rendering distance of shadows in FAForever two years ago. At the time we did not notice this impact. With these changes we turn it into a slider in the graphics options. The default value (260) matches the value used by Steam version of the game.

lua/options/options.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,6 +1663,23 @@ options = {
16631663
inc = 256,
16641664
},
16651665
},
1666+
{
1667+
title = "<LOC OPTIONS_SHADOW_RENDER_DISTANCE_TITLE>Shadow render distance",
1668+
key = 'shadow_render_distance',
1669+
type = 'slider',
1670+
default = 260,
1671+
update = function(control, value)
1672+
ConExecute(string.format("ren_ShadowLOD %d", value))
1673+
end,
1674+
set = function(key, value, startup)
1675+
ConExecute(string.format("ren_ShadowLOD %d", value))
1676+
end,
1677+
custom = {
1678+
min = 200,
1679+
max = 440,
1680+
inc = 20,
1681+
},
1682+
},
16661683
{
16671684
title = "<LOC OPTIONS_0015>Anti-Aliasing",
16681685
key = 'antialiasing',

lua/ui/game/gamemain.lua

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,6 @@ function CreateUI(isReplay)
191191
ConExecute("ren_ClipDecalLevel 4") -- standard value of 2, causes a lot of clipping
192192
ConExecute("ren_DecalFadeFraction 0.25") -- standard value of 0.5, causes decals to suddenly pop into screen
193193

194-
-- always try and render shadows
195-
ConExecute("ren_ShadowLOD 20000")
196-
197194
local focusArmy = GetFocusArmy()
198195

199196
-- keep track of the original focus army

lua/ui/help/tooltips.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,11 @@ Tooltips = {
739739
},
740740
options_shadow_resolution = {
741741
title = "<LOC OPTIONS_SHADOW_RESOLUTION_TITLE>Shadow Resolution",
742-
description = "<LOC OPTIONS_SHADOW_RESOLUTION_DESCRIPTION>Sets resolution of shadows (lower = faster).",
742+
description = "<LOC OPTIONS_SHADOW_RESOLUTION_DESCRIPTION>Sets resolution of shadows (lower = faster). High values require more VRAM.",
743+
},
744+
options_shadow_render_distance = {
745+
title = "<LOC OPTIONS_SHADOW_RENDER_DISTANCE_TITLE>Shadow Resolution",
746+
description = "<LOC OPTIONS_SHADOW_RENDER_DISTANCE_DESCRIPTION>Sets the rendering distance (level of detail) of shadows (lower = faster). High values can have a significant impact on your framerate.",
743747
},
744748
options_antialiasing = {
745749
title = "<LOC OPTIONS_0015>Anti-Aliasing",

0 commit comments

Comments
 (0)