feat(world): volumetric coral heads on patch reefs
Quality Gate / Quality Gate (pull_request) Failing after 3m18s
Quality Gate / Quality Gate (pull_request) Failing after 3m18s
Three procedural coral head meshes (boulder, brain-ridged, lobed domes on a flat base, vertex-shaded crevices) are scattered on gentle rock between 12 and 40 m, clustered by noise, one MultiMesh per tile and variant, with an opaque shader under the shared water column. The coral assertions run on the Banc du Vigilant, whose patch reef lies in the lit band. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
0f9918224a
commit
48e054557c
12 files changed
+293
-24
No files matched your search
@@ -20,7 +20,7 @@ const DIVE_SITE_SCENE = preload("res://game/world/sites/dive_site.tscn")
|
||||
const ZONE1_SITE_PATH := "res://content/sites/zone1_vigilant.tres"
|
||||
const SHOWCASE_SITE_PATH := "res://content/sites/terrain_showcase.tres"
|
||||
const GROOVE_PROBE_OFFSET_M := 25.0
|
||||
const TEST_COUNT := 49
|
||||
const TEST_COUNT := 51
|
||||
|
||||
var _failures: Array[String] = []
|
||||
|
||||
@@ -279,6 +279,24 @@ func _test_zone1_site() -> void:
|
||||
for sample in result.samples:
|
||||
has_sand = has_sand or sample.material == SonarMaterial.Value.SAND
|
||||
_expect(result.accepted and has_sand, "a reference scan from the zone 1 spawn reads the sand plateau")
|
||||
|
||||
# The calibration site lies below 40 m, so coral heads are checked on the patch reef here.
|
||||
var flora := site.flora()
|
||||
var coral_count := flora.instance_count(SeabedFloraActor.Kind.CORAL_HEAD)
|
||||
_expect(coral_count > 0, "the Banc du Vigilant grows coral heads on its patch reef (%d)" % coral_count)
|
||||
var field_for_corals := definition.height_field()
|
||||
var corals_on_gentle_rock := true
|
||||
for transform in flora.sample_transforms(SeabedFloraActor.Kind.CORAL_HEAD):
|
||||
var at := transform.origin
|
||||
var column := int(roundf((at.x - field_for_corals.origin_m().x) / field_for_corals.cell_size_m()))
|
||||
var row := int(roundf((at.z - field_for_corals.origin_m().y) / field_for_corals.cell_size_m()))
|
||||
corals_on_gentle_rock = (
|
||||
corals_on_gentle_rock
|
||||
and field_for_corals.material_at(at.x, at.z) == SonarMaterial.Value.ROCK
|
||||
and field_for_corals.normal_at_cell(column, row).y >= SeabedFloraActor.CORAL_SLOPE_COSINE - 0.05
|
||||
and -at.y >= SeabedFloraActor.CORAL_DEPTH_MIN_M and -at.y <= SeabedFloraActor.CORAL_DEPTH_MAX_M
|
||||
)
|
||||
_expect(corals_on_gentle_rock, "coral heads sit on gentle rock in the lit band")
|
||||
site.queue_free()
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user