Audit prop budgets and add a prop-gallery art check

- audit_glb decodes geometry: 400 tris / 600 verts budget, degenerate
  triangles, UV range, ground contact, one material; newspaper box parts moved
  to sit on y=0
- capture_prop_gallery.gd renders the six props on a studio backdrop; new
  prop_gallery catalogue entry + AI mockup (compare 10 good, judge match 0.90)
- headless test that instances share the imported atlas material
- README documents the gallery capture and budget; TODO props pipeline section
  moved to DONE
This commit is contained in:
zwitschi committed 2026-11-01 10:27:27 +01:00
1 parent bb40a98537
commit 2a4e0d1998
12 files changed
+310 -22

No files matched your search

+28
View File
@@ -68,6 +68,34 @@ func test_prop_scenes_share_one_atlas_material() -> bool:
instance.free()
return TestUtils.check(problems.is_empty(), "one atlas material per prop (%s)" % str(problems))
func test_prop_instances_share_the_imported_material() -> bool:
## Instancing a prop must not duplicate its atlas material; every copy uses
## the same resource, so many props stay cheap to draw.
var problems: Array[String] = []
for prop in WorldBuilder.MODEL_PROPS:
var packed := ResourceLoader.load(MODEL_DIR + str(prop) + ".glb") as PackedScene
if packed == null:
problems.append("%s: no scene" % prop)
continue
var first := packed.instantiate()
var second := packed.instantiate()
var a := _first_material(first)
var b := _first_material(second)
if a == null or b == null:
problems.append("%s: missing material" % prop)
elif a.get_instance_id() != b.get_instance_id():
problems.append("%s: material is duplicated per instance" % prop)
first.free()
second.free()
return TestUtils.check(problems.is_empty(), "prop instances share materials (%s)" % str(problems))
func _first_material(instance: Node) -> Material:
for node in instance.find_children("*", "MeshInstance3D", true, false):
var mesh: Mesh = (node as MeshInstance3D).mesh
if mesh != null and mesh.get_surface_count() > 0:
return mesh.surface_get_material(0)
return null
func test_world_places_generated_props() -> bool:
var root := Node3D.new()
var builder := WorldBuilder.new(root)