Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set volumetric lighting strength #3158

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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