H1: make bench, render budgets, and a third of the figure draw calls
make bench (tools/bench.sh, tools/bench_report.gd) measures the server's p50/p99/max tick with 24 bots on three seeds over a whole match, and the client's draw calls, primitives, objects, nodes and memory at six moments of a match rendered in the capture container. It fails on anything over the budgets now recorded in docs/ARCHITECTURE.md: p99 tick 12 ms, 2,000 draw calls and 2,000,000 primitives per frame (all passes), 1 GiB video and 512 MiB static memory. Every capture now reports its frame's render counts in a "render" field. The first run put the barge, with 24 figures together, at 2,197 draw calls. Each figure part had one surface per colour (about 43 per figure, drawn again for shadows). FigureRig now merges a part's surfaces into one per finish (coat, gilt, plain) and carries the Palette colours as vertex colours, with shared materials. The barge is down to 1,207 draw calls, with the same triangles and the same look. Frame rates on a real GPU are not measured here; that stays with R6. Closes #54 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -34,9 +34,32 @@ func test_every_part_is_built_from_the_generated_models() -> void:
|
||||
assert_not_null(mesh, "%s has a model" % part)
|
||||
if mesh == null:
|
||||
continue
|
||||
for surface: int in mesh.get_surface_count():
|
||||
var name: String = mesh.surface_get_name(surface)
|
||||
var source: Mesh = load("%s/%s.obj" % [FigureRig.MODEL_DIR, part]) as Mesh
|
||||
var wanted: Dictionary = {}
|
||||
var finishes: Dictionary = {}
|
||||
for surface: int in source.get_surface_count():
|
||||
var name: String = source.surface_get_material(surface).resource_name
|
||||
assert_true(name.begins_with("COAT") or FigureRig.COLOURS.has(name), "%s's %s is a Palette colour" % [part, name])
|
||||
wanted[FigureRig.colour_of(name, Palette.OILSKIN)] = true
|
||||
finishes[FigureRig.finish_of(name)] = true
|
||||
# H1: merged to one surface per finish, the colours carried by the vertices.
|
||||
assert_eq(mesh.get_surface_count(), finishes.size(), "%s has one surface per finish" % part)
|
||||
var seen: Dictionary = {}
|
||||
for surface: int in mesh.get_surface_count():
|
||||
assert_true(FigureRig.FINISHES.has(mesh.surface_get_name(surface)))
|
||||
var paint: StandardMaterial3D = mesh.surface_get_material(surface) as StandardMaterial3D
|
||||
assert_true(paint.vertex_color_use_as_albedo and paint.vertex_color_is_srgb, "%s is painted by its vertices" % part)
|
||||
var arrays: Array = mesh.surface_get_arrays(surface)
|
||||
for colour: Color in arrays[Mesh.ARRAY_COLOR] as PackedColorArray:
|
||||
seen[colour.to_html()] = colour
|
||||
# Vertex colours are stored with less precision than a Color.
|
||||
assert_eq(seen.size(), wanted.size(), "%s keeps every colour" % part)
|
||||
for colour: Color in wanted:
|
||||
var found: bool = false
|
||||
for kept: Color in seen.values():
|
||||
found = found or (absf(kept.r - colour.r) < 0.01 and absf(kept.g - colour.g) < 0.01 and absf(kept.b - colour.b) < 0.01)
|
||||
assert_true(found, "%s still has colour %s" % [part, colour.to_html()])
|
||||
assert_eq(mesh.get_faces().size(), source.get_faces().size(), "%s keeps every triangle" % part)
|
||||
assert_eq(FigureRig.colour_of("COAT", Palette.SEA_PAINT), Palette.SEA_PAINT, "the coat is the player's own")
|
||||
assert_eq(FigureRig.colour_of("SKIN", Palette.SEA_PAINT), Palette.SKIN)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user