Skip to content

Commit df81594

Browse files
grorpappgurueu
authored andcommitted
Set volumetric lighting strength
1 parent b23c44d commit df81594

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

game_api.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ Weather API
12051205
-----------
12061206

12071207
The weather mod will constantly adjust weather effects seen by the player
1208-
(that is: cloud parameters and shadow intensity).
1208+
(that is: cloud parameters, shadow intensity and volumetric lighting).
12091209
These can be influenced using this API.
12101210

12111211
#### `weather.get = function(player)`

minetest.conf.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ default:torch 99,default:cobble 99
7272
# Helps rivers create more sound, especially on level sections.
7373
#river_source_sounds = false
7474

75-
# Enable cloud and shadow intensity variation by the 'weather' mod.
75+
# If enabled, the 'weather' mod will control cloud parameters, shadow intensity
76+
# and volumetric lighting.
7677
# Non-functional in V6 or Singlenode mapgens.
7778
#enable_weather = true
7879

mods/weather/init.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ local mg_name = minetest.get_mapgen_setting("mg_name")
1111
if mg_name == "v6" or mg_name == "singlenode" then
1212
-- set a default shadow intensity for mgv6 and singlenode
1313
minetest.register_on_joinplayer(function(player)
14-
player:set_lighting({ shadows = { intensity = 0.33 } })
14+
player:set_lighting({
15+
shadows = { intensity = 0.33 },
16+
volumetric_light = { strength = 0.2 },
17+
})
1518
end)
1619

1720
return
@@ -117,7 +120,8 @@ function weather.get(player)
117120
speed = {x = n_speedx * 4, z = n_speedz * 4},
118121
},
119122
lighting = {
120-
shadows = { intensity = 0.7 * (1 - density) }
123+
shadows = { intensity = 0.7 * (1 - density) },
124+
volumetric_light = { strength = 0.2 },
121125
}
122126
}
123127
end

settingtypes.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ engine_spawn (Use engine spawn search) bool false
7272
# Helps rivers create more sound, especially on level sections.
7373
river_source_sounds (River source node sounds) bool false
7474

75-
# Enable cloud and shadow intensity variation by the 'weather' mod.
75+
# If enabled, the 'weather' mod will control cloud parameters, shadow intensity
76+
# and volumetric lighting.
7677
# Non-functional in V6 or Singlenode mapgens.
7778
enable_weather (Enable weather) bool true
7879

0 commit comments

Comments
 (0)