Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

test(render): an agx-chart scene reads known patches against what Blender displays for them

yhhf4f57144a76b
diff --git a/fixtures/scenes/agx-chart.esscene b/fixtures/scenes/agx-chart.esscene
new file mode 100644
index 000000000..6b7e78946
--- /dev/null
+++ b/fixtures/scenes/agx-chart.esscene
@@ -0,0 +1,251 @@
+{
+ "version": 4,
+ "name": "AgX Chart",
+ "entities": [
+ {
+ "id": 0,
+ "name": "Camera",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 10
+ }
+ }
+ },
+ {
+ "type": "Camera",
+ "data": {
+ "projectionType": 1,
+ "orthoSize": 300,
+ "isActive": true,
+ "priority": 0
+ }
+ }
+ ]
+ },
+ {
+ "id": 1,
+ "name": "PostProcess",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "PostProcessVolume",
+ "data": {
+ "isGlobal": true,
+ "priority": 0,
+ "weight": 1,
+ "blendDistance": 0,
+ "shape": "box",
+ "size": {
+ "x": 5,
+ "y": 5
+ },
+ "effects": [
+ {
+ "type": "agx",
+ "enabled": true,
+ "uniforms": {
+ "u_contrast": 1.0
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ {
+ "id": 2,
+ "name": "Patch0",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -240,
+ "y": 0,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Sprite",
+ "data": {
+ "size": {
+ "x": 100,
+ "y": 100
+ },
+ "color": {
+ "r": 0.27730417690977277,
+ "g": 0.27730417690977277,
+ "b": 0.27730417690977277,
+ "a": 1
+ },
+ "lit": false
+ }
+ }
+ ]
+ },
+ {
+ "id": 3,
+ "name": "Patch1",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -120,
+ "y": 0,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Sprite",
+ "data": {
+ "size": {
+ "x": 100,
+ "y": 100
+ },
+ "color": {
+ "r": 0.5370987304831942,
+ "g": 0.5370987304831942,
+ "b": 0.5370987304831942,
+ "a": 1
+ },
+ "lit": false
+ }
+ }
+ ]
+ },
+ {
+ "id": 4,
+ "name": "Patch2",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Sprite",
+ "data": {
+ "size": {
+ "x": 100,
+ "y": 100
+ },
+ "color": {
+ "r": 0.9999999999999999,
+ "g": 0.9999999999999999,
+ "b": 0.9999999999999999,
+ "a": 1
+ },
+ "lit": false
+ }
+ }
+ ]
+ },
+ {
+ "id": 5,
+ "name": "Patch3",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 120,
+ "y": 0,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Sprite",
+ "data": {
+ "size": {
+ "x": 100,
+ "y": 100
+ },
+ "color": {
+ "r": 0.6651850846308363,
+ "g": 0.5370987304831942,
+ "b": 0.48452920448170694,
+ "a": 1
+ },
+ "lit": false
+ }
+ }
+ ]
+ },
+ {
+ "id": 6,
+ "name": "Patch4",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 240,
+ "y": 0,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Sprite",
+ "data": {
+ "size": {
+ "x": 100,
+ "y": 100
+ },
+ "color": {
+ "r": 0.2090656035816365,
+ "g": 0.29748529177623373,
+ "b": 0.46135612950044164,
+ "a": 1
+ },
+ "lit": false
+ }
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/fixtures/scenes/agx-chart.textures.json b/fixtures/scenes/agx-chart.textures.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/fixtures/scenes/agx-chart.textures.json
@@ -0,0 +1 @@
+{}
diff --git a/tools/renderScenes.mjs b/tools/renderScenes.mjs
index a4b0f2781..9a97790c8 100644
--- a/tools/renderScenes.mjs
+++ b/tools/renderScenes.mjs
@@ -495,6 +495,9 @@ export const SCENES = [
// Post-process chain guards — bloom's first CI pixel coverage. The gamma scene pins the LDR multi-pass chain; the linear scene is the HDR discriminator: threshold 1.5 sits above anything an 8-bit chain can store, so glow OUTSIDE the sprite (x=0.64) proves over-range light survived the float intermediates — the same scene blooms NOTHING in gamma mode.
{ id: "bloom-ldr", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_PLAY: "1", ESTELLA_VERIFY_SCENE: "/scenes/bloom-ldr.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/bloom-ldr.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "10", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.61,\"y\":0.5,\"rgb\":[0,130,0],\"tol\":35},{\"x\":0.70,\"y\":0.5,\"rgb\":[0,32,0],\"tol\":25},{\"x\":0.85,\"y\":0.5,\"rgb\":[0,0,0],\"tol\":12}]" } },
{ id: "hdr-bloom", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_PLAY: "1", ESTELLA_VERIFY_COLORSPACE: "linear", ESTELLA_VERIFY_SCENE: "/scenes/hdr-bloom.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/hdr-bloom.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "10", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":25},{\"x\":0.64,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":35},{\"x\":0.85,\"y\":0.5,\"rgb\":[0,0,0],\"tol\":12}]" } },
+ // AgX: five patches of known scene-linear colour read against what Blender's own AgX displays for them (tools/render-align/agx_chart.py in the
+ // star-neighbors game, look None): a grey ramp, a skin tone and a dim blue. The curve and the table are what is under test, on both backends.
+ { id: "agx-chart", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_PLAY: "1", ESTELLA_VERIFY_COLORSPACE: "linear", ESTELLA_VERIFY_SCENE: "/scenes/agx-chart.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/agx-chart.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "10", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.1,\"y\":0.5,\"rgb\":[66,66,66],\"tol\":10},{\"x\":0.3,\"y\":0.5,\"rgb\":[136,136,136],\"tol\":10},{\"x\":0.5,\"y\":0.5,\"rgb\":[197,197,197],\"tol\":10},{\"x\":0.7,\"y\":0.5,\"rgb\":[160,135,125],\"tol\":10},{\"x\":0.9,\"y\":0.5,\"rgb\":[45,77,118],\"tol\":10}]" } },
{ id: "video", tier: "nightly", webgpu: true, env: { ESTELLA_VERIFY_PLAY: "1", ESTELLA_VERIFY_SETTLE_MS: "2500", ESTELLA_VERIFY_SCENE: "/scenes/video-playback.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/video-playback.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.25,\"rgb\":[255,0,0],\"tol\":90},{\"x\":0.5,\"y\":0.75,\"rgb\":[0,0,255],\"tol\":90}]" } },
{ id: "video-ui", tier: "nightly", webgpu: true, env: { ESTELLA_VERIFY_PLAY: "1", ESTELLA_VERIFY_SETTLE_MS: "2500", ESTELLA_VERIFY_SCENE: "/scenes/video-ui.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/video-ui.textures.json", ESTELLA_VERIFY_W: "800", ESTELLA_VERIFY_H: "600", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.25,\"rgb\":[255,0,0],\"tol\":90},{\"x\":0.5,\"y\":0.75,\"rgb\":[0,0,255],\"tol\":90}]" } },
// The other skeletal runtime, on the same terms as spine below it: a side