J1: the cliff tunnel (seam, six propped stretches, dark, lights), travel Valley <-> Cove through the sea cave, a save file per worldlet; New World has no Where (--dev-worldlets to try others)
This commit is contained in:
@@ -15,6 +15,8 @@ const DAY_BIAS := 0.2
|
||||
var day := 1
|
||||
var time := 8.0 / 24.0
|
||||
var frozen := false ## title-screen backdrop: hold a fixed time
|
||||
var underground := 0.0 ## 0..1: how far into the tunnel you are (no daylight; world.gd sets it)
|
||||
const AERIAL := 0.55 ## the fog's sky tint with distance (scenes/default_env.tres)
|
||||
|
||||
var sun: DirectionalLight3D
|
||||
var moon: DirectionalLight3D
|
||||
@@ -123,6 +125,26 @@ func apply(force: bool) -> void:
|
||||
env.ambient_light_energy = lerpf(0.3, 1.0, daylight) * lerpf(1.0, 0.85, overcast) + w_flash * 3.0
|
||||
env.fog_light_energy = lerpf(0.25, 1.0, daylight) * lerpf(1.0, 0.7, overcast) + w_flash * 2.0
|
||||
env.volumetric_fog_density = lerpf(0.0025, 0.0045, daylight) * lerpf(1.0, 2.0, overcast)
|
||||
if underground > 0.0:
|
||||
# In the tunnel (J1): no sun, moon or sky, only the lights you bring.
|
||||
var u := underground
|
||||
sun.light_energy *= 1.0 - u
|
||||
sun.visible = sun.light_energy > 0.01
|
||||
sun.shadow_enabled = sun.visible
|
||||
moon.light_energy *= 1.0 - u
|
||||
moon.visible = moon.light_energy > 0.01
|
||||
env.ambient_light_energy = lerpf(env.ambient_light_energy, 0.015, u)
|
||||
env.ambient_light_sky_contribution = 1.0 - u
|
||||
env.fog_light_energy = lerpf(env.fog_light_energy, 0.0, u)
|
||||
env.volumetric_fog_density *= 1.0 - u
|
||||
# (Sky reflections and the fog's sky-coloured distance would light the
|
||||
# rock blue-grey all the way down: off.)
|
||||
env.fog_aerial_perspective = lerpf(AERIAL, 0.0, u)
|
||||
env.reflected_light_source = Environment.REFLECTION_SOURCE_DISABLED if u > 0.5 else Environment.REFLECTION_SOURCE_SKY
|
||||
else:
|
||||
env.ambient_light_sky_contribution = 1.0
|
||||
env.fog_aerial_perspective = AERIAL
|
||||
env.reflected_light_source = Environment.REFLECTION_SOURCE_SKY
|
||||
env.fog_density = BASE_FOG * w_fog
|
||||
|
||||
_sky_timer -= get_process_delta_time()
|
||||
|
||||
Reference in New Issue
Block a user