mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-20 14:23:16 -04:00
Set shadow intensity based on cloud density
This commit is contained in:
parent
a6f3b89596
commit
b6c5bb7065
1 changed files with 3 additions and 1 deletions
|
@ -96,15 +96,17 @@ local function update_clouds()
|
|||
-- density_max = 0.8 at humid = 50.
|
||||
-- density_max = 1.35 at humid = 100.
|
||||
local density_max = 0.8 + ((humid - 50) / 50) * 0.55
|
||||
local density = rangelim(density_max, 0.2, 1.0) * n_density
|
||||
player:set_clouds({
|
||||
-- Range limit density_max to always have occasional
|
||||
-- small scattered clouds at extreme low humidity.
|
||||
density = rangelim(density_max, 0.2, 1.0) * n_density,
|
||||
density = density,
|
||||
thickness = math.max(math.floor(
|
||||
rangelim(32 * humid / 100, 8, 32) * n_thickness
|
||||
), 2),
|
||||
speed = {x = n_speedx * 4, z = n_speedz * 4},
|
||||
})
|
||||
player:set_lighting({shadows = { intensity = 0.5 - density / 2.0} })
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue