feat(environment): add painterly skies and living meadows

This commit is contained in:
Rijad Zuzo
2026-09-05 20:27:09 +02:00
parent 7899d36f03
commit ec16e2f2ca
71 changed files with 2280 additions and 213 deletions
+42 -1
View File
@@ -198,7 +198,7 @@ func _run() -> void:
if not tree.has_node("Canopy"):
continue
var canopy := tree.get_node("Canopy") as MeshInstance3D
var material := canopy.mesh.material as ShaderMaterial
var material := canopy.get_active_material(0) as ShaderMaterial
tree_wind_is_bounded = (
tree_wind_is_bounded
and material != null
@@ -249,6 +249,8 @@ func _run() -> void:
upper_river_ribbon.mesh is ArrayMesh,
"Waterfall shelf should expose a terrain-following upper stream"
)
_check_water_cross_sections(river_ribbon)
_check_water_cross_sections(upper_river_ribbon)
_check(
world.has_node("WaterRoot/RiverSurface/PlungePool"),
"River should widen into a readable plunge pool beneath the waterfall"
@@ -270,6 +272,7 @@ func _run() -> void:
),
"Plunge-pool water should follow the carved basin height"
)
_check_pool_outlet(river_ribbon, plunge_pool, terrain)
var environment: Environment = (
(world.get_node("WorldEnvironment") as WorldEnvironment).environment
)
@@ -628,6 +631,44 @@ func _run() -> void:
quit(1)
func _check_water_cross_sections(ribbon: MeshInstance3D) -> void:
var arrays := ribbon.mesh.surface_get_arrays(0)
var vertices: PackedVector3Array = arrays[Mesh.ARRAY_VERTEX]
var uvs: PackedVector2Array = arrays[Mesh.ARRAY_TEX_UV]
var row_height := 0.0
for index in vertices.size():
if is_zero_approx(uvs[index].x):
row_height = vertices[index].y
_check(
is_equal_approx(vertices[index].y, row_height),
"Water cross-sections should remain level instead of climbing either terrain bank"
)
func _check_pool_outlet(ribbon: MeshInstance3D, pool: MeshInstance3D, terrain: Terrain3D) -> void:
var vertices: PackedVector3Array = ribbon.mesh.surface_get_arrays(0)[Mesh.ARRAY_VERTEX]
var start := ribbon.to_global(vertices[0])
var pool_mesh := pool.mesh as PlaneMesh
var radii := pool_mesh.size * Vector2(pool.scale.x, pool.scale.z) * 0.5
var progress := (start.z - pool.global_position.z) / radii.y
var expected_edge := pool.global_position.x - radii.x * sqrt(1.0 - progress * progress)
var meets_ellipse := absf(start.x - expected_edge) < 0.03
var meets_shore := (
start.x >= expected_edge
and start.x < pool.global_position.x
and absf(start.y - terrain.data.get_height(start)) < 0.03
)
_check(
(meets_ellipse or meets_shore) and absf(start.y - pool.global_position.y) < 0.03,
"River outlet should meet the pool ellipse or its terrain shoreline at the same surface height"
)
var material := pool_mesh.surface_get_material(0) as ShaderMaterial
_check(
is_equal_approx(float(material.get_shader_parameter("pool_outlet_z")), start.z),
"Pool transparency should end where the river takes over to avoid coplanar overlap"
)
func _wait_for_navigation_map(navigation_map: RID) -> void:
for attempt in 30:
if (