Reenable dynamic shadows (#11)

When setting sun and moon to visible = false, dynamic shadows would not display any more.
In combination with the high-resolution skyboxes, they increase graphical quality quite a bit.
Setting sun and moon to an empty texture instead keeps dynamic shadows intact.
This commit is contained in:
veprogames 2023-03-03 22:04:27 +01:00 committed by GitHub
parent d47f7239e0
commit 740e40e0f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,8 +56,10 @@ skybox.set = function(player, number)
textures = textures,
clouds = true
})
player:set_sun({visible = false, sunrise_visible = false})
player:set_moon({visible = false})
-- making the sun invisible deactivates the dynamic shadows
-- making the sun visible with an invisible texture keeps shadows intact
player:set_sun({visible = true, sunrise_visible = false, texture = "blank.png"})
player:set_moon({visible = true, texture = "blank.png"})
player:set_stars({visible = false})
else
player:set_sky(sky[2], "skybox", textures, true)
@ -82,8 +84,8 @@ skybox.clear = function(player)
thickness = 16,
speed = {x = 0, y = -2},
})
player:set_sun({visible = true, sunrise_visible = true})
player:set_moon({visible = true})
player:set_sun({visible = true, sunrise_visible = true, texture = ""})
player:set_moon({visible = true, texture = ""})
player:set_stars({visible = true})
player:get_meta():set_string("skybox:skybox", "off")