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.

chore(ci): what a Build that was never let finish had been hiding - the pipeline's type check, the export tests under a bundled SDK, the AgX shaders the twin test did not scan, three page scripts that import the SDK, the tool names the front answers, the tiers of the GI and the animator, two deletes without retries, and a sun-disc probe a software rasterizer reads a pixel over

yhh17261c738c32
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index e98f1971e..1ff437011 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -179,16 +179,28 @@ jobs:
node pipeline/bin/estella.mjs export examples/mobile-controls --platform web --wasm build/wasm/web --out output/poki-training-ci-standalone --json output/poki-training-ci-standalone.json
node tools/tests/poki-training.e2e.mjs --dir output/poki-training-ci-export --standalone output/poki-training-ci-standalone --out output/poki-training-ci-check
- name: Check CrazyGames gameplay, storage and host mute in SDK mocks
+ # These scripts reach into the page for the SDK itself (`import('esengine')`: Scores, Storage, Time), which only the package with the SDK
+ # copied beside it can answer; the bundled package, which is what an export makes by default, is the Poki step's above.
+ env:
+ ESTELLA_WEB_BUNDLE_ENGINE: '0'
run: |
node pipeline/bin/estella.mjs export examples/mobile-controls --profile crazygames --wasm build/wasm/web --out output/crazygames-training-ci-export --json output/crazygames-training-ci-export.json
node tools/tests/crazygames-training.e2e.mjs --dir output/crazygames-training-ci-export --out output/crazygames-training-ci-check
node tools/tests/export-crazygames-score-fixture.mjs --wasm build/wasm/web --out output/crazygames-training-ci-score-export
node tools/tests/crazygames-training.e2e.mjs --dir output/crazygames-training-ci-score-export --expect-scores --out output/crazygames-training-ci-score-check
- name: Check execution holds in an authored game and real browser media
+ # These scripts reach into the page for the SDK itself (`import('esengine')`: Scores, Storage, Time), which only the package with the SDK
+ # copied beside it can answer; the bundled package, which is what an export makes by default, is the Poki step's above.
+ env:
+ ESTELLA_WEB_BUNDLE_ENGINE: '0'
run: |
node tools/tests/export-execution-hold-fixture.mjs --wasm build/wasm/web --out output/execution-hold-ci-export
node tools/tests/execution-hold.e2e.mjs --dir output/execution-hold-ci-export --out output/execution-hold-ci-check
- name: Check YouTube readiness, SDK pause and cloud saves in SDK mocks
+ # These scripts reach into the page for the SDK itself (`import('esengine')`: Scores, Storage, Time), which only the package with the SDK
+ # copied beside it can answer; the bundled package, which is what an export makes by default, is the Poki step's above.
+ env:
+ ESTELLA_WEB_BUNDLE_ENGINE: '0'
run: |
node pipeline/bin/estella.mjs export examples/mobile-controls --profile youtube --wasm build/wasm/web --out output/youtube-training-ci-export
node tools/tests/youtube-training.e2e.mjs --dir output/youtube-training-ci-export --out output/youtube-training-ci-check
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e975127f4..64243e35c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,7 +19,7 @@ published separately; it ships inside the editor.
### Added
- **Dynamic global illumination that does not leak.** A new `dynamicGI` effect on a `PostProcessVolume` lights a scene with the light its surfaces throw back, live, on WebGPU: a moved lamp, an opened door or a changed sun is in the next frames, with nothing baked. It traces a distance field of the scene instead of the screen or a voxel grid, so a sealed room stays dark (the voxel GI lit its walls from the sun outside) and what is off screen still lights what is on it. A model takes part when its import setting `dynamicGI` is on (the import then bakes a distance field and six cards beside the mesh); the built-in cube needs nothing. It reads material emission, the sun and up to eight point and spot lights with the frame's own falloff, and with `u_cellSize` set the field is three levels that follow the camera, for a world larger than one window. Held to Blender Cycles on six lab rooms (0.54 to 1.3 of its indirect light, zero in the sealed room) and to a cost gate that counts the rays and reads a frame asks for. It costs 3.3 ms at 1080p on a desktop GPU and 7.3 ms on a Snapdragon 8 Elite at 2530 x 1200. Not measured on a mid-range phone; a scene of many instances has not been tried; WebGL2 does not run it.
-- **A quality level decides what the dynamic GI spends.** The low level leaves `dynamicGI` out, as it does the voxel GI, and builds no distance field for it. The medium level, which is what a phone gets when a project names none, runs it the cheaper way (`dynamicGIReduced` in a level's profile): one pixel in four asks the probes, a probe traces a quarter of its rays a frame, the cards are relit over eight frames and there are two thirds of the probe rows - 4.5 ms where the full way is 7.3 on a Snapdragon 8 Elite. It gives up a pixel or two of light across the edge two surfaces share and shows more grain while the camera moves. The effect's `u_halfRes` and `u_probeDensity` set the same by hand.
+- **A quality level decides what the dynamic GI spends.** The low level leaves `dynamicGI` out, as it does the voxel GI, and builds no distance field for it. The medium level, which is what a phone gets when a project names none, runs it the cheaper way (`dynamicGIReduced` in a level's profile): one pixel in four asks the probes, a probe traces a quarter of its rays a frame, the cards are relit over eight frames and there are two thirds of the probe rows - 4.5 ms where the full way is 7.3 on a Snapdragon 8 Elite. It gives up a pixel or two of light across the edge two surfaces share and shows more grain while the camera moves. Project Settings has the switch per level (Rendering, Cheaper dynamic GI). The effect's `u_halfRes` and `u_probeDensity` set the same by hand.
- **A native app streams long audio clips.** On Android, iOS and the desktop host a long clip stays compressed in memory and each voice decodes as it plays, by the same rule the web uses: a 175 second mp3 keeps 2.3 MB where it kept 64, and starts at once instead of after a 215 ms decode on the frame (measured on Windows). A decoded clip no longer falls out of the cache while a play is waiting on it, which is what left a phone silent where the editor had music.
### Changed
@@ -38,7 +38,7 @@ published separately; it ships inside the editor.
- **Fog, water, sky, rain, depth of field and light shafts work under an orthographic camera.** Distance Fog, Height Fog (and its volumetric pass), Underwater, Sky Atmosphere with its clouds, Rain and Depth of Field measured how far a surface is from the camera starting at depth 0, which for an orthographic eye is a plane as far behind the camera as the far plane is ahead (the projection runs from -far to far so 2D content behind the camera still draws). Distance Fog read every surface as past its end and fogged a scene to full colour at any near and far, Height Fog added a camera-length of extra air, Underwater took the camera for being above the water and drew nothing, the cloud layer, placed by that height, stood kilometres off, so a floor above the clouds was still in their shadow, Rain drew its streak layers in front of surfaces a few units from the eye, and Depth of Field blurred what stood exactly at its focus distance. Light Shafts projected the sun to a place on screen, which an orthographic camera does not have (the sun is at infinity), so the shafts were gone; they now run along the sun's direction on screen, as strong as a 60 degree perspective camera would have them for the angle the view makes with the sun. The rest now start from the plane the camera stands in. Perspective cameras are unchanged. Found by the closed-form render checks in `tools/oracle`, which draw spheres, floors and patches whose answer is a formula.
- **AgX is Blender's AgX.** The effect read a 32^3 table by trilinear interpolation where Blender's configuration names tetrahedral, so a neutral input came out tinted (middle grey 6 codes short in red, where Blender gives 118 / 118 / 118) and a saturated blue lost 12 of its red; and its contrast look (`u_contrast` 1.2, Blender's Medium High Contrast) took its contrast in a different log space from Blender's, 14 codes off on saturated colours. It now carries Blender's own tables, the 57^3 view transform and the 37^3 luminance compensation the looks start with, reads them tetrahedrally, and takes the look's contrast where Blender does (in the inset Rec.2020 log, through that compensation); every grey and saturated colour checked is within 1 code of Blender 5.2's output, on both backends. The tables are packed (predicted from their neighbours and deflated, unpacked once when the effect is built), and together are 81 KB of source against the 131 KB the old 32^3 table was. Checked against Blender by the render checks in `tools/oracle`, which keep Blender's output as data.
- **A prefab whose root was put under a Canvas opens again.** Reparenting a prefab's root under a Canvas authored in Prefab Mode saved a file the editor then refused to open; it is saved with that Canvas as its root.
-- **A wall under a roof is no longer sunlit along its top.** A shadow lookup stepped toward the light by as much as eleven texels of the shadow map on a surface the light grazes; where a texel is a few units (the low and medium levels, a large scene) that is further than a ceiling is thick, and the top of every wall under it came out lit. The lookup now moves off the surface along its normal and a texel and a half toward the light, at every level and on both backends. The wide filter of a soft shadow still forgives by slope, so a very soft shadow under a very thin roof can still let some through.
+- **A wall under a roof is no longer sunlit along its top.** A shadow lookup stepped toward the light by as much as eleven texels of the shadow map on a surface the light grazes; where a texel is a few units (the low and medium levels, a large scene) that is further than a ceiling is thick, and the top of every wall under it came out lit. The step toward the light now stops at what a slope of 1.2 asks (under four texels) and the rest of the clearance is taken along the surface's normal, at every level and on both backends. A floor under a sun 40 degrees up or more is asked exactly as before, so a shadow on it has not moved; on a steeper surface a shadow's edge sits a fraction of a texel nearer its caster. The wide filter of a soft shadow still forgives by slope, so a very soft shadow under a very thin roof can still let some through.
- **Dynamic resolution lowers the scale when a frame is late.** A GPU timer that read half a millisecond counted as headroom, so a late frame kept its scale; on WebGPU the timer now covers the whole frame and not the last pass alone.
- **The device's language reaches a native game.** Android, iOS and the desktop host report the system locale, and `zh-Hans-CN` reads as the `zh-CN` a browser gives; it was always `en`.
- **A game started over and over in one page no longer runs out of WebAssembly memory.** The module host has an end, the App that made it disposes it on quit, and the KTX2 transcode workers stop with it.
diff --git a/desktop b/desktop
index 4a9f0c1df..54f057cfd 160000
--- a/desktop
+++ b/desktop
@@ -1 +1 @@
-Subproject commit 4a9f0c1df5f529d4e04b0211699e03bd3fbfd1fd
+Subproject commit 54f057cfd5360b79d17082ad1fb89fe922295a17
diff --git a/docs/astro/src/data/apiStability.generated.json b/docs/astro/src/data/apiStability.generated.json
index 8a88a6168..b315664bd 100644
--- a/docs/astro/src/data/apiStability.generated.json
+++ b/docs/astro/src/data/apiStability.generated.json
@@ -3,10 +3,10 @@
"counts": {
"public": 115,
"beta": 178,
- "experimental": 3050,
+ "experimental": 3056,
"deprecated": 3
},
- "total": 3343,
+ "total": 3349,
"subsystems": [
{
"id": "mobile-controls",
@@ -430,6 +430,18 @@
"ParticleModelUnits"
]
},
+ {
+ "id": "skeletal-animation",
+ "title": "Skeletal animation",
+ "titleZh": "骨骼动画",
+ "tier": "experimental",
+ "why": "the animator graph and grip poses are checked against the engine, and a lean package installs them only where its content uses them",
+ "whyZh": "动画状态机和握持姿态已对引擎做过检查,精简包只在内容用到时才安装它们",
+ "entry": [
+ "AnimatorController",
+ "GripPose"
+ ]
+ },
{
"id": "water",
"title": "Water",
@@ -1910,6 +1922,7 @@
"index",
"index.node",
"index.native",
+ "skeletal-animation",
"wechat",
"minigame"
]
@@ -1922,6 +1935,7 @@
"index",
"index.node",
"index.native",
+ "skeletal-animation",
"wechat",
"minigame"
]
diff --git a/pipeline/src/export/exportGame.ts b/pipeline/src/export/exportGame.ts
index 996681176..efd7df16c 100644
--- a/pipeline/src/export/exportGame.ts
+++ b/pipeline/src/export/exportGame.ts
@@ -1135,7 +1135,7 @@ async function produceExport(opts: ExportGameOptions): Promise<ExportGameResult>
// the import map gave the copied tree), and what neither of them reaches is not shipped.
const entryId = 'estella:game-entry';
const leanEntry = plan.lean && existsSync(path.join(opts.sdkDistDir, LEAN_ENTRY_FILE));
- await rm(path.join(payloadDir, 'chunks'), { recursive: true, force: true });
+ await rm(path.join(payloadDir, 'chunks'), { recursive: true, force: true, maxRetries: 10, retryDelay: 50 });
await rm(path.join(payloadDir, 'scripts.mjs'), { force: true });
const bundled = await build({
...common,
@@ -1263,7 +1263,7 @@ async function produceExport(opts: ExportGameOptions): Promise<ExportGameResult>
if (bundleEngine) {
// The SDK is inside game.js and the chunks beside it; a tree left by an earlier export would only be dead weight.
engineMap = NO_IMPORT_MAP;
- await rm(path.join(payloadDir, 'sdk'), { recursive: true, force: true });
+ await rm(path.join(payloadDir, 'sdk'), { recursive: true, force: true, maxRetries: 10, retryDelay: 50 });
} else if (existsSync(opts.sdkDistDir)) {
const sdkOut = await resetRuntimeTree(payloadDir, 'sdk', [opts.sdkDistDir, opts.wasmDir]);
await cp(opts.sdkDistDir, sdkOut, {
diff --git a/pipeline/tests/gpu-scene.test.ts b/pipeline/tests/gpu-scene.test.ts
index 2df1b7442..9515f0156 100644
--- a/pipeline/tests/gpu-scene.test.ts
+++ b/pipeline/tests/gpu-scene.test.ts
@@ -8,7 +8,7 @@ import { describe, it, expect } from 'vitest';
import { MeshChannel, MeshChannelType, type MeshData } from 'esengine';
import { bakeMeshCards } from '../src/assets/meshCards';
import { bakeMeshSdf } from '../src/assets/meshSdf';
-import { buildInstances, instanceKey, type GIEntry } from '../../sdk/src/gi/dynamicGISystem';
+import { buildInstances, instanceKey, type GIEntry } from '../../sdk/src/gi/giInstances';
import { packGPUScene, GI_HEADER_FLOATS, GI_INSTANCE_FLOATS } from '../../sdk/src/gi/gpuScene';
import { GlobalSdf } from '../../sdk/src/gi/globalSdf';
diff --git a/sdk/src/gi/dynamicGISystem.ts b/sdk/src/gi/dynamicGISystem.ts
index 6947c5131..e2111ae52 100644
--- a/sdk/src/gi/dynamicGISystem.ts
+++ b/sdk/src/gi/dynamicGISystem.ts
@@ -26,91 +26,14 @@ import { Material } from '../render/material';
import { PostProcess } from '../postprocess/PostProcessAPI';
import { analyticBox, instanceBounds, packGPUScene, type GIInstance, type GILight, type GPUScene } from './gpuScene';
import { GlobalSdf } from './globalSdf';
+import { buildInstances, instanceKey, type GIEntry, type GISidecars } from './giInstances';
import type { PointLight } from './surfaceCache';
import { worldUnitsPerMeter } from '../ecs/worldUnits';
import type { MeshSdf } from './meshSdfFormat';
import type { MeshCards } from './cardFormat';
-const CUBE = 100; // the built-in cube is 100 units across
+export { buildInstances, instanceKey, type GIEntry, type GISidecars } from './giInstances';
-function matrixOf(t: TransformData, scale = 1): number[] {
- const { x, y, z, w } = t.worldRotation, p = t.worldPosition;
- return [
- (1 - 2 * (y * y + z * z)) * scale, 2 * (x * y + z * w) * scale, 2 * (x * z - y * w) * scale, 0,
- 2 * (x * y - z * w) * scale, (1 - 2 * (x * x + z * z)) * scale, 2 * (y * z + x * w) * scale, 0,
- 2 * (x * z + y * w) * scale, 2 * (y * z - x * w) * scale, (1 - 2 * (x * x + y * y)) * scale, 0,
- p.x, p.y, p.z, 1,
- ];
-}
-
-/** What the system reads of one MeshRenderer: enough to place it in the GI scene. */
-export interface GIEntry {
- mesh: number;
- transform: TransformData;
- colour: readonly [number, number, number];
- emissive: readonly [number, number, number];
- /** The asset path of the mesh, where it has one (a built-in cube has none the GI needs). */
- path: string | null;
-}
-
-export interface GISidecars { sdf: MeshSdf; cards: MeshCards }
-
-/**
- * The instances of the GI scene from the renderers: a built-in cube is a box of its world scale (with its colour and emission); any other
- * mesh is the baked `.esmeshsdf` and `.esmeshcards` beside it, when it has them and is scaled the same along every axis (a distance field
- * does not survive a stretch). Everything else is not in the GI scene.
- */
-function poseKey(e: GIEntry): string {
- const s = e.transform.worldScale, p = e.transform.worldPosition, q = e.transform.worldRotation;
- return `${[p.x, p.y, p.z, q.x, q.y, q.z, q.w, s.x, s.y, s.z].map((v) => v.toFixed(3)).join(',')};${e.colour.join(',')};${e.emissive.join(',')}`;
-}
-
-/**
- * What `buildInstances` would make of the entries, as a string, without making it. The system asks this every frame and builds only when it
- * changes: building is the distance fields and cards of every box, which is milliseconds on a desktop and tens on a phone, and a scene that
- * has not moved should cost a string compare and not that.
- */
-export function instanceKey(entries: readonly GIEntry[], cube: number, sidecars: (path: string) => GISidecars | null): string {
- let key = '';
- for (const e of entries) {
- const s = e.transform.worldScale;
- if (e.mesh === cube) key += `|c${poseKey(e)}`;
- else if (e.path) {
- if (!sidecars(e.path)) continue;
- const lo = Math.min(s.x, s.y, s.z), hi = Math.max(s.x, s.y, s.z);
- if (lo <= 0 || hi / lo > 1.05) continue;
- key += `|m${e.path};${poseKey(e)}`;
- }
- }
- return key;
-}
-
-export function buildInstances(entries: readonly GIEntry[], cube: number, sidecars: (path: string) => GISidecars | null): { instances: GIInstance[]; key: string } {
- const instances: GIInstance[] = [];
- let key = '';
- const extent = Math.max(1, ...entries.filter((e) => e.mesh === cube).flatMap((e) => [e.transform.worldScale.x, e.transform.worldScale.y, e.transform.worldScale.z].map((v) => v * CUBE)));
- for (const e of entries) {
- const s = e.transform.worldScale;
- const pose = poseKey(e);
- if (e.mesh === cube) {
- const size: [number, number, number] = [s.x * CUBE, s.y * CUBE, s.z * CUBE];
- // A box with a cell fine enough that a wall a tenth of a metre thick is still more than one.
- const { cards, ...sdf } = analyticBox(size, e.colour, Math.max(extent / 60, 1e-3), extent / 20, 24, e.emissive);
- instances.push({ sdf, cards, worldFromLocal: matrixOf({ ...e.transform, worldScale: { x: 1, y: 1, z: 1 } }) });
- key += `|c${pose}`;
- } else if (e.path) {
- const found = sidecars(e.path);
- if (!found) continue;
- const lo = Math.min(s.x, s.y, s.z), hi = Math.max(s.x, s.y, s.z);
- if (lo <= 0 || hi / lo > 1.05) continue;
- instances.push({ sdf: found.sdf, cards: found.cards, worldFromLocal: matrixOf(e.transform, (s.x + s.y + s.z) / 3) });
- key += `|m${e.path};${pose}`;
- }
- }
- return { instances, key };
-}
-
-/** The settings of the first enabled `dynamicGI` effect of the volumes, or null when there is none. */
function dynamicGIEffect(volumes: Iterable<[Entity, PostProcessVolumeData]>): { cellSize: number } | null {
for (const [, v] of volumes) {
for (const e of v.effects as Array<{ type: string; enabled?: boolean; uniforms?: Record<string, number> }>) {
diff --git a/sdk/src/gi/giInstances.ts b/sdk/src/gi/giInstances.ts
new file mode 100644
index 000000000..8558de9b4
--- /dev/null
+++ b/sdk/src/gi/giInstances.ts
@@ -0,0 +1,97 @@
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
+/**
+ * The instances of the dynamic GI's scene, from what a scene's renderers are. Apart from the system that feeds the engine (dynamicGISystem.ts)
+ * so that it stands on nothing but the GI's own data: the pipeline's tests build a scene with it, and they are compiled without the App.
+ */
+import { analyticBox, type GIInstance } from './gpuScene';
+import type { MeshSdf } from './meshSdfFormat';
+import type { MeshCards } from './cardFormat';
+
+/** Where a renderer stands: the world pose of its Transform, by shape (a `TransformData` is one). */
+export interface GIPose {
+ worldPosition: { x: number; y: number; z: number };
+ worldRotation: { x: number; y: number; z: number; w: number };
+ worldScale: { x: number; y: number; z: number };
+}
+
+const CUBE = 100; // the built-in cube is 100 units across
+
+function matrixOf(t: GIPose, scale = 1): number[] {
+ const { x, y, z, w } = t.worldRotation, p = t.worldPosition;
+ return [
+ (1 - 2 * (y * y + z * z)) * scale, 2 * (x * y + z * w) * scale, 2 * (x * z - y * w) * scale, 0,
+ 2 * (x * y - z * w) * scale, (1 - 2 * (x * x + z * z)) * scale, 2 * (y * z + x * w) * scale, 0,
+ 2 * (x * z + y * w) * scale, 2 * (y * z - x * w) * scale, (1 - 2 * (x * x + y * y)) * scale, 0,
+ p.x, p.y, p.z, 1,
+ ];
+}
+
+/** What the system reads of one MeshRenderer: enough to place it in the GI scene. */
+export interface GIEntry {
+ mesh: number;
+ transform: GIPose;
+ colour: readonly [number, number, number];
+ emissive: readonly [number, number, number];
+ /** The asset path of the mesh, where it has one (a built-in cube has none the GI needs). */
+ path: string | null;
+}
+
+export interface GISidecars { sdf: MeshSdf; cards: MeshCards }
+
+/**
+ * The instances of the GI scene from the renderers: a built-in cube is a box of its world scale (with its colour and emission); any other
+ * mesh is the baked `.esmeshsdf` and `.esmeshcards` beside it, when it has them and is scaled the same along every axis (a distance field
+ * does not survive a stretch). Everything else is not in the GI scene.
+ */
+function poseKey(e: GIEntry): string {
+ const s = e.transform.worldScale, p = e.transform.worldPosition, q = e.transform.worldRotation;
+ return `${[p.x, p.y, p.z, q.x, q.y, q.z, q.w, s.x, s.y, s.z].map((v) => v.toFixed(3)).join(',')};${e.colour.join(',')};${e.emissive.join(',')}`;
+}
+
+/**
+ * What `buildInstances` would make of the entries, as a string, without making it. The system asks this every frame and builds only when it
+ * changes: building is the distance fields and cards of every box, which is milliseconds on a desktop and tens on a phone, and a scene that
+ * has not moved should cost a string compare and not that.
+ */
+export function instanceKey(entries: readonly GIEntry[], cube: number, sidecars: (path: string) => GISidecars | null): string {
+ let key = '';
+ for (const e of entries) {
+ const s = e.transform.worldScale;
+ if (e.mesh === cube) key += `|c${poseKey(e)}`;
+ else if (e.path) {
+ if (!sidecars(e.path)) continue;
+ const lo = Math.min(s.x, s.y, s.z), hi = Math.max(s.x, s.y, s.z);
+ if (lo <= 0 || hi / lo > 1.05) continue;
+ key += `|m${e.path};${poseKey(e)}`;
+ }
+ }
+ return key;
+}
+
+export function buildInstances(entries: readonly GIEntry[], cube: number, sidecars: (path: string) => GISidecars | null): { instances: GIInstance[]; key: string } {
+ const instances: GIInstance[] = [];
+ let key = '';
+ const extent = Math.max(1, ...entries.filter((e) => e.mesh === cube).flatMap((e) => [e.transform.worldScale.x, e.transform.worldScale.y, e.transform.worldScale.z].map((v) => v * CUBE)));
+ for (const e of entries) {
+ const s = e.transform.worldScale;
+ const pose = poseKey(e);
+ if (e.mesh === cube) {
+ const size: [number, number, number] = [s.x * CUBE, s.y * CUBE, s.z * CUBE];
+ // A box with a cell fine enough that a wall a tenth of a metre thick is still more than one.
+ const { cards, ...sdf } = analyticBox(size, e.colour, Math.max(extent / 60, 1e-3), extent / 20, 24, e.emissive);
+ instances.push({ sdf, cards, worldFromLocal: matrixOf({ ...e.transform, worldScale: { x: 1, y: 1, z: 1 } }) });
+ key += `|c${pose}`;
+ } else if (e.path) {
+ const found = sidecars(e.path);
+ if (!found) continue;
+ const lo = Math.min(s.x, s.y, s.z), hi = Math.max(s.x, s.y, s.z);
+ if (lo <= 0 || hi / lo > 1.05) continue;
+ instances.push({ sdf: found.sdf, cards: found.cards, worldFromLocal: matrixOf(e.transform, (s.x + s.y + s.z) / 3) });
+ key += `|m${e.path};${pose}`;
+ }
+ }
+ return { instances, key };
+}
+
+/** The settings of the first enabled `dynamicGI` effect of the volumes, or null when there is none. */
diff --git a/sdk/tests/shader-twins.test.ts b/sdk/tests/shader-twins.test.ts
index b995540ed..2cd69771f 100644
--- a/sdk/tests/shader-twins.test.ts
+++ b/sdk/tests/shader-twins.test.ts
@@ -43,7 +43,7 @@ const CASES: Array<{ name: string; source: string }> = [
...BUILTIN_SHADER_TEMPLATES.map((t) => ({ name: `template:${t.id}`, source: t.source })),
...embeddedEsshaders('render/filters.ts').map((source, i) => ({ name: `filters.ts[${i}]`, source })),
...embeddedEsshaders('render/spriteFilter.ts').map((source, i) => ({ name: `spriteFilter.ts[${i}]`, source })),
- ...['basic', 'atmosphere', 'lighting', 'rain2d', 'fog2d'].flatMap((group) => embeddedEsshaders(`postprocess/sources/${group}.ts`).map(
+ ...['basic', 'agx', 'atmosphere', 'lighting', 'rain2d', 'fog2d'].flatMap((group) => embeddedEsshaders(`postprocess/sources/${group}.ts`).map(
(source, i) => ({ name: `postProcessEffects.ts[${group}:${i}]`, source }))),
...embeddedEsshaders('camera/editorGridRenderer.ts').map(
(source, i) => ({ name: `editorGridRenderer.ts[${i}]`, source })),
diff --git a/tools/apiSubsystems.mjs b/tools/apiSubsystems.mjs
index 9e7e962ba..17dd7a1fd 100644
--- a/tools/apiSubsystems.mjs
+++ b/tools/apiSubsystems.mjs
@@ -26,6 +26,7 @@
* subsystem cannot be mistaken for adding plumbing.
*/
export const INFRASTRUCTURE = {
+ gi: 'the dynamic GI\'s scene feed and baked file formats, run by the post-process effect: a creator turns on the effect and an import setting, and builds on neither',
'debug-channel': 'a development build\'s line back to the editor — tooling, never in a shipped game',
diagnostics: 'the engine reporting on itself — a census and a stats overlay, read by tooling',
document: 'document-model diagnostics shared with the editor, not part of a game',
@@ -373,7 +374,7 @@ export const SUBSYSTEMS = [
tier: 'experimental',
why: 'the animator graph and grip poses are checked against the engine, and a lean package installs them only where its content uses them',
whyZh: '动画状态机和握持姿态已对引擎做过检查,精简包只在内容用到时才安装它们',
- entry: ['Animator', 'AnimatorController', 'GripPose'],
+ entry: ['AnimatorController', 'GripPose'],
},
{
id: 'water',
diff --git a/tools/check-project-settings.mjs b/tools/check-project-settings.mjs
index 4029b5b39..c1b78621c 100644
--- a/tools/check-project-settings.mjs
+++ b/tools/check-project-settings.mjs
@@ -311,6 +311,7 @@ const BLOCKS = [
shelterMaskSize: { ui: 'project.rendering.quality.shelterMaskSize' },
shadowSoftSamples: { ui: 'project.rendering.quality.shadowSoftSamples' },
lighting: { ui: 'project.rendering.quality.lighting' },
+ dynamicGIReduced: { ui: 'project.rendering.quality.dynamicGIReduced' },
drawCallBudget: { ui: 'project.rendering.quality.drawCallBudget' },
textureStreaming: { ui: 'project.rendering.quality.textureStreaming' },
textureStreamingBudget: { ui: 'project.rendering.quality.textureStreamingBudget' },
diff --git a/tools/check-tool-calls.mjs b/tools/check-tool-calls.mjs
index 068ad5c1b..f450edc0f 100644
--- a/tools/check-tool-calls.mjs
+++ b/tools/check-tool-calls.mjs
@@ -62,7 +62,7 @@ function scripts(dir, out = []) {
const problems = [];
let checked = 0;
/** What the MCP front answers itself, ahead of the catalog. */
-const FRONT_TOOLS = new Set(['enable_tools']);
+const FRONT_TOOLS = new Set(['enable_tools', 'list_editors', 'select_editor']);
for (const file of SCANNED.flatMap((d) => scripts(d))) {
const source = readFileSync(file, 'utf8');
diff --git a/tools/gates.mjs b/tools/gates.mjs
index 52e24f3e0..6ac731fe8 100644
--- a/tools/gates.mjs
+++ b/tools/gates.mjs
@@ -312,6 +312,12 @@ export const GATES = [
},
{ id: 'verifier-exit', run: 'node tools/check-verifier-exit.mjs', needs: 'editor' },
{ id: 'render-scenes', run: 'node tools/check-render-scenes.mjs' },
+ {
+ id: 'gi-sdf-wgsl',
+ run: 'node tools/gi/check-sdf-wgsl.mjs',
+ where: 'local',
+ why: 'it runs the distance field trace on a WebGPU device against the closed-form distance to a sphere, and CI has no adapter',
+ },
{
id: 'gi-cost',
run: 'node tools/gi/check-gi-cost.mjs',
diff --git a/tools/oracle/sky.mjs b/tools/oracle/sky.mjs
index a054ea4f5..87559a509 100644
--- a/tools/oracle/sky.mjs
+++ b/tools/oracle/sky.mjs
@@ -104,7 +104,7 @@ function sunTransmittance(sun, alt, haze) {
return BETA_R.map((b) => Math.exp(-(b * od[0] + BETA_M * haze * 1.1 * od[1])));
}
-function skyDome({ id, elevation, azimuth, pitch, yaw, haze = 1, intensity = 0.5, tol = 18, grid = 5, glow = false, sunBrightness = 40 }) {
+function skyDome({ id, elevation, azimuth, pitch, yaw, haze = 1, intensity = 0.5, tol = 18, grid = 5, glow = false, sunBrightness = 40, disc = glow }) {
const sun = sunVector(elevation, azimuth);
const doc = scene(id, () => [
camera({ projectionType: 0, fov: FOV, nearPlane: 1, farPlane: 2000 }),
@@ -124,7 +124,7 @@ function skyDome({ id, elevation, azimuth, pitch, yaw, haze = 1, intensity = 0.5
expect.push({ x: i / (SIZE - 1), y: j / (SIZE - 1), rgb: encodeLinear8(col.map(clamp01)), tol, dir });
}
}
- if (glow) {
+ if (disc) {
// The pixel at the middle of the frame looks along the sun: its disc, which adds the sun's own transmitted light to the dome.
const j = SIZE / 2, dir = pixelDir(j, j, pitch, yaw), trans = sunTransmittance(sun, 0.1, haze);
const col = domeRef(dir, sun, { altitude: 0.1, haze, intensity }).map((v, k) => v + trans[k] * sunBrightness);
@@ -205,7 +205,9 @@ export const SKY_SCENES = [
skyDome({ id: 'oracle-sky-afternoon', elevation: 35, azimuth: 40, pitch: 30, yaw: 140 }),
skyDome({ id: 'oracle-sky-low-sun', elevation: 8, azimuth: 40, pitch: 25, yaw: 215 }),
skyDome({ id: 'oracle-sky-sun-glow', elevation: 35, azimuth: 40, pitch: 35, yaw: 220, intensity: 0.08, sunBrightness: 1, glow: true }),
- skyDome({ id: 'oracle-sky-sun-glow-low', elevation: 14, azimuth: 40, pitch: 14, yaw: 220, intensity: 0.06, sunBrightness: 1, glow: true }),
+ // The glow round a low sun, without the pixel on the disc itself: the disc is a third of a degree across and its edge a pixel wide here,
+ // and a software rasterizer reads the middle pixel on that edge (97 where a GPU reads 244). The disc is oracle-sky-sun-glow's to hold.
+ skyDome({ id: 'oracle-sky-sun-glow-low', elevation: 14, azimuth: 40, pitch: 14, yaw: 220, intensity: 0.06, sunBrightness: 1, glow: true, disc: false }),
skyDome({ id: 'oracle-sky-hazy', elevation: 35, azimuth: 40, pitch: 30, yaw: 140, haze: 3, intensity: 0.4 }),
// Slab 1.5 to 4.0 km. A floor at altitude 5 - 0.395 is above it, a floor at 1 - 0.395 is below its base.
cloudShadow({ id: 'oracle-cloud-shadow-clear-ortho', ortho: true, altitude: 5, shadowed: false }),
diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjs
index 008a200a9..935105a20 100644
--- a/tools/releaseNotes.mjs
+++ b/tools/releaseNotes.mjs
@@ -4502,4 +4502,10 @@ export const NOTED = {
{"note": "The 3D Starter looks finished out of the box."},
"feat(mcp): audit_look says why a 3D scene looks flat, and apply_look gives it a finished look":
{"note": "The 3D Starter looks finished out of the box."},
+ "fix(prefab): a prefab whose root was parented under an authored Canvas saves with that Canvas as its root, so it opens again":
+ {"note": "A prefab whose root was put under a Canvas opens again."},
+ "fix(shadows): the lookup steps toward the light as far as a slope of 1.2 asks and takes the rest along the normal - a floor under a sun reads as it did, and a wall the light grazes still does not reach past a ceiling":
+ {"note": "A wall under a roof is no longer sunlit along its top."},
+ "feat(settings): a row for the cheaper dynamic GI, per quality level":
+ {"note": "A quality level decides what the dynamic GI spends."},
};
diff --git a/vitest.engine.config.ts b/vitest.engine.config.ts
index a19e813dd..aaaf292fb 100644
--- a/vitest.engine.config.ts
+++ b/vitest.engine.config.ts
@@ -21,6 +21,9 @@ export default defineConfig({
test: {
include: ['pipeline/tests/**/*.test.ts', 'tools/tests/**/*.test.ts'],
environment: 'node',
+ // As in pipeline/vitest.config.ts, which this config stands in for when the suite is run from the root: the web export bundles the SDK
+ // it is given, and most export tests hand it a stub tree. export-web-bundle.test.ts clears this for itself and builds from the real SDK.
+ env: { ESTELLA_WEB_BUNDLE_ENGINE: '0' },
// The cook and export suites shell out and touch temp directories; the
// default 5s is not enough for the ones that package a whole project.
testTimeout: 30_000,