1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-11-21 00:45:23 +01:00

Improve shadow settings usability

This commit is contained in:
sfan5
2025-11-17 13:38:46 +01:00
parent 1f0aa28cf0
commit 08ba866992
2 changed files with 11 additions and 5 deletions

View File

@@ -34,9 +34,9 @@ local function detect_mapping_idx()
local shadow_map_max_distance = tonumber(core.settings:get("shadow_map_max_distance")) local shadow_map_max_distance = tonumber(core.settings:get("shadow_map_max_distance"))
local shadow_map_texture_size = tonumber(core.settings:get("shadow_map_texture_size")) local shadow_map_texture_size = tonumber(core.settings:get("shadow_map_texture_size"))
local shadow_map_texture_32bit = core.settings:get_bool("shadow_map_texture_32bit", false) local shadow_map_texture_32bit = core.settings:get_bool("shadow_map_texture_32bit")
local shadow_filters = tonumber(core.settings:get("shadow_filters")) local shadow_filters = tonumber(core.settings:get("shadow_filters"))
local shadow_map_color = core.settings:get_bool("shadow_map_color", false) local shadow_map_color = core.settings:get_bool("shadow_map_color")
for i = 2, 6 do for i = 2, 6 do
local preset = shadow_presets[i] local preset = shadow_presets[i]
@@ -81,8 +81,14 @@ return {
table.remove(labels, PRESET_CUSTOM) table.remove(labels, PRESET_CUSTOM)
end end
-- Don't show anything if shadows are disabled
-- Reason: there's a separate checkbox and users can't see the suggested default in the dropdown
if idx == PRESET_DISABLED then
return "", 0
end
local fs = local fs =
"label[0,0.2;" .. fgettext("Dynamic shadows") .. "]" .. "label[0,0.2;" .. fgettext("Quality preset") .. "]" ..
"dropdown[0,0.4;3,0.8;dd_shadows;" .. table.concat(labels, ",") .. ";" .. idx .. ";true]" .. "dropdown[0,0.4;3,0.8;dd_shadows;" .. table.concat(labels, ",") .. ";" .. idx .. ";true]" ..
"label[0,1.5;" .. core.colorize("#bbb", fgettext("(The game will need to enable shadows as well)")) .. "]" "label[0,1.5;" .. core.colorize("#bbb", fgettext("(The game will need to enable shadows as well)")) .. "]"
return fs, 1.8 return fs, 1.8

View File

@@ -706,7 +706,7 @@ water_wave_speed (Waving liquids wave speed) float 5.0
# Set to true to enable Shadow Mapping. # Set to true to enable Shadow Mapping.
# #
# Requires: shadows_support # Requires: shadows_support
enable_dynamic_shadows (Dynamic shadows) bool false enable_dynamic_shadows (Enable dynamic shadows) bool false
# Set the shadow strength gamma. # Set the shadow strength gamma.
# Adjusts the intensity of in-game dynamic shadows. # 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
# Maximum distance to render shadows. # Maximum distance to render shadows.
# #
# Requires: enable_dynamic_shadows, shadows_support # Requires: enable_dynamic_shadows, shadows_support
shadow_map_max_distance (Shadow map max distance in nodes to render shadows) float 140.0 10.0 1000.0 shadow_map_max_distance (Shadow map render distance) float 140.0 10.0 1000.0
# Texture size to render the shadow map on. # Texture size to render the shadow map on.
# This must be a power of two. # This must be a power of two.