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.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
test(gates): a scene holds open what the two backends disagree about behind a camera
yhh5b0a179dd488
diff --git a/desktop/public/scenes/ortho-clip-behind-camera.esscene b/desktop/public/scenes/ortho-clip-behind-camera.esscenenew file mode 100644index 000000000..a1d893523--- /dev/null+++ b/desktop/public/scenes/ortho-clip-behind-camera.esscene@@ -0,0 +1,27 @@+{+ "version": 1,+ "name": "OrthoClipBehindCamera",+ "entities": [+ {+ "id": 0, "name": "Camera", "parent": null, "children": [], "visible": true,+ "components": [+ { "type": "Transform", "data": { "position": { "x": 0, "y": 0, "z": 0 } } },+ { "type": "Camera", "data": { "projectionType": 1, "orthoSize": 300, "isActive": true, "priority": 0 } }+ ]+ },+ {+ "id": 1, "name": "OnPlane", "parent": null, "children": [], "visible": true,+ "components": [+ { "type": "Transform", "data": { "position": { "x": -120, "y": 0, "z": 0 } } },+ { "type": "Sprite", "data": { "size": { "x": 160, "y": 160 }, "color": { "r": 1, "g": 0, "b": 0, "a": 1 }, "enabled": true } }+ ]+ },+ {+ "id": 2, "name": "BehindPlane", "parent": null, "children": [], "visible": true,+ "components": [+ { "type": "Transform", "data": { "position": { "x": 120, "y": 0, "z": 1 } } },+ { "type": "Sprite", "data": { "size": { "x": 160, "y": 160 }, "color": { "r": 0, "g": 1, "b": 0, "a": 1 }, "enabled": true } }+ ]+ }+ ]+}diff --git a/desktop/public/scenes/ortho-clip-behind-camera.textures.json b/desktop/public/scenes/ortho-clip-behind-camera.textures.jsonnew file mode 100644index 000000000..0967ef424--- /dev/null+++ b/desktop/public/scenes/ortho-clip-behind-camera.textures.json@@ -0,0 +1 @@+{}diff --git a/tools/renderScenes.mjs b/tools/renderScenes.mjsindex fe7d5480d..9f74865ee 100644--- a/tools/renderScenes.mjs+++ b/tools/renderScenes.mjs@@ -255,6 +255,10 @@ export const SCENES = [// last, seen from an eye turned -60° about Y. Equal world z ties, and the tie puts// the FAR quad on top; only a viewer-measured depth puts the near (green) one there.{ id: "sort-view-depth", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_ORBIT: "-60,0", ESTELLA_VERIFY_SCENE: "/scenes/sort-view-depth.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/sort-view-depth.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.5,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":40},{\"x\":0.30,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":40},{\"x\":0.70,\"y\":0.5,\"rgb\":[255,0,0],\"tol\":40}]" } },+ // KNOWN RED ON WEBGPU: a sprite at z = +1 under an ortho camera at z = 0 is inside the+ // symmetric box mat4.ts builds and below 0 of what WebGPU clips to. RenderFrame.cpp:954+ // dodges this for shadows; a camera cannot, and celestial-heights' HealthBar_Fill is there.+ { id: "ortho-clip-behind-camera", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/ortho-clip-behind-camera.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/ortho-clip-behind-camera.textures.json", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.30,\"y\":0.5,\"rgb\":[255,0,0],\"tol\":40},{\"x\":0.70,\"y\":0.5,\"rgb\":[0,255,0],\"tol\":40}]" } },// Two quads crossing: one flat, one turned 60° about Y, so each is nearer on// one side. Painter's order cannot draw that — with `opaque` the halves resolve// by depth (left green, right red), and without it the later draw takes both.