From df8159436c65db7940077dda28f4d1ad5a9c0811 Mon Sep 17 00:00:00 2001 From: grorp Date: Tue, 1 Oct 2024 16:08:15 +0200 Subject: [PATCH] Set volumetric lighting strength --- game_api.txt | 2 +- minetest.conf.example | 3 ++- mods/weather/init.lua | 8 ++++++-- settingtypes.txt | 3 ++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/game_api.txt b/game_api.txt index ff24a7e2de..d9edd159e7 100644 --- a/game_api.txt +++ b/game_api.txt @@ -1205,7 +1205,7 @@ Weather API ----------- The weather mod will constantly adjust weather effects seen by the player -(that is: cloud parameters and shadow intensity). +(that is: cloud parameters, shadow intensity and volumetric lighting). These can be influenced using this API. #### `weather.get = function(player)` diff --git a/minetest.conf.example b/minetest.conf.example index bb6eb6444b..f6ee8eb2b8 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -72,7 +72,8 @@ default:torch 99,default:cobble 99 # Helps rivers create more sound, especially on level sections. #river_source_sounds = false -# Enable cloud and shadow intensity variation by the 'weather' mod. +# If enabled, the 'weather' mod will control cloud parameters, shadow intensity +# and volumetric lighting. # Non-functional in V6 or Singlenode mapgens. #enable_weather = true diff --git a/mods/weather/init.lua b/mods/weather/init.lua index cc49869426..7132e5df1b 100644 --- a/mods/weather/init.lua +++ b/mods/weather/init.lua @@ -11,7 +11,10 @@ local mg_name = minetest.get_mapgen_setting("mg_name") if mg_name == "v6" or mg_name == "singlenode" then -- set a default shadow intensity for mgv6 and singlenode minetest.register_on_joinplayer(function(player) - player:set_lighting({ shadows = { intensity = 0.33 } }) + player:set_lighting({ + shadows = { intensity = 0.33 }, + volumetric_light = { strength = 0.2 }, + }) end) return @@ -117,7 +120,8 @@ function weather.get(player) speed = {x = n_speedx * 4, z = n_speedz * 4}, }, lighting = { - shadows = { intensity = 0.7 * (1 - density) } + shadows = { intensity = 0.7 * (1 - density) }, + volumetric_light = { strength = 0.2 }, } } end diff --git a/settingtypes.txt b/settingtypes.txt index 445510ff65..3ac8eeabcf 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -72,7 +72,8 @@ engine_spawn (Use engine spawn search) bool false # Helps rivers create more sound, especially on level sections. river_source_sounds (River source node sounds) bool false -# Enable cloud and shadow intensity variation by the 'weather' mod. +# If enabled, the 'weather' mod will control cloud parameters, shadow intensity +# and volumetric lighting. # Non-functional in V6 or Singlenode mapgens. enable_weather (Enable weather) bool true