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(gates): what the 2D shadow claimed and nothing measured

esengine4283dd1c6fa0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5f3787721..55e497d63 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -60,6 +60,11 @@ published separately; it ships inside the editor.
which costs a sprite batch one merge slot in a scene that has 2D shadows and nothing at
all in one that does not.
+ KNOWN GAP: on the WebGPU backend a scene with more than one casting light loses the
+ shadows of some of them — the lights still light it, and one casting light is correct
+ on both backends. WebGL2 is correct throughout. Documented under the lighting guide's
+ Known gaps; the criterion that shows it runs on WebGL2 only and says why.
+
- **One curve, sampled by everything that has one.** A timeline channel carried keys
with tangents and six interpolations, drawn by an editor that understood them; a
particle's size-over-life carried `{t, v}` pairs joined by straight lines; and the
diff --git a/docs/astro/src/content/docs/graphics/lighting.mdx b/docs/astro/src/content/docs/graphics/lighting.mdx
index 9090938bf..72bebc858 100644
--- a/docs/astro/src/content/docs/graphics/lighting.mdx
+++ b/docs/astro/src/content/docs/graphics/lighting.mdx
@@ -290,6 +290,13 @@ saying something about its art direction; the fix is to turn shadows off (`shado
of 0 on a sun, or a smaller `radius` that takes a light out of view) on the ones whose
shadows nobody looks at.
+### Known gaps
+
+- **WebGPU, more than one casting light.** On the WebGPU backend a scene with two or
+ more shadow-casting lights loses the shadows of some of them; the lights still light
+ it. One casting light is correct on both backends, and WebGL2 is correct throughout.
+ The criterion that shows it (`shadow2d-light-cap`) runs on WebGL2 only, and says so.
+
## Linear color space
By default the engine renders **gamma-space** — colors blend as-authored, the way 2D
diff --git a/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdx b/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdx
index d819990f6..fc1443342 100644
--- a/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdx
+++ b/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdx
@@ -270,6 +270,12 @@ cmds.spawn()
处理办法是把没人会看那道影子的光关掉阴影(太阳的 `shadowDistance` 设 0,或者用更小的 `radius`
让某个光离开视野)。
+### 已知缺口
+
+- **WebGPU 上,投射光多于一个时**:同屏有两个及以上投射阴影的光时,WebGPU 后端会丢掉其中一部分光的
+ 阴影(光本身照常照亮)。**一个投射光在两个后端都正确**,WebGL2 全程正确。能暴露它的判据
+ (`shadow2d-light-cap`)只在 WebGL2 上跑,并在注册表里注明了原因。
+
## 线性色彩空间
引擎默认以**伽马空间**渲染——颜色按作者所写直接混合,这是 2D 管线的经典方式。项目可以切换到
diff --git a/fixtures/scenes/shadow2d-light-cap.esscene b/fixtures/scenes/shadow2d-light-cap.esscene
new file mode 100644
index 000000000..fd501b23b
--- /dev/null
+++ b/fixtures/scenes/shadow2d-light-cap.esscene
@@ -0,0 +1,384 @@
+{
+ "version": 4,
+ "name": "Main",
+ "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": 500,
+ "isActive": true,
+ "priority": 0
+ }
+ }
+ ]
+ },
+ {
+ "id": 1,
+ "name": "Floor",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Sprite",
+ "data": {
+ "size": {
+ "x": 200,
+ "y": 1000
+ },
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "material": "/scenes/mat-lit/lit.esmaterial"
+ }
+ }
+ ]
+ },
+ {
+ "id": 2,
+ "name": "Wall-400",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": -400,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 16,
+ "y": 120
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 3,
+ "name": "Wall-200",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": -200,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 16,
+ "y": 120
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 4,
+ "name": "Wall200",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 200,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 16,
+ "y": 120
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 5,
+ "name": "Wall400",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 400,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 16,
+ "y": 120
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 6,
+ "name": "Wall0",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 16,
+ "y": 120
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 7,
+ "name": "Light-400",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -60,
+ "y": -400,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 0,
+ "g": 1,
+ "b": 0,
+ "a": 1
+ },
+ "intensity": 1,
+ "radius": 150,
+ "shadowSoftness": 0
+ }
+ }
+ ]
+ },
+ {
+ "id": 8,
+ "name": "Light-200",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -60,
+ "y": -200,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 0,
+ "g": 1,
+ "b": 0,
+ "a": 1
+ },
+ "intensity": 1,
+ "radius": 150,
+ "shadowSoftness": 0
+ }
+ }
+ ]
+ },
+ {
+ "id": 9,
+ "name": "Light200",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -60,
+ "y": 200,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 0,
+ "g": 1,
+ "b": 0,
+ "a": 1
+ },
+ "intensity": 1,
+ "radius": 150,
+ "shadowSoftness": 0
+ }
+ }
+ ]
+ },
+ {
+ "id": 10,
+ "name": "Light400",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -60,
+ "y": 400,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 0,
+ "g": 1,
+ "b": 0,
+ "a": 1
+ },
+ "intensity": 1,
+ "radius": 150,
+ "shadowSoftness": 0
+ }
+ }
+ ]
+ },
+ {
+ "id": 11,
+ "name": "Light0",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -60,
+ "y": 0,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 0,
+ "g": 1,
+ "b": 0,
+ "a": 1
+ },
+ "intensity": 1,
+ "radius": 150,
+ "shadowSoftness": 0
+ }
+ }
+ ]
+ }
+ ]
+}
diff --git a/fixtures/scenes/shadow2d-light-cap.textures.json b/fixtures/scenes/shadow2d-light-cap.textures.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/fixtures/scenes/shadow2d-light-cap.textures.json
@@ -0,0 +1 @@
+{}
diff --git a/fixtures/scenes/shadow2d-load.esscene b/fixtures/scenes/shadow2d-load.esscene
new file mode 100644
index 000000000..c96b15d74
--- /dev/null
+++ b/fixtures/scenes/shadow2d-load.esscene
@@ -0,0 +1,3105 @@
+{
+ "version": 4,
+ "name": "Main",
+ "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": 600,
+ "isActive": true,
+ "priority": 0
+ }
+ }
+ ]
+ },
+ {
+ "id": 1,
+ "name": "Floor",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Sprite",
+ "data": {
+ "size": {
+ "x": 2400,
+ "y": 2400
+ },
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "material": "/scenes/mat-lit/lit.esmaterial"
+ }
+ }
+ ]
+ },
+ {
+ "id": 2,
+ "name": "Light0",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -500,
+ "y": -500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 0.4,
+ "g": 1,
+ "b": 0.4,
+ "a": 1
+ },
+ "intensity": 0.8,
+ "radius": 1800,
+ "shadowSoftness": 30
+ }
+ }
+ ]
+ },
+ {
+ "id": 3,
+ "name": "Light1",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 500,
+ "y": -500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 0.4,
+ "g": 1,
+ "b": 0.4,
+ "a": 1
+ },
+ "intensity": 0.8,
+ "radius": 1800,
+ "shadowSoftness": 30
+ }
+ }
+ ]
+ },
+ {
+ "id": 4,
+ "name": "Light2",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -500,
+ "y": 500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 0.4,
+ "g": 1,
+ "b": 0.4,
+ "a": 1
+ },
+ "intensity": 0.8,
+ "radius": 1800,
+ "shadowSoftness": 30
+ }
+ }
+ ]
+ },
+ {
+ "id": 5,
+ "name": "Light3",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 500,
+ "y": 500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 0.4,
+ "g": 1,
+ "b": 0.4,
+ "a": 1
+ },
+ "intensity": 0.8,
+ "radius": 1800,
+ "shadowSoftness": 30
+ }
+ }
+ ]
+ },
+ {
+ "id": 6,
+ "name": "Wall0",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -900,
+ "y": -900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 7,
+ "name": "Wall1",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -700,
+ "y": -900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 8,
+ "name": "Wall2",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -500,
+ "y": -900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 9,
+ "name": "Wall3",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -300,
+ "y": -900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 10,
+ "name": "Wall4",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -100,
+ "y": -900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 11,
+ "name": "Wall5",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 100,
+ "y": -900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 12,
+ "name": "Wall6",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 300,
+ "y": -900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 13,
+ "name": "Wall7",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 500,
+ "y": -900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 14,
+ "name": "Wall8",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 700,
+ "y": -900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 15,
+ "name": "Wall9",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 900,
+ "y": -900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 16,
+ "name": "Wall10",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -900,
+ "y": -700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 17,
+ "name": "Wall11",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -700,
+ "y": -700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 18,
+ "name": "Wall12",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -500,
+ "y": -700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 19,
+ "name": "Wall13",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -300,
+ "y": -700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 20,
+ "name": "Wall14",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -100,
+ "y": -700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 21,
+ "name": "Wall15",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 100,
+ "y": -700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 22,
+ "name": "Wall16",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 300,
+ "y": -700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 23,
+ "name": "Wall17",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 500,
+ "y": -700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 24,
+ "name": "Wall18",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 700,
+ "y": -700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 25,
+ "name": "Wall19",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 900,
+ "y": -700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 26,
+ "name": "Wall20",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -900,
+ "y": -500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 27,
+ "name": "Wall21",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -700,
+ "y": -500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 28,
+ "name": "Wall22",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -500,
+ "y": -500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 29,
+ "name": "Wall23",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -300,
+ "y": -500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 30,
+ "name": "Wall24",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -100,
+ "y": -500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 31,
+ "name": "Wall25",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 100,
+ "y": -500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 32,
+ "name": "Wall26",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 300,
+ "y": -500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 33,
+ "name": "Wall27",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 500,
+ "y": -500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 34,
+ "name": "Wall28",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 700,
+ "y": -500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 35,
+ "name": "Wall29",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 900,
+ "y": -500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 36,
+ "name": "Wall30",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -900,
+ "y": -300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 37,
+ "name": "Wall31",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -700,
+ "y": -300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 38,
+ "name": "Wall32",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -500,
+ "y": -300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 39,
+ "name": "Wall33",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -300,
+ "y": -300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 40,
+ "name": "Wall34",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -100,
+ "y": -300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 41,
+ "name": "Wall35",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 100,
+ "y": -300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 42,
+ "name": "Wall36",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 300,
+ "y": -300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 43,
+ "name": "Wall37",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 500,
+ "y": -300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 44,
+ "name": "Wall38",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 700,
+ "y": -300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 45,
+ "name": "Wall39",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 900,
+ "y": -300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 46,
+ "name": "Wall40",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -900,
+ "y": -100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 47,
+ "name": "Wall41",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -700,
+ "y": -100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 48,
+ "name": "Wall42",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -500,
+ "y": -100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 49,
+ "name": "Wall43",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -300,
+ "y": -100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 50,
+ "name": "Wall44",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -100,
+ "y": -100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 51,
+ "name": "Wall45",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 100,
+ "y": -100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 52,
+ "name": "Wall46",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 300,
+ "y": -100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 53,
+ "name": "Wall47",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 500,
+ "y": -100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 54,
+ "name": "Wall48",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 700,
+ "y": -100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 55,
+ "name": "Wall49",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 900,
+ "y": -100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 56,
+ "name": "Wall50",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -900,
+ "y": 100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 57,
+ "name": "Wall51",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -700,
+ "y": 100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 58,
+ "name": "Wall52",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -500,
+ "y": 100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 59,
+ "name": "Wall53",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -300,
+ "y": 100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 60,
+ "name": "Wall54",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -100,
+ "y": 100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 61,
+ "name": "Wall55",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 100,
+ "y": 100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 62,
+ "name": "Wall56",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 300,
+ "y": 100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 63,
+ "name": "Wall57",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 500,
+ "y": 100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 64,
+ "name": "Wall58",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 700,
+ "y": 100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 65,
+ "name": "Wall59",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 900,
+ "y": 100,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 66,
+ "name": "Wall60",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -900,
+ "y": 300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 67,
+ "name": "Wall61",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -700,
+ "y": 300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 68,
+ "name": "Wall62",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -500,
+ "y": 300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 69,
+ "name": "Wall63",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -300,
+ "y": 300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 70,
+ "name": "Wall64",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -100,
+ "y": 300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 71,
+ "name": "Wall65",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 100,
+ "y": 300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 72,
+ "name": "Wall66",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 300,
+ "y": 300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 73,
+ "name": "Wall67",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 500,
+ "y": 300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 74,
+ "name": "Wall68",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 700,
+ "y": 300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 75,
+ "name": "Wall69",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 900,
+ "y": 300,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 76,
+ "name": "Wall70",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -900,
+ "y": 500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 77,
+ "name": "Wall71",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -700,
+ "y": 500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 78,
+ "name": "Wall72",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -500,
+ "y": 500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 79,
+ "name": "Wall73",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -300,
+ "y": 500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 80,
+ "name": "Wall74",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -100,
+ "y": 500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 81,
+ "name": "Wall75",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 100,
+ "y": 500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 82,
+ "name": "Wall76",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 300,
+ "y": 500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 83,
+ "name": "Wall77",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 500,
+ "y": 500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 84,
+ "name": "Wall78",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 700,
+ "y": 500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 85,
+ "name": "Wall79",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 900,
+ "y": 500,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 86,
+ "name": "Wall80",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -900,
+ "y": 700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 87,
+ "name": "Wall81",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -700,
+ "y": 700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 88,
+ "name": "Wall82",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -500,
+ "y": 700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 89,
+ "name": "Wall83",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -300,
+ "y": 700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 90,
+ "name": "Wall84",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -100,
+ "y": 700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 91,
+ "name": "Wall85",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 100,
+ "y": 700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 92,
+ "name": "Wall86",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 300,
+ "y": 700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 93,
+ "name": "Wall87",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 500,
+ "y": 700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 94,
+ "name": "Wall88",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 700,
+ "y": 700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 95,
+ "name": "Wall89",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 900,
+ "y": 700,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 96,
+ "name": "Wall90",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -900,
+ "y": 900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 97,
+ "name": "Wall91",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -700,
+ "y": 900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 98,
+ "name": "Wall92",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -500,
+ "y": 900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 99,
+ "name": "Wall93",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -300,
+ "y": 900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 100,
+ "name": "Wall94",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -100,
+ "y": 900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 101,
+ "name": "Wall95",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 100,
+ "y": 900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 102,
+ "name": "Wall96",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 300,
+ "y": 900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 103,
+ "name": "Wall97",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 500,
+ "y": 900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 104,
+ "name": "Wall98",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 700,
+ "y": 900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 105,
+ "name": "Wall99",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 900,
+ "y": 900,
+ "z": 0
+ }
+ }
+ },
+ {
+ "type": "ShadowCaster2D",
+ "data": {
+ "size": {
+ "x": 40,
+ "y": 40
+ },
+ "enabled": true
+ }
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/fixtures/scenes/shadow2d-load.textures.json b/fixtures/scenes/shadow2d-load.textures.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/fixtures/scenes/shadow2d-load.textures.json
@@ -0,0 +1 @@
+{}
diff --git a/pipeline/tests/aseprite-import.test.ts b/pipeline/tests/aseprite-import.test.ts
index b4602cbdf..df6480d01 100644
--- a/pipeline/tests/aseprite-import.test.ts
+++ b/pipeline/tests/aseprite-import.test.ts
@@ -65,6 +65,28 @@ describe('importAseprite', () => {
expect(sheetPixels(importAseprite(doc, 'x').sheet.bytes).at(0, 0)).toEqual([128, 128, 128, 255]);
});
+ // Each pair is chosen so the answer differs from source-over: a mode agreeing with
+ // plain stacking on its inputs is a case that would pass unimplemented.
+ it.each([
+ ['multiply', 1, 128, 128, [64, 64, 64]],
+ ['screen', 2, 128, 128, [192, 192, 192]],
+ ['difference', 10, 128, 128, [0, 0, 0]],
+ ['addition', 16, 128, 128, [255, 255, 255]],
+ ['darken', 4, 64, 200, [64, 64, 64]],
+ ['lighten', 5, 200, 64, [200, 200, 200]],
+ ])('composites a %s layer the way the editor does', (_name, blend, back, front, want) => {
+ const doc = writeAseprite({
+ width: 1, height: 1,
+ layers: [{ name: 'bg' }, { name: 'fg', blend: blend as number }],
+ frames: [{ duration: 100, cels: [
+ { layer: 0, x: 0, y: 0, w: 1, h: 1, pixels: [back, back, back, 255] as number[] },
+ { layer: 1, x: 0, y: 0, w: 1, h: 1, pixels: [front, front, front, 255] as number[] },
+ ] }],
+ });
+ const px = sheetPixels(importAseprite(doc, 'x').sheet.bytes).at(0, 0);
+ expect([px[0], px[1], px[2]]).toEqual(want);
+ });
+
it('hides everything inside a group the artist turned off', () => {
const doc = writeAseprite({
width: 1, height: 1,
diff --git a/src/esengine/renderer/frame/RenderFrameShadow2D.cpp b/src/esengine/renderer/frame/RenderFrameShadow2D.cpp
index b5c3ec6a8..124234809 100644
--- a/src/esengine/renderer/frame/RenderFrameShadow2D.cpp
+++ b/src/esengine/renderer/frame/RenderFrameShadow2D.cpp
@@ -14,6 +14,7 @@
#include "../../ecs/components/ShadowCaster2D.hpp"
#include "../../resource/ShaderParser.hpp"
#include "../rhi/ShaderEmbeds.generated.hpp"
+#include "../../core/FrameProfiler.hpp"
#include <algorithm>
#include <cmath>
@@ -172,7 +173,12 @@ inline glm::vec2 extrude(const glm::vec2& p, const glm::vec2& from, f32 reach) {
} // namespace
void RenderFrame::buildShadow2DGeometry() {
+ ES_PROFILE_SCOPE("render.shadow2d.geometry");
shadow_2d_vertices_.clear();
+ // One silhouette is two triangles, and the worst case is every ring seen by every
+ // sample of every light. Reserved once so the frame's growth is not a re-alloc.
+ shadow_2d_vertices_.reserve(shadow_rings_2d_.size() * shadow_2d_lights_.size()
+ * kSoftSamples * 6 * kShadow2DFloats);
auto vertex = [this](const glm::vec2& p, f32 shadow, u32 channel) {
shadow_2d_vertices_.push_back(p.x);
@@ -208,6 +214,19 @@ void RenderFrame::buildShadow2DGeometry() {
for (u32 i = 0; i < ring.count; ++i) centre += pts[i];
centre /= static_cast<f32>(ring.count);
+ // What a light cannot reach it cannot be hidden from: past its own reach it
+ // contributes nothing, so an occluder out there has no shadow to draw. Costs
+ // one distance per ring and saves every triangle behind it.
+ if (!light.directional) {
+ f32 radius = 0.0f;
+ for (u32 i = 0; i < ring.count; ++i) {
+ radius = std::max(radius, glm::distance(pts[i], centre));
+ }
+ if (glm::distance(centre, light.pos) > light.reach + light.softness + radius) {
+ continue;
+ }
+ }
+
for (u32 s = 0; s < samples; ++s) {
const f32 t = offsetOf(s);
if (light.directional) {
@@ -277,7 +296,14 @@ void RenderFrame::executeShadow2DPass() {
if (shadow_2d_resource_ == rg::kNoResource) return;
if (!ensureShadow2DShader()) return;
+ ES_PROFILE_SCOPE("render.shadow2d");
buildShadow2DGeometry();
+ // What the mask cost, in the unit it is spent in: a shadow is triangles now, and
+ // neither the count nor the occluders behind it shows in a pixel.
+ ES_PROFILE_COUNTER("render.shadow2d.triangles",
+ static_cast<u32>(shadow_2d_vertices_.size() / (kShadow2DFloats * 3)));
+ ES_PROFILE_COUNTER("render.shadow2d.occluders", static_cast<u32>(shadow_rings_2d_.size()));
+ ES_PROFILE_COUNTER("render.shadow2d.lights", static_cast<u32>(shadow_2d_lights_.size()));
if (shadow_2d_vertices_.empty()) return;
const u32 bytes = static_cast<u32>(shadow_2d_vertices_.size() * sizeof(f32));
diff --git a/tools/renderScenes.mjs b/tools/renderScenes.mjs
index 9ec322bda..3efed1d63 100644
--- a/tools/renderScenes.mjs
+++ b/tools/renderScenes.mjs
@@ -560,6 +560,14 @@ export const SCENES = [
// material sampler — so a recovered material sampling every texture from unit
// 0 looked exactly like one with no normal map, and nothing could tell.
{ id: "device-loss-material", tier: "pr", env: { ESTELLA_VERIFY_DEVICE_LOSS: "1", 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}]" } },
+ // A hundred occluders and four lights with width, which the analytic path could not
+ // have held: the counters are the capacity, the criteria above are the correctness.
+ // 0.64ms of a frame here against 0.057ms with the casters off.
+ { id: "shadow2d-load", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_PLAY: "1", ESTELLA_VERIFY_SCENE: "/scenes/shadow2d-load.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/shadow2d-load.textures.json", ESTELLA_VERIFY_W: "1280", ESTELLA_VERIFY_H: "720", ESTELLA_VERIFY_STEPS: "6", ESTELLA_VERIFY_COUNTERS: "{\"render.shadow2d.occluders\":100,\"render.shadow2d.lights\":4}" } },
+ // Five lights that want to cast and a mask with four channels: the fifth goes
+ // without, which is a lit floor rather than a dark one. WebGL2 only — WebGPU loses
+ // some shadows once more than one light casts (docs/graphics/lighting: Known gaps).
+ { id: "shadow2d-light-cap", tier: "pr", env: { ESTELLA_VERIFY_PLAY: "1", ESTELLA_VERIFY_SCENE: "/scenes/shadow2d-light-cap.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/shadow2d-light-cap.textures.json", ESTELLA_VERIFY_W: "200", ESTELLA_VERIFY_H: "1000", ESTELLA_VERIFY_STEPS: "4", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.70,\"y\":0.1,\"rgb\":[0,0,0],\"tol\":40},{\"x\":0.70,\"y\":0.3,\"rgb\":[0,0,0],\"tol\":40},{\"x\":0.70,\"y\":0.7,\"rgb\":[0,0,0],\"tol\":40},{\"x\":0.70,\"y\":0.9,\"rgb\":[0,0,0],\"tol\":40},{\"x\":0.70,\"y\":0.5,\"rgb\":[0,120,0],\"tol\":70}]" } },
// Two cameras with half the frame each: what a camera draws is bounded by the rect
// it asked for, and one covering the other is what taking that rect off the device
// after the collect came to.