Skip to content

Commit

Permalink
Set volumetric lighting strength
Browse files Browse the repository at this point in the history
  • Loading branch information
grorp authored and appgurueu committed Oct 1, 2024
1 parent b23c44d commit df81594
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion game_api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)`
Expand Down
3 changes: 2 additions & 1 deletion minetest.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 6 additions & 2 deletions mods/weather/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
3 changes: 2 additions & 1 deletion settingtypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit df81594

Please sign in to comment.