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.

fix(voxel): Voxel Ground compiles on WebGPU again, the wet map no longer pushes it past its texture units

yhh7dfb66aab148
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5b74aa090..1c991f6c7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,8 @@ published separately; it ships inside the editor.
### Fixed
+- **A terrain brush stroke no longer makes the ground vanish for a moment.** An edited page of the ground used to be thrown away at once and rebuilt over the next frames, so the touched area had no ground to draw until it was done; it now goes on being drawn as it was, and changes in place.
+- **Voxel Ground compiles on WebGPU again.** The Model shader's new wet-ground map left the voxel ground one texture past what a shader has units for, so its last texture was dropped and the whole shader was refused (`unresolved value 'u_wetMask'`). Voxel ground takes no wet map.
- **Several editors open at once can be told apart by an agent, and each grants on its own.** An editor advertises itself in a file of its own (its process id, its project, its port, its permission) instead of the one file the last editor to start overwrote. An agent attached to more than one gets `list_editors` and `select_editor` (or `--instance` / `ESTELLA_MCP_INSTANCE`), and until it chooses it is refused with the list rather than sent to whichever window won. It then drives the editor it chose and no other. The Read only / Can edit permission belongs to the editor window it is switched in and every editor starts read-only; it is no longer a saved setting that a second editor inherited. The Connect AI Tools dialog shows which editor it is.
### Changed
diff --git a/desktop b/desktop
index c1a14ab6a..6293d5bbd 160000
--- a/desktop
+++ b/desktop
@@ -1 +1 @@
-Subproject commit c1a14ab6ace31afbb678a9e1b74070dc0861bc7f
+Subproject commit 6293d5bbd787e5c3aae0b1b99cf18df923e0c3d4
diff --git a/sdk/src/voxel/voxelShader.ts b/sdk/src/voxel/voxelShader.ts
index 4e6c796bd..69c020a3f 100644
--- a/sdk/src/voxel/voxelShader.ts
+++ b/sdk/src/voxel/voxelShader.ts
@@ -85,6 +85,12 @@ export function deriveVoxelGround(model: string): string {
s = swap(s, '#pragma param u_iridescence float', `${PARAMS}#pragma param u_iridescence float`);
s = swap(s, '#pragma param u_emissiveMap texture default(white)\n', '');
s = swap(s, 'texture(u_emissiveMap, uv).rgb', 'vec3(1.0)');
+ // The wet-ground map: Voxel Ground already reads seven textures, and a shader has only so many units for them. A texture past the last
+ // unit gets none, its declaration is dropped, and the whole shader stops compiling (WebGPU said `unresolved value u_wetMask`). Ground
+ // made of voxels takes no wet map, so what it would have read is dry.
+ s = swap(s, '#pragma param u_wetMask texture default(black) texel(data)\n', '');
+ s = swap(s, 'textureLod(u_wetMask, wuv, 0.0).rg', 'vec2(0.0)');
+ s = swap(s, 'textureSampleLevel(u_wetMask, u_wetMask_s, wuv, 0.0).rg', 'vec2f(0.0)');
s = swap(s, 'textureSampleGrad(u_emissiveMap, u_emissiveMap_s, uv, duvx, duvy).rgb', 'vec3f(1.0)');
s = swap(s, 'float specularAA(highp vec3', `${GLSL_HELPERS}float specularAA(highp vec3`);
s = swap(s, 'fn specularAA(dndx : vec3f', `${WGSL_HELPERS}fn specularAA(dndx : vec3f`);
diff --git a/sdk/tests/voxel-shader.test.ts b/sdk/tests/voxel-shader.test.ts
new file mode 100644
index 000000000..0ae52afc2
--- /dev/null
+++ b/sdk/tests/voxel-shader.test.ts
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
+import { describe, expect, it } from 'vitest';
+import { MODEL } from '../src/render/builtinShaders';
+import { deriveVoxelGround } from '../src/voxel/voxelShader';
+
+/** The material texture params a shader declares: each takes one of a handful of units, and one past the last gets none. */
+const textureParams = (source: string): string[] =>
+ [...source.matchAll(/^#pragma param (\w+) texture/gm)].map((m) => m[1]!);
+
+describe('Voxel Ground, derived from the Model shader', () => {
+ const derived = deriveVoxelGround(MODEL);
+
+ it('declares no more textures than a shader has units for', () => {
+ // What the Model shader gains, Voxel Ground (which adds three maps of its own) must give up, or its last texture is dropped
+ // and the shader no longer compiles on WebGPU.
+ expect(textureParams(derived).length).toBeLessThanOrEqual(7);
+ });
+
+ it('has no wet map to read, and nothing in either language still names one', () => {
+ expect(textureParams(derived)).not.toContain('u_wetMask');
+ expect(derived).not.toMatch(/textureLod\(u_wetMask|u_wetMask_s/);
+ });
+
+ it('keeps the three materials it lays by world position', () => {
+ expect(textureParams(derived)).toEqual(expect.arrayContaining(['u_voxelMap1', 'u_voxelMap2', 'u_voxelMap3']));
+ });
+});
diff --git a/tools/gates.mjs b/tools/gates.mjs
index 2349866e3..b99df12d3 100644
--- a/tools/gates.mjs
+++ b/tools/gates.mjs
@@ -313,10 +313,6 @@ 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: 'release-metadata', run: 'node tools/check-release-metadata.mjs' },
- // The other half: metadata reads the CHANGELOG's shape, this reads whether
- // anything shipped without reaching it. Three releases running lost features
- // that only a hand-read of `git log` found.
- { id: 'changelog-covers', run: 'node tools/check-changelog-covers.mjs', needs: 'editor' },
// A published desktop artifact has one name, declared, whitespace-free, and
// still distinct once the asset store has normalised it.
{ id: 'release-artifact-names', run: 'node tools/check-release-artifact-names.mjs', needs: 'editor' },
@@ -389,6 +385,12 @@ export const GATES = [
{ id: 'rm-retries', run: 'node tools/check-rm-retries.mjs' },
{ id: 'examples', exclusive: true, run: 'node build-tools/cli.js check-examples' },
{ id: 'documents', exclusive: true, run: 'node build-tools/cli.js validate-documents' },
+ // The other half of release-metadata: metadata reads the CHANGELOG's shape, this reads whether anything shipped without reaching it. Three
+ // releases running lost features that only a hand-read of `git log` found.
+ // LAST on purpose. The list stops at its first red, and this one is red on any push whose user-facing commit has no note yet
+ // (12 of the last 13 CI runs): sitting in the middle it hid the 22 gates after it on every one of them. It reads only git history, so
+ // nothing after it depends on it, and nothing before it is hidden by it.
+ { id: 'changelog-covers', run: 'node tools/check-changelog-covers.mjs', needs: 'editor' },
];
/** Whether `p` names, or sits under, one of `roots`. */
diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjs
index d1db06b19..a78b621a6 100644
--- a/tools/releaseNotes.mjs
+++ b/tools/releaseNotes.mjs
@@ -4390,4 +4390,14 @@ export const NOTED = {
{"note": "A planar reflection softens with roughness and keeps a hot spot's hue."},
"fix(editor): a reload from disk gives way to an edit made while the file is read":
{"note": "A prefab reverted just after the editor noticed its scene file change is no longer lost."},
+ "fix(terrain): an edited page keeps drawing as it was until it is made again, so a brush stroke leaves no hole":
+ {"note": "A terrain brush stroke no longer makes the ground vanish for a moment."},
+ "feat(editor): several editors open at once are told apart by an agent, and each grants on its own (refs esengine/estella#118)":
+ {"note": "Several editors open at once can be told apart by an agent, and each grants on its own."},
+ "feat(rhi): a shader program that holds the page is named in the log; terrain-water compiles in the background":
+ {"internal": "A log line for engineers (a shader program that held the page 40 ms or more) and one example project's own quality setting."},
+ "fix(voxel): Voxel Ground compiles on WebGPU again, the wet map no longer pushes it past its texture units":
+ {"note": "Voxel Ground compiles on WebGPU again."},
+ "fix: the docs build parses the GripSurface summary; dusk-fort keeps its fog colour in colors":
+ {"internal": "A docs build error and an example scene's fog colour moved to where the loader reads it; no creator's project changes."},
};