A6: Sea, sky and weather
Weather.at(tide, tick) derives the weather from the tide's schedule alone, so every client sees the same sky with nothing new on the wire: the storm builds from calm at the first tide to a gale at sudden death, and the light runs from mid-afternoon to dusk at the time limit. WeatherView applies it each sync to the sky, sun, fog, ambient light, the sea's roughness and rain around the camera (CPUParticles3D, for both renderers). Under water the view closes into SEA_MURK, the rain stops and the surface is a rippled ceiling seen from below. The sea shader darkens open water and adds chop and whitecaps with the storm, and keeps a breathing foam band at the waterline with a fainter line beyond. In the Compatibility renderer, whose depth texture the shader can't read (the sea came out all foam), water depth comes from a texture of the terrain's heights instead. Sea colours move into Palette; the rain and wind beds follow the weather. Tests: test_weather (7). make check passes (611 tests). Captures: make sea-captures (every tide phase, calm beach, the last land in the gale, under water, and three in the Compatibility renderer). Closes #46 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,8 @@ var rig: CameraRig = CameraRig.new()
|
||||
## The woodcut print pass over the camera (Look.add_print_pass).
|
||||
var print_pass: MeshInstance3D
|
||||
var sun: DirectionalLight3D
|
||||
## The sky, light, haze, rain and murk of the moment (A6).
|
||||
var weather: WeatherView
|
||||
|
||||
|
||||
## Applies the player's graphics settings: the sun's shadows and the print pass.
|
||||
@@ -55,6 +57,11 @@ func setup(simulation: Simulation, local_id: int = 0) -> void:
|
||||
add_child(terrain)
|
||||
water = WaterView.new()
|
||||
add_child(water)
|
||||
water.set_ground(sim.ground)
|
||||
weather = WeatherView.new()
|
||||
weather.name = "Weather"
|
||||
add_child(weather)
|
||||
weather.setup(world.environment, sun, water)
|
||||
pois = PoiView.new()
|
||||
pois.setup(sim.pois)
|
||||
add_child(pois)
|
||||
@@ -74,6 +81,7 @@ func setup(simulation: Simulation, local_id: int = 0) -> void:
|
||||
## Matches everything drawn to the simulation as it is now.
|
||||
func sync() -> void:
|
||||
water.follow(sim)
|
||||
weather.apply(Weather.at(sim.tide, sim.tick), camera.transform.origin)
|
||||
Look.set_sea_level(print_pass, water.level)
|
||||
props.sync()
|
||||
structures.sync()
|
||||
|
||||
Reference in New Issue
Block a user