Skip to content

Commit 08ba866

Browse files
committed
Improve shadow settings usability
1 parent 1f0aa28 commit 08ba866

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

builtin/common/settings/shadows_component.lua

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ local function detect_mapping_idx()
3434

3535
local shadow_map_max_distance = tonumber(core.settings:get("shadow_map_max_distance"))
3636
local shadow_map_texture_size = tonumber(core.settings:get("shadow_map_texture_size"))
37-
local shadow_map_texture_32bit = core.settings:get_bool("shadow_map_texture_32bit", false)
37+
local shadow_map_texture_32bit = core.settings:get_bool("shadow_map_texture_32bit")
3838
local shadow_filters = tonumber(core.settings:get("shadow_filters"))
39-
local shadow_map_color = core.settings:get_bool("shadow_map_color", false)
39+
local shadow_map_color = core.settings:get_bool("shadow_map_color")
4040

4141
for i = 2, 6 do
4242
local preset = shadow_presets[i]
@@ -81,8 +81,14 @@ return {
8181
table.remove(labels, PRESET_CUSTOM)
8282
end
8383

84+
-- Don't show anything if shadows are disabled
85+
-- Reason: there's a separate checkbox and users can't see the suggested default in the dropdown
86+
if idx == PRESET_DISABLED then
87+
return "", 0
88+
end
89+
8490
local fs =
85-
"label[0,0.2;" .. fgettext("Dynamic shadows") .. "]" ..
91+
"label[0,0.2;" .. fgettext("Quality preset") .. "]" ..
8692
"dropdown[0,0.4;3,0.8;dd_shadows;" .. table.concat(labels, ",") .. ";" .. idx .. ";true]" ..
8793
"label[0,1.5;" .. core.colorize("#bbb", fgettext("(The game will need to enable shadows as well)")) .. "]"
8894
return fs, 1.8

builtin/settingtypes.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ water_wave_speed (Waving liquids wave speed) float 5.0
706706
# Set to true to enable Shadow Mapping.
707707
#
708708
# Requires: shadows_support
709-
enable_dynamic_shadows (Dynamic shadows) bool false
709+
enable_dynamic_shadows (Enable dynamic shadows) bool false
710710

711711
# Set the shadow strength gamma.
712712
# Adjusts the intensity of in-game dynamic shadows.
@@ -718,7 +718,7 @@ shadow_strength_gamma (Shadow strength gamma) float 1.0 0.1 10.0
718718
# Maximum distance to render shadows.
719719
#
720720
# Requires: enable_dynamic_shadows, shadows_support
721-
shadow_map_max_distance (Shadow map max distance in nodes to render shadows) float 140.0 10.0 1000.0
721+
shadow_map_max_distance (Shadow map render distance) float 140.0 10.0 1000.0
722722

723723
# Texture size to render the shadow map on.
724724
# This must be a power of two.

0 commit comments

Comments
 (0)