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): 2D shadows were drawn by nobody's criterion

esengineb4e2de304a89
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0c1d04d94..e9433fbbf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -193,6 +193,21 @@ published separately; it ships inside the editor.
### Fixed
+- **2D shadows had no pixel criterion at all.** Four fixture scenes exercise
+ `ShadowCaster2D` — a hard point-light shadow, a soft one, a directional one —
+ and nothing drove any of them: the criteria that once did are gone, and the
+ scenes staying behind made the coverage look whole. All four run now, on both
+ backends, probing either side of the occluder on the light's axis; removing the
+ caster turns the shadowed probe from black to lit, which is what says they are
+ looking at the shadow rather than at the scene.
+
+ New gate `check-fixture-scenes`: a fixture with no criterion behind it must be
+ named, with what it would prove. Nine are (UI layout and text, KTX2
+ orientation, parallax, pixel-perfect sampling) — that list is the work, and
+ empty is where it is meant to end. Two more were neither: `platformer.esscene`
+ and `space-shooter.esscene` were copies of golden project scenes, built out of
+ game script components that do not exist in the fixture corpus.
+
- **The UI hit test took three mouse flags and threw them away.**
`uiHitTestWorld(world, x, y, mouseDown, mousePressed, mouseReleased)` carried
them into the engine, which `(void)`-ed all three: it is a raycast, and what a
diff --git a/fixtures/scenes/platformer.esscene b/fixtures/scenes/platformer.esscene
deleted file mode 100644
index 357936183..000000000
--- a/fixtures/scenes/platformer.esscene
+++ /dev/null
@@ -1,170 +0,0 @@
-{
- "version": 2,
- "name": "Main",
- "entities": [
- {
- "id": 0,
- "name": "Camera",
- "parent": null,
- "children": [],
- "components": [
- { "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 10 } } },
- { "type": "Camera", "data": { "projectionType": 1, "orthoSize": 350, "isActive": true, "priority": 0 } }
- ],
- "visible": true
- },
- {
- "id": 13,
- "name": "Sky",
- "parent": null,
- "children": [],
- "components": [
- { "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": -1 } } },
- { "type": "Sprite", "data": { "size": { "x": 800, "y": 700 }, "texture": "@uuid:74b832b1-40ae-4095-a620-c027735cb482" } }
- ],
- "visible": true
- },
- {
- "id": 1,
- "name": "Ground",
- "parent": null,
- "children": [],
- "components": [
- { "type": "Transform", "data": { "position": { "x": 0, "y": -250, "z": 0 } } },
- { "type": "Sprite", "data": { "size": { "x": 800, "y": 40 }, "color": { "r": 0.4, "g": 0.7, "b": 0.3, "a": 1 }, "texture": "@uuid:931ebe66-cded-4b32-8444-0737da446c0d" } },
- { "type": "Platform", "data": { "width": 800, "height": 40 } }
- ],
- "visible": true
- },
- {
- "id": 2,
- "name": "Platform1",
- "parent": null,
- "children": [],
- "components": [
- { "type": "Transform", "data": { "position": { "x": -200, "y": -120, "z": 0 } } },
- { "type": "Sprite", "data": { "size": { "x": 160, "y": 24 }, "color": { "r": 0.6, "g": 0.5, "b": 0.3, "a": 1 }, "texture": "@uuid:0258e55e-9aa0-47eb-8092-7386e03f97c7" } },
- { "type": "Platform", "data": { "width": 160, "height": 24 } }
- ],
- "visible": true
- },
- {
- "id": 3,
- "name": "Platform2",
- "parent": null,
- "children": [],
- "components": [
- { "type": "Transform", "data": { "position": { "x": 100, "y": -20, "z": 0 } } },
- { "type": "Sprite", "data": { "size": { "x": 160, "y": 24 }, "color": { "r": 0.6, "g": 0.5, "b": 0.3, "a": 1 }, "texture": "@uuid:0258e55e-9aa0-47eb-8092-7386e03f97c7" } },
- { "type": "Platform", "data": { "width": 160, "height": 24 } }
- ],
- "visible": true
- },
- {
- "id": 4,
- "name": "Platform3",
- "parent": null,
- "children": [],
- "components": [
- { "type": "Transform", "data": { "position": { "x": -80, "y": 100, "z": 0 } } },
- { "type": "Sprite", "data": { "size": { "x": 200, "y": 24 }, "color": { "r": 0.6, "g": 0.5, "b": 0.3, "a": 1 }, "texture": "@uuid:0258e55e-9aa0-47eb-8092-7386e03f97c7" } },
- { "type": "Platform", "data": { "width": 200, "height": 24 } }
- ],
- "visible": true
- },
- {
- "id": 5,
- "name": "Platform4",
- "parent": null,
- "children": [],
- "components": [
- { "type": "Transform", "data": { "position": { "x": 220, "y": 180, "z": 0 } } },
- { "type": "Sprite", "data": { "size": { "x": 140, "y": 24 }, "color": { "r": 0.6, "g": 0.5, "b": 0.3, "a": 1 }, "texture": "@uuid:0258e55e-9aa0-47eb-8092-7386e03f97c7" } },
- { "type": "Platform", "data": { "width": 140, "height": 24 } }
- ],
- "visible": true
- },
- {
- "id": 6,
- "name": "Player",
- "parent": null,
- "children": [],
- "components": [
- { "type": "Transform", "data": { "position": { "x": -200, "y": -200, "z": 0 } } },
- { "type": "Sprite", "data": { "size": { "x": 32, "y": 48 }, "color": { "r": 0.2, "g": 0.6, "b": 1, "a": 1 }, "texture": "@uuid:2bde6b7d-0dbe-4434-9e30-ed1cd8e3fe82" } },
- { "type": "Player", "data": {} }
- ],
- "visible": true
- },
- {
- "id": 7,
- "name": "Coin1",
- "parent": null,
- "children": [],
- "components": [
- { "type": "Transform", "data": { "position": { "x": -200, "y": -80, "z": 0 } } },
- { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 1, "g": 0.85, "b": 0, "a": 1 }, "texture": "@uuid:c18959bd-f6be-49d3-945b-3d6ecf8ef14f" } },
- { "type": "Coin", "data": { "baseY": -80, "bobTimer": 0 } }
- ],
- "visible": true
- },
- {
- "id": 8,
- "name": "Coin2",
- "parent": null,
- "children": [],
- "components": [
- { "type": "Transform", "data": { "position": { "x": 100, "y": 20, "z": 0 } } },
- { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 1, "g": 0.85, "b": 0, "a": 1 }, "texture": "@uuid:c18959bd-f6be-49d3-945b-3d6ecf8ef14f" } },
- { "type": "Coin", "data": { "baseY": 20, "bobTimer": 0 } }
- ],
- "visible": true
- },
- {
- "id": 9,
- "name": "Coin3",
- "parent": null,
- "children": [],
- "components": [
- { "type": "Transform", "data": { "position": { "x": -80, "y": 140, "z": 0 } } },
- { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 1, "g": 0.85, "b": 0, "a": 1 }, "texture": "@uuid:c18959bd-f6be-49d3-945b-3d6ecf8ef14f" } },
- { "type": "Coin", "data": { "baseY": 140, "bobTimer": 0 } }
- ],
- "visible": true
- },
- {
- "id": 10,
- "name": "Coin4",
- "parent": null,
- "children": [],
- "components": [
- { "type": "Transform", "data": { "position": { "x": 220, "y": 220, "z": 0 } } },
- { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 1, "g": 0.85, "b": 0, "a": 1 }, "texture": "@uuid:c18959bd-f6be-49d3-945b-3d6ecf8ef14f" } },
- { "type": "Coin", "data": { "baseY": 220, "bobTimer": 0 } }
- ],
- "visible": true
- },
- {
- "id": 11,
- "name": "Coin5",
- "parent": null,
- "children": [],
- "components": [
- { "type": "Transform", "data": { "position": { "x": 0, "y": -200, "z": 0 } } },
- { "type": "Sprite", "data": { "size": { "x": 24, "y": 24 }, "color": { "r": 1, "g": 0.85, "b": 0, "a": 1 }, "texture": "@uuid:c18959bd-f6be-49d3-945b-3d6ecf8ef14f" } },
- { "type": "Coin", "data": { "baseY": -200, "bobTimer": 0 } }
- ],
- "visible": true
- },
- {
- "id": 12,
- "name": "ScoreDisplay",
- "parent": null,
- "children": [],
- "components": [
- { "type": "ScoreDisplay", "data": { "score": 0 } }
- ],
- "visible": true
- }
- ]
-}
diff --git a/fixtures/scenes/space-shooter.esscene b/fixtures/scenes/space-shooter.esscene
deleted file mode 100644
index 1763b246d..000000000
--- a/fixtures/scenes/space-shooter.esscene
+++ /dev/null
@@ -1,461 +0,0 @@
-{
- "version": 2,
- "name": "Main",
- "entities": [
- {
- "id": 0,
- "name": "Camera",
- "parent": null,
- "children": [],
- "components": [
- {
- "type": "Transform",
- "data": {
- "position": {
- "x": 0,
- "y": 0,
- "z": 10
- }
- }
- },
- {
- "type": "Camera",
- "data": {
- "projectionType": 1,
- "orthoSize": 540,
- "isActive": true,
- "priority": 0
- }
- }
- ],
- "visible": true
- },
- {
- "id": 1,
- "name": "Background",
- "parent": null,
- "children": [],
- "components": [
- {
- "type": "Transform",
- "data": {
- "position": {
- "x": 0,
- "y": 0,
- "z": -1
- }
- }
- },
- {
- "type": "Sprite",
- "data": {
- "texture": "@uuid:78c53bf7-88b8-481d-805c-a443c2d06076",
- "size": {
- "x": 600,
- "y": 1080
- },
- "layer": -1
- }
- }
- ],
- "visible": true
- },
- {
- "id": 2,
- "name": "Player",
- "parent": null,
- "children": [],
- "components": [
- {
- "type": "Transform",
- "data": {
- "position": {
- "x": 0,
- "y": -420,
- "z": 0
- }
- }
- },
- {
- "type": "Sprite",
- "data": {
- "texture": "@uuid:92f1ab5f-28f4-4b95-bb82-7182fdb33494",
- "size": {
- "x": 64,
- "y": 64
- }
- }
- },
- {
- "type": "Player",
- "data": {
- "speed": 400
- }
- },
- {
- "type": "Health",
- "data": {
- "value": 3,
- "maxValue": 3
- }
- }
- ],
- "visible": true
- },
- {
- "id": 10,
- "name": "HUD",
- "parent": null,
- "children": [
- 11,
- 12,
- 13,
- 14,
- 15
- ],
- "components": [
- {
- "type": "Transform",
- "data": {}
- },
- {
- "type": "Canvas",
- "data": {
- "designResolution": {
- "x": 600,
- "y": 1080
- },
- "scaleMode": 2
- }
- },
- {
- "type": "UINode",
- "data": {}
- }
- ],
- "visible": true
- },
- {
- "id": 11,
- "name": "ScoreText",
- "parent": 10,
- "children": [],
- "components": [
- {
- "type": "Transform",
- "data": {}
- },
- {
- "type": "UINode",
- "data": {
- "position": 1,
- "width": {
- "value": 200.0,
- "unit": 0
- },
- "insetLeft": {
- "value": 0.0,
- "unit": 1
- },
- "marginLeft": {
- "value": 20.0,
- "unit": 0
- },
- "height": {
- "value": 40.0,
- "unit": 0
- },
- "insetTop": {
- "value": 0.0,
- "unit": 1
- },
- "marginTop": {
- "value": 40.0,
- "unit": 0
- }
- }
- },
- {
- "type": "Text",
- "data": {
- "content": "SCORE: 0",
- "fontSize": 28,
- "color": {
- "r": 0,
- "g": 0.86,
- "b": 1,
- "a": 1
- },
- "align": 0,
- "verticalAlign": 0
- }
- },
- {
- "type": "ScoreDisplay",
- "data": {}
- }
- ],
- "visible": true
- },
- {
- "id": 12,
- "name": "Heart1",
- "parent": 10,
- "children": [],
- "components": [
- {
- "type": "Transform",
- "data": {
- "position": {
- "x": 216,
- "y": 520,
- "z": 0
- }
- }
- },
- {
- "type": "UINode",
- "data": {
- "position": 1,
- "width": {
- "value": 24.0,
- "unit": 0
- },
- "insetLeft": {
- "value": 100.0,
- "unit": 1
- },
- "marginLeft": {
- "value": -108.0,
- "unit": 0
- },
- "height": {
- "value": 24.0,
- "unit": 0
- },
- "insetTop": {
- "value": 0.0,
- "unit": 1
- },
- "marginTop": {
- "value": 20.0,
- "unit": 0
- }
- }
- },
- {
- "type": "UIVisual",
- "data": {
- "visualType": 2,
- "texture": "@uuid:5b21b6a6-dffa-4256-872a-36f4e4549408",
- "color": {
- "r": 1,
- "g": 1,
- "b": 1,
- "a": 1
- }
- }
- },
- {
- "type": "HealthHeart",
- "data": {}
- }
- ],
- "visible": true
- },
- {
- "id": 13,
- "name": "Heart2",
- "parent": 10,
- "children": [],
- "components": [
- {
- "type": "Transform",
- "data": {
- "position": {
- "x": 248,
- "y": 520,
- "z": 0
- }
- }
- },
- {
- "type": "UINode",
- "data": {
- "position": 1,
- "width": {
- "value": 24.0,
- "unit": 0
- },
- "insetLeft": {
- "value": 100.0,
- "unit": 1
- },
- "marginLeft": {
- "value": -76.0,
- "unit": 0
- },
- "height": {
- "value": 24.0,
- "unit": 0
- },
- "insetTop": {
- "value": 0.0,
- "unit": 1
- },
- "marginTop": {
- "value": 20.0,
- "unit": 0
- }
- }
- },
- {
- "type": "UIVisual",
- "data": {
- "visualType": 2,
- "texture": "@uuid:5b21b6a6-dffa-4256-872a-36f4e4549408",
- "color": {
- "r": 1,
- "g": 1,
- "b": 1,
- "a": 1
- }
- }
- },
- {
- "type": "HealthHeart",
- "data": {}
- }
- ],
- "visible": true
- },
- {
- "id": 14,
- "name": "Heart3",
- "parent": 10,
- "children": [],
- "components": [
- {
- "type": "Transform",
- "data": {
- "position": {
- "x": 280,
- "y": 520,
- "z": 0
- }
- }
- },
- {
- "type": "UINode",
- "data": {
- "position": 1,
- "width": {
- "value": 24.0,
- "unit": 0
- },
- "insetLeft": {
- "value": 100.0,
- "unit": 1
- },
- "marginLeft": {
- "value": -44.0,
- "unit": 0
- },
- "height": {
- "value": 24.0,
- "unit": 0
- },
- "insetTop": {
- "value": 0.0,
- "unit": 1
- },
- "marginTop": {
- "value": 20.0,
- "unit": 0
- }
- }
- },
- {
- "type": "UIVisual",
- "data": {
- "visualType": 2,
- "texture": "@uuid:5b21b6a6-dffa-4256-872a-36f4e4549408",
- "color": {
- "r": 1,
- "g": 1,
- "b": 1,
- "a": 1
- }
- }
- },
- {
- "type": "HealthHeart",
- "data": {}
- }
- ],
- "visible": true
- },
- {
- "id": 15,
- "name": "GameOverText",
- "parent": 10,
- "children": [],
- "components": [
- {
- "type": "Transform",
- "data": {}
- },
- {
- "type": "UINode",
- "data": {
- "position": 1,
- "width": {
- "value": 400.0,
- "unit": 0
- },
- "insetLeft": {
- "value": 50.0,
- "unit": 1
- },
- "marginLeft": {
- "value": -200.0,
- "unit": 0
- },
- "height": {
- "value": 120.0,
- "unit": 0
- },
- "insetTop": {
- "value": 50.0,
- "unit": 1
- },
- "marginTop": {
- "value": -60.0,
- "unit": 0
- }
- }
- },
- {
- "type": "Text",
- "data": {
- "content": "",
- "fontSize": 36,
- "color": {
- "r": 1,
- "g": 0.24,
- "b": 0.24,
- "a": 1
- },
- "align": 1,
- "verticalAlign": 1
- }
- },
- {
- "type": "GameOverScreen",
- "data": {}
- }
- ],
- "visible": true
- }
- ]
-}
diff --git a/tools/check-fixture-scenes.mjs b/tools/check-fixture-scenes.mjs
new file mode 100644
index 000000000..af9dac2fe
--- /dev/null
+++ b/tools/check-fixture-scenes.mjs
@@ -0,0 +1,73 @@
+#!/usr/bin/env node
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
+/**
+ * @file check-fixture-scenes.mjs
+ * @brief Every fixture scene must be driven by something.
+ * @details A fixture with no criterion behind it is the shape a deleted gate
+ * leaves: coverage looks whole because the scene is still there. The
+ * four ShadowCaster2D scenes sat like that, so 2D shadows had no pixel
+ * criterion at all.
+ *
+ * Run: node tools/check-fixture-scenes.mjs (exit 1 on an undriven fixture)
+ */
+import { readFileSync, readdirSync } from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { listTrackedSources } from './lib/sourceRoots.mjs';
+
+const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
+const SCENES = 'fixtures/scenes';
+
+/**
+ * Fixtures kept without a criterion, and why. Empty is the intended state: an
+ * entry here is a scene someone drew and nothing looks at.
+ */
+const UNDRIVEN = {
+ 'ui-layout.esscene': 'flex layout across 25 nodes — no criterion since the layout gates moved to the editor checks',
+ 'ui-node-absolute.esscene': 'absolute positioning inside a flex parent; see ui-layout',
+ 'ui-text-effects.esscene': 'outline / shadow text styling; see ui-layout',
+ 'ui-text-uinode.esscene': 'text sized by its UINode box; see ui-layout',
+ 'ui-text-zorder.esscene': 'text drawn over and under its siblings; see ui-layout',
+ 'ui-textinput.esscene': 'a focused TextInput with a caret; see ui-layout',
+ 'ktx2-orientation.esscene': 'whether a transcoded KTX2 arrives the right way up — the ktx2 criterion checks colour, not orientation',
+ 'parallax-control.esscene': 'a sprite parallax factor driven per axis',
+ 'pixel-perfect.esscene': 'a texture sampled 1:1 at an integer camera position',
+};
+
+const drivers = [];
+const { files, missing } = listTrackedSources(['tools', 'desktop/scripts']);
+if (missing.length) {
+ console.log(`check-fixture-scenes: no editor checkout — ${missing.join(', ')} not scanned for drivers.`);
+}
+const SELF = 'tools/check-fixture-scenes.mjs';
+for (const f of files) {
+ if (!/\.(mjs|js|ts)$/.test(f)) continue;
+ // Not this file: it names every undriven scene below, so counting itself
+ // would make each of them look driven the moment it entered the index.
+ if (f === SELF) continue;
+ drivers.push(readFileSync(path.join(ROOT, f), 'utf8'));
+}
+
+const scenes = readdirSync(path.join(ROOT, SCENES)).filter((f) => f.endsWith('.esscene'));
+const undriven = scenes.filter((s) => !drivers.some((t) => t.includes(s)));
+const problems = [];
+for (const s of undriven) {
+ if (!UNDRIVEN[s]) problems.push(` ${SCENES}/${s} — nothing drives it`);
+}
+for (const declared of Object.keys(UNDRIVEN)) {
+ if (!undriven.includes(declared)) {
+ problems.push(` UNDRIVEN names ${declared}, which something drives now — drop the entry`);
+ }
+}
+
+if (problems.length > 0) {
+ console.error('Fixture scenes and the criteria that drive them disagree:\n');
+ console.error(problems.join('\n'));
+ console.error(`\nGive it a criterion (tools/renderScenes.mjs, an editor check) or record it in`
+ + ' UNDRIVEN with what it would prove.');
+ process.exit(1);
+}
+
+console.log(`check-fixture-scenes: ${scenes.length} fixture scene(s), ${scenes.length - undriven.length}`
+ + ` driven by a criterion; ${undriven.length} declared undriven.`);
diff --git a/tools/gates.mjs b/tools/gates.mjs
index f18fc6d61..5c51c65fb 100644
--- a/tools/gates.mjs
+++ b/tools/gates.mjs
@@ -33,6 +33,7 @@ export const GATES = [
{ id: 'draw-command-boundary', run: 'node tools/check-draw-command-boundary.mjs' },
{ id: 'sidemodule-gates', run: 'node tools/check-sidemodule-gates.mjs' },
{ id: 'engine-exports', run: 'node tools/check-engine-exports.mjs' },
+ { id: 'fixture-scenes', run: 'node tools/check-fixture-scenes.mjs' },
{
id: 'native-bindings',
run: 'node tools/check-native-bindings.mjs',
diff --git a/tools/renderScenes.mjs b/tools/renderScenes.mjs
index 7d16d4e6d..eb14e126b 100644
--- a/tools/renderScenes.mjs
+++ b/tools/renderScenes.mjs
@@ -226,6 +226,16 @@ export const SCENES = [
{ id: "material-instance", tier: "nightly", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mat-instance.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mat-instance.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":40}]" } },
{ id: "material-texture", tier: "nightly", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mat-tex.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mat-tex.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":50}]" } },
{ id: "material-switch", tier: "nightly", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mat-sw.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mat-sw.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.25,\"y\":0.5,\"rgb\":[255,0,0],\"tol\":50},{\"x\":0.75,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":50}]" } },
+ // 2D shadows: a ShadowCaster2D box between a light and a lit surface. The
+ // probes sit either side of the wall on the light's axis — lit where the
+ // light reaches, dark where the box is in the way.
+ { id: "shadow2d-point", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mat-lit-shadow.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mat-lit-shadow.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.25,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":60},{\"x\":0.75,\"y\":0.5,\"rgb\":[0,0,0],\"tol\":40}]" } },
+ { id: "shadow2d-hard", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mat-lit-shadow-hard.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mat-lit-shadow-hard.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.25,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":60},{\"x\":0.75,\"y\":0.5,\"rgb\":[0,0,0],\"tol\":40}]" } },
+ { id: "shadow2d-soft", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mat-lit-shadow-soft.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mat-lit-shadow-soft.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.25,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":60},{\"x\":0.75,\"y\":0.5,\"rgb\":[0,0,0],\"tol\":40}]" } },
+ // This scene names its light's aim as `direction`, so the criterion covers the
+ // light-aim migration in a real frame too. Lit at 180, not 255: a directional
+ // light carries its Lambert term.
+ { id: "shadow2d-directional", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mat-lit-shadow-dir.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mat-lit-shadow-dir.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.25,\"y\":0.5,\"rgb\":[0,180,0],\"tol\":40},{\"x\":0.75,\"y\":0.5,\"rgb\":[0,0,0],\"tol\":40}]" } },
{ id: "material-lit", tier: "nightly", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mat-lit.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mat-lit.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":50}]" } },
{ id: "material-lit-point", tier: "pr", webgpu: { ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.5,\"rgb\":[0,253,0],\"tol\":25},{\"x\":0.75,\"y\":0.5,\"rgb\":[0,52,0],\"tol\":25}]" }, env: { ESTELLA_VERIFY_SCENE: "/scenes/mat-lit-point.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mat-lit-point.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":50},{\"x\":0.75,\"y\":0.5,\"rgb\":[0,64,0],\"tol\":60}]" } },
{ id: "material-lit-normal", tier: "nightly", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/mat-lit-normal.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/mat-lit-normal.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.333,\"y\":0.5,\"rgb\":[0,252,0],\"tol\":45},{\"x\":0.667,\"y\":0.5,\"rgb\":[0,36,0],\"tol\":50}]" } },