test(M00): calibrate paired renderer checkpoints
Work-Package: M00-QAR-VISUAL-DIFF-001 Agent: sindo-main-codex Tests: synthetic JPG/PNG diff, manifest, coordination and documentation gates Fidelity: five build 12340 references compared; coordinate and placement gaps recorded
This commit is contained in:
@@ -25,7 +25,9 @@ func _capture_async() -> void:
|
||||
var headless := DisplayServer.get_name().to_lower() == "headless"
|
||||
var dry_run := args.has("--dry-run") or headless
|
||||
var viewport: Array = manifest.get("viewport", [1280, 900])
|
||||
get_root().size = Vector2i(maxi(16, int(viewport[0])), maxi(16, int(viewport[1])))
|
||||
var viewport_width := int(_arg(args, "--viewport-width", str(viewport[0])))
|
||||
var viewport_height := int(_arg(args, "--viewport-height", str(viewport[1])))
|
||||
get_root().size = Vector2i(maxi(16, viewport_width), maxi(16, viewport_height))
|
||||
|
||||
var abs_output_dir := ProjectSettings.globalize_path(output_dir)
|
||||
DirAccess.make_dir_recursive_absolute(abs_output_dir)
|
||||
@@ -107,7 +109,7 @@ func _capture_async() -> void:
|
||||
probe.scale = Vector3.ONE * float(checkpoint.get("probe_scale", 1.0))
|
||||
|
||||
camera.global_position = _vector3(checkpoint.get("camera", [0.0, 0.0, 0.0]))
|
||||
camera.look_at(_vector3(checkpoint.get("target", [0.0, 0.0, 0.0])), Vector3.UP)
|
||||
_orient_camera_without_roll(camera, _vector3(checkpoint.get("target", [0.0, 0.0, 0.0])))
|
||||
if player != null:
|
||||
player.global_position = _vector3(checkpoint.get("player", checkpoint.get("target", [0.0, 0.0, 0.0])))
|
||||
_set_sky_time(world, float(checkpoint.get("time_hours", 13.0)))
|
||||
@@ -135,7 +137,6 @@ func _capture_async() -> void:
|
||||
await RenderingServer.frame_post_draw
|
||||
|
||||
var image := get_root().get_texture().get_image()
|
||||
image.flip_y()
|
||||
var file_name := "%s__%s.png" % [checkpoint_name, pass_name]
|
||||
var abs_path := abs_output_dir.path_join(file_name)
|
||||
var err := image.save_png(abs_path)
|
||||
@@ -196,6 +197,15 @@ func _measure_frames(seconds: float, world: Node) -> Dictionary:
|
||||
}
|
||||
|
||||
|
||||
func _orient_camera_without_roll(camera: Camera3D, target_position: Vector3) -> void:
|
||||
var forward := (target_position - camera.global_position).normalized()
|
||||
var right := forward.cross(Vector3.UP).normalized()
|
||||
if right.is_zero_approx():
|
||||
right = Vector3.RIGHT
|
||||
var corrected_up := right.cross(forward).normalized()
|
||||
camera.global_basis = Basis(right, corrected_up, -forward)
|
||||
|
||||
|
||||
func _result_record(checkpoint: Dictionary, pass_name: String, load_time_ms: float, metrics: Dictionary, sha256: String) -> Dictionary:
|
||||
return {
|
||||
"name": checkpoint.get("name", "checkpoint"),
|
||||
|
||||
Reference in New Issue
Block a user