H16: The open sea floor reads as fully deep, so the world's edge doesn't show

From the lobby's view a pale square showed round the island: the terrain
grid's edge. The floor inside is 12.4 m down, but the shader's depth curve
only reached about 90% deep there, its view-space depth estimate read 7 to
11 m from the air, and the floor showed through at up to 4% opacity.

The shader now takes the larger of the true vertical depth (from the
world-space ray) and the old estimate, which shallows at a grazing angle
still use; normalises the curve so water WaterView.OPEN_DEPTH (9 m, three
quarters of the sea floor's depth) deep is fully SEA_DEEP; and makes fully
deep water opaque. Re-rendered match_lobby in Forward+ and Compatibility
(no square), and sea_tide_0/3, sea_shore_calm, water_shore, poi_dock and
client_basin (shallows still read as shallow).

Closes #85

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 15:08:55 -05:00
co-authored by Claude Opus 5.5
parent 4bc2171b01
commit 00528a197f
4 changed files with 29 additions and 5 deletions
+8
View File
@@ -18,3 +18,11 @@ func test_surface_follows_the_simulation_sea_level() -> void:
assert_near(view.surface().position.x, Tuning.WORLD_SIZE_METRES * 0.5, 0.001)
assert_eq(view.surface().cast_shadow, GeometryInstance3D.SHADOW_CASTING_SETTING_OFF)
view.free()
func test_the_open_sea_colour_is_reached_above_the_sea_floor() -> void:
# H6: the floor round the island must not read lighter than the sea past the edge.
var view: WaterView = WaterView.new()
var open_depth: float = float(view.material().get_shader_parameter("open_depth"))
assert_true(open_depth > 0.0 and open_depth < Tuning.ISLAND_SEA_DEPTH)
view.free()