create-threenative 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2141,7 +2141,7 @@ function createWebBrandPlugin() {
2141
2141
  enforce: "pre",
2142
2142
  async config(vite) {
2143
2143
  const loaded = await loadConfig(path6.resolve(vite.root ?? process.cwd()));
2144
- if (loaded.engine === "threenative")
2144
+ if (loaded.engine === "threenative" && process.env.THREENATIVE_NATIVE_BUNDLE === void 0)
2145
2145
  return {
2146
2146
  optimizeDeps: { exclude: ["three", "three/webgpu", "three/tsl", "three-mesh-bvh"] }
2147
2147
  };
@@ -2156,7 +2156,7 @@ function createWebBrandPlugin() {
2156
2156
  async configResolved(resolved) {
2157
2157
  root = resolved.root;
2158
2158
  config = await loadConfig(root);
2159
- if (config.engine === "threenative")
2159
+ if (config.engine === "threenative" && process.env.THREENATIVE_NATIVE_BUNDLE === void 0)
2160
2160
  engine = createWebEnginePlugin({ root, engine: config.engine });
2161
2161
  },
2162
2162
  transformIndexHtml(html) {
@@ -3213,8 +3213,8 @@ var MCP_SERVERS = Object.freeze({
3213
3213
  var MCP_PACKAGES = Object.freeze({
3214
3214
  assets: Object.freeze({ name: "threenative-asset-mcp", version: "0.14.0" }),
3215
3215
  sculpt: Object.freeze({ name: "threenative-sculpt-mcp", version: "0.2.2" }),
3216
- engine: Object.freeze({ name: "threenative-engine-mcp", version: "0.2.5" }),
3217
- blender: Object.freeze({ name: "threenative-blender-mcp", version: "0.1.5" })
3216
+ engine: Object.freeze({ name: "threenative-engine-mcp", version: "0.2.6" }),
3217
+ blender: Object.freeze({ name: "threenative-blender-mcp", version: "0.1.6" })
3218
3218
  });
3219
3219
  var SERVER_FORMATS = Object.freeze({
3220
3220
  // Claude Code (`.mcp.json`), Cursor and the Gemini CLI all read this one.
@@ -3356,7 +3356,7 @@ function requiredAndroidSdkFromRoot(root) {
3356
3356
  }
3357
3357
  }
3358
3358
  var CORE_PACKAGE_NAME = "@threenative/core";
3359
- var CORE_PACKAGE_VERSION = "0.3.5";
3359
+ var CORE_PACKAGE_VERSION = "0.3.6";
3360
3360
  var CORE_RESOLVED_SERVERS = /* @__PURE__ */ new Set([
3361
3361
  "threenative-engine",
3362
3362
  "threenative-blender"
@@ -3688,7 +3688,7 @@ function probeMcpServer(projectRoot, spec) {
3688
3688
  method: "initialize",
3689
3689
  params: {
3690
3690
  capabilities: {},
3691
- clientInfo: { name: "threenative-doctor", version: "0.3.5" },
3691
+ clientInfo: { name: "threenative-doctor", version: "0.3.6" },
3692
3692
  protocolVersion: "2025-06-18"
3693
3693
  }
3694
3694
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-threenative",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "license": "MIT",
5
5
  "description": "Scaffold a readable ThreeNative game project.",
6
6
  "keywords": [
@@ -80,13 +80,13 @@
80
80
  "vite": "8.2.0",
81
81
  "@typescript/native": "npm:typescript@7.0.2",
82
82
  "@typescript/typescript6": "6.0.2",
83
- "threenative-blender-mcp": "0.1.5",
84
- "@threenative/physics": "0.3.5",
85
- "@threenative/assets": "0.3.6",
86
- "@threenative/core": "0.3.5"
83
+ "threenative-blender-mcp": "0.1.6",
84
+ "@threenative/core": "0.3.6",
85
+ "@threenative/assets": "0.3.7",
86
+ "@threenative/physics": "0.3.6"
87
87
  },
88
88
  "peerDependencies": {
89
- "@threenative/assets": ">=0.3.6 <0.4.0"
89
+ "@threenative/assets": ">=0.3.7 <0.4.0"
90
90
  },
91
91
  "scripts": {
92
92
  "build": "tsup --config tsup.config.ts && publint",
@@ -16,9 +16,9 @@
16
16
  "typecheck": "tsc --noEmit -p tsconfig.json"
17
17
  },
18
18
  "dependencies": {
19
- "@threenative/core": "0.3.5",
20
- "@threenative/physics": "0.3.5",
21
- "@threenative/ui": "0.3.5",
19
+ "@threenative/core": "0.3.6",
20
+ "@threenative/physics": "0.3.6",
21
+ "@threenative/ui": "0.3.6",
22
22
  "react": "19.2.0",
23
23
  "react-dom": "19.2.0",
24
24
  "three": "0.185.1"
@@ -26,13 +26,13 @@
26
26
  "devDependencies": {
27
27
  "@gltf-transform/cli": "4.4.2",
28
28
  "@tailwindcss/vite": "4.3.3",
29
- "@threenative/assets": "0.3.6",
30
- "@threenative/playtest": "0.3.5",
29
+ "@threenative/assets": "0.3.7",
30
+ "@threenative/playtest": "0.3.6",
31
31
  "@types/react": "19.2.0",
32
32
  "@types/react-dom": "19.2.0",
33
33
  "@types/three": "0.185.3",
34
34
  "@vitejs/plugin-react": "6.0.5",
35
- "create-threenative": "0.2.9",
35
+ "create-threenative": "0.2.10",
36
36
  "esbuild": "0.27.0",
37
37
  "playwright": "1.62.1",
38
38
  "tailwindcss": "4.3.3",
@@ -40,10 +40,11 @@
40
40
  "vite": "8.2.0"
41
41
  },
42
42
  "optionalDependencies": {
43
- "@threenative/runtime-native": "0.3.5"
43
+ "@threenative/runtime-native": "0.3.6"
44
44
  },
45
45
  "overrides": {
46
- "sharp": ">=0.35.4"
46
+ "sharp": ">=0.35.4",
47
+ "@vitejs/devtools": "0.4.1"
47
48
  },
48
49
  "pnpm": {
49
50
  "overrides": {
@@ -16,15 +16,15 @@
16
16
  "typecheck": "tsc --noEmit -p tsconfig.json"
17
17
  },
18
18
  "dependencies": {
19
- "@threenative/core": "0.3.5",
20
- "@threenative/physics": "0.3.5",
19
+ "@threenative/core": "0.3.6",
20
+ "@threenative/physics": "0.3.6",
21
21
  "three": "0.185.1"
22
22
  },
23
23
  "devDependencies": {
24
- "@threenative/assets": "0.3.6",
25
- "@threenative/playtest": "0.3.5",
24
+ "@threenative/assets": "0.3.7",
25
+ "@threenative/playtest": "0.3.6",
26
26
  "@types/three": "0.185.3",
27
- "create-threenative": "0.2.9",
27
+ "create-threenative": "0.2.10",
28
28
  "esbuild": "0.27.0",
29
29
  "playwright": "1.62.1",
30
30
  "typescript": "7.0.2",
@@ -32,10 +32,11 @@
32
32
  "@gltf-transform/cli": "4.4.2"
33
33
  },
34
34
  "optionalDependencies": {
35
- "@threenative/runtime-native": "0.3.5"
35
+ "@threenative/runtime-native": "0.3.6"
36
36
  },
37
37
  "overrides": {
38
- "sharp": ">=0.35.4"
38
+ "sharp": ">=0.35.4",
39
+ "@vitejs/devtools": "0.4.1"
39
40
  },
40
41
  "pnpm": {
41
42
  "overrides": {
@@ -16,9 +16,9 @@
16
16
  "typecheck": "tsc --noEmit -p tsconfig.json"
17
17
  },
18
18
  "dependencies": {
19
- "@threenative/core": "0.3.5",
20
- "@threenative/physics": "0.3.5",
21
- "@threenative/ui": "0.3.5",
19
+ "@threenative/core": "0.3.6",
20
+ "@threenative/physics": "0.3.6",
21
+ "@threenative/ui": "0.3.6",
22
22
  "react": "19.2.0",
23
23
  "react-dom": "19.2.0",
24
24
  "three": "0.185.1"
@@ -27,11 +27,11 @@
27
27
  "@tailwindcss/vite": "4.3.3",
28
28
  "@vitejs/plugin-react": "6.0.5",
29
29
  "@types/three": "0.185.3",
30
- "@threenative/assets": "0.3.6",
31
- "@threenative/playtest": "0.3.5",
30
+ "@threenative/assets": "0.3.7",
31
+ "@threenative/playtest": "0.3.6",
32
32
  "@types/react": "19.2.0",
33
33
  "@types/react-dom": "19.2.0",
34
- "create-threenative": "0.2.9",
34
+ "create-threenative": "0.2.10",
35
35
  "esbuild": "0.27.0",
36
36
  "playwright": "1.62.1",
37
37
  "tailwindcss": "4.3.3",
@@ -40,10 +40,11 @@
40
40
  "@gltf-transform/cli": "4.4.2"
41
41
  },
42
42
  "optionalDependencies": {
43
- "@threenative/runtime-native": "0.3.5"
43
+ "@threenative/runtime-native": "0.3.6"
44
44
  },
45
45
  "overrides": {
46
- "sharp": ">=0.35.4"
46
+ "sharp": ">=0.35.4",
47
+ "@vitejs/devtools": "0.4.1"
47
48
  },
48
49
  "pnpm": {
49
50
  "overrides": {
@@ -15,9 +15,9 @@
15
15
  "typecheck": "tsc --noEmit -p tsconfig.json"
16
16
  },
17
17
  "dependencies": {
18
- "@threenative/core": "0.3.5",
19
- "@threenative/physics": "0.3.5",
20
- "@threenative/ui": "0.3.5",
18
+ "@threenative/core": "0.3.6",
19
+ "@threenative/physics": "0.3.6",
20
+ "@threenative/ui": "0.3.6",
21
21
  "react": "19.2.0",
22
22
  "react-dom": "19.2.0",
23
23
  "three": "0.185.1"
@@ -25,13 +25,13 @@
25
25
  "devDependencies": {
26
26
  "@gltf-transform/cli": "4.4.2",
27
27
  "@tailwindcss/vite": "4.3.3",
28
- "@threenative/assets": "0.3.6",
29
- "@threenative/playtest": "0.3.5",
28
+ "@threenative/assets": "0.3.7",
29
+ "@threenative/playtest": "0.3.6",
30
30
  "@types/react": "19.2.0",
31
31
  "@types/react-dom": "19.2.0",
32
32
  "@types/three": "0.185.3",
33
33
  "@vitejs/plugin-react": "6.0.5",
34
- "create-threenative": "0.2.9",
34
+ "create-threenative": "0.2.10",
35
35
  "esbuild": "0.27.0",
36
36
  "playwright": "1.62.1",
37
37
  "tailwindcss": "4.3.3",
@@ -39,10 +39,11 @@
39
39
  "vite": "8.2.0"
40
40
  },
41
41
  "optionalDependencies": {
42
- "@threenative/runtime-native": "0.3.5"
42
+ "@threenative/runtime-native": "0.3.6"
43
43
  },
44
44
  "overrides": {
45
- "sharp": ">=0.35.4"
45
+ "sharp": ">=0.35.4",
46
+ "@vitejs/devtools": "0.4.1"
46
47
  },
47
48
  "pnpm": {
48
49
  "overrides": {
@@ -16,9 +16,9 @@
16
16
  "typecheck": "tsc --noEmit -p tsconfig.json"
17
17
  },
18
18
  "dependencies": {
19
- "@threenative/core": "0.3.5",
20
- "@threenative/physics": "0.3.5",
21
- "@threenative/ui": "0.3.5",
19
+ "@threenative/core": "0.3.6",
20
+ "@threenative/physics": "0.3.6",
21
+ "@threenative/ui": "0.3.6",
22
22
  "react": "19.2.0",
23
23
  "react-dom": "19.2.0",
24
24
  "three": "0.185.1"
@@ -26,13 +26,13 @@
26
26
  "devDependencies": {
27
27
  "@gltf-transform/cli": "4.4.2",
28
28
  "@tailwindcss/vite": "4.3.3",
29
- "@threenative/assets": "0.3.6",
30
- "@threenative/playtest": "0.3.5",
29
+ "@threenative/assets": "0.3.7",
30
+ "@threenative/playtest": "0.3.6",
31
31
  "@types/react": "19.2.0",
32
32
  "@types/react-dom": "19.2.0",
33
33
  "@types/three": "0.185.3",
34
34
  "@vitejs/plugin-react": "6.0.5",
35
- "create-threenative": "0.2.9",
35
+ "create-threenative": "0.2.10",
36
36
  "esbuild": "0.27.0",
37
37
  "playwright": "1.62.1",
38
38
  "tailwindcss": "4.3.3",
@@ -40,10 +40,11 @@
40
40
  "vite": "8.2.0"
41
41
  },
42
42
  "optionalDependencies": {
43
- "@threenative/runtime-native": "0.3.5"
43
+ "@threenative/runtime-native": "0.3.6"
44
44
  },
45
45
  "overrides": {
46
- "sharp": ">=0.35.4"
46
+ "sharp": ">=0.35.4",
47
+ "@vitejs/devtools": "0.4.1"
47
48
  },
48
49
  "pnpm": {
49
50
  "overrides": {
@@ -45,11 +45,11 @@ function distanceDensity(p: HeightFogParams = HEIGHT_FOG): number {
45
45
  }
46
46
 
47
47
  /**
48
- * Puts the sky on the scene, or a plain gradient if the photograph has not decoded yet.
48
+ * Puts the sky on the scene, or a plain gradient if no photograph is given.
49
49
  *
50
- * The second argument is optional because `Race.load()` does not wait for the JPEG: the scene has
51
- * to enter on the first frame or the playtest bridge describes nothing. Passing `undefined` here is
52
- * the fallback the scene starts in, and calling it again with the texture is the swap.
50
+ * `Race.load()` waits for the JPEG, so the scene enters with the photograph already applied. The
51
+ * fallback stays for a scene that has no sky asset, and a swap after the first frame is not safe on
52
+ * `engine: "threejs"` (see `Race.load`).
53
53
  */
54
54
  export function setupSky(scene: Scene, sky?: Texture): void {
55
55
  if (sky === undefined) {
@@ -97,52 +97,61 @@ export class Race extends Scene<GameState, IPhysicsContext> {
97
97
  #sky: Texture | undefined;
98
98
 
99
99
  /**
100
- * The sky photograph, fetched but **not awaited**.
100
+ * The sky photograph, **awaited** before the scene enters.
101
101
  *
102
- * `await`ing it here held the scene's first frame for the length of a texture decode, and the
103
- * playtest bridge describes the scene before the runtime enters it: `survives` failed
104
- * `TN_PLAYTEST_CAPABILITY_MISSING` on `runtime.components` because there was no `player` entity
105
- * yet to describe. The scene now enters on the fallback colour and the photograph is swapped in
106
- * the moment it decodes, which is also what a player sees — a sky that arrives rather than a
107
- * black screen that waits.
102
+ * It used to be fetched without waiting and swapped in when it decoded. On `engine: "threejs"`
103
+ * that swap lands in the middle of a frame (WebGPU rendering yields between its awaits), next to
104
+ * the shadow pass, which clears `scene.background` and puts it back. A swap after the first frame
105
+ * was never drawn: the sky stayed the fallback colour on a fast GPU, and the engine-parity guard
106
+ * scored the template 0.823 against the correct `threenative` frame, passing only when a slow
107
+ * adapter let the photograph land before the first render. Applied before the first frame the
108
+ * same texture draws, and parity scores 0.001.
108
109
  */
109
110
  #post: ReturnType<typeof setupPost> | undefined;
110
111
  #environmentSample: IEnvironmentSample | undefined;
111
112
  #materialLighting: ReturnType<typeof createMaterialLighting> | undefined;
112
113
  #lightingGeneration = 0;
113
114
 
114
- override load(ctx: GameCtx): void {
115
+ override async load(ctx: GameCtx): Promise<void> {
115
116
  const generation = ++this.#lightingGeneration;
116
- void ctx.assets.texture("sky.jpg").then(async (texture) => {
117
- if (generation !== this.#lightingGeneration) return;
118
- this.#sky = texture;
119
- const scene = ctx.scene;
120
- if (scene === undefined) return;
121
- setupSky(scene, texture);
122
- const controller = this.#materialLighting;
123
- const sample = await sampleEnvironment(ctx.renderer.raw, scene, {
124
- web: getPlatform().runtime === "web",
125
- rendererKind: ctx.renderer.kind,
126
- webglFallback: isWebGLFallbackRenderer(ctx.renderer.raw),
127
- mobile: isMobile(),
128
- software: ctx.renderer.softwareAdapter !== undefined,
129
- });
130
- if (generation !== this.#lightingGeneration || ctx.scene !== scene) return;
131
- this.#environmentSample = sample;
132
- // A cached sky may start sampling before enter creates the receiver controller.
133
- // A controller that already existed when sampling began must still be the same one.
134
- const currentController = this.#materialLighting;
135
- if (
136
- currentController !== undefined &&
137
- (controller === undefined || controller === currentController)
138
- )
139
- currentController.setEnvironmentMeasurement(
140
- sample.measurement,
141
- sample.source,
142
- sample.intensity,
143
- sample,
144
- );
117
+ const texture = await ctx.assets.texture("sky.jpg");
118
+ if (generation !== this.#lightingGeneration) return;
119
+ this.#sky = texture;
120
+ const scene = ctx.scene;
121
+ if (scene === undefined) return;
122
+ setupSky(scene, texture);
123
+ // The measurement is not awaited: it reads the GPU back and must not hold the first frame.
124
+ void this.#sampleSky(ctx, scene, generation);
125
+ }
126
+
127
+ async #sampleSky(
128
+ ctx: GameCtx,
129
+ scene: NonNullable<GameCtx["scene"]>,
130
+ generation: number,
131
+ ): Promise<void> {
132
+ const controller = this.#materialLighting;
133
+ const sample = await sampleEnvironment(ctx.renderer.raw, scene, {
134
+ web: getPlatform().runtime === "web",
135
+ rendererKind: ctx.renderer.kind,
136
+ webglFallback: isWebGLFallbackRenderer(ctx.renderer.raw),
137
+ mobile: isMobile(),
138
+ software: ctx.renderer.softwareAdapter !== undefined,
145
139
  });
140
+ if (generation !== this.#lightingGeneration || ctx.scene !== scene) return;
141
+ this.#environmentSample = sample;
142
+ // A cached sky may start sampling before enter creates the receiver controller.
143
+ // A controller that already existed when sampling began must still be the same one.
144
+ const currentController = this.#materialLighting;
145
+ if (
146
+ currentController !== undefined &&
147
+ (controller === undefined || controller === currentController)
148
+ )
149
+ currentController.setEnvironmentMeasurement(
150
+ sample.measurement,
151
+ sample.source,
152
+ sample.intensity,
153
+ sample,
154
+ );
146
155
  }
147
156
 
148
157
  override enter(ctx: GameCtx): SceneFrame<GameState, IPhysicsContext> {
@@ -15,8 +15,8 @@
15
15
  "typecheck": "tsc --noEmit -p tsconfig.json"
16
16
  },
17
17
  "dependencies": {
18
- "@threenative/core": "0.3.5",
19
- "@threenative/ui": "0.3.5",
18
+ "@threenative/core": "0.3.6",
19
+ "@threenative/ui": "0.3.6",
20
20
  "react": "19.2.0",
21
21
  "react-dom": "19.2.0",
22
22
  "react-reconciler": "0.33.0",
@@ -24,13 +24,13 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@tailwindcss/vite": "4.3.3",
27
- "@threenative/assets": "0.3.6",
28
- "@threenative/playtest": "0.3.5",
27
+ "@threenative/assets": "0.3.7",
28
+ "@threenative/playtest": "0.3.6",
29
29
  "@types/react": "19.2.0",
30
30
  "@types/react-dom": "19.2.0",
31
31
  "@types/three": "0.185.3",
32
32
  "@vitejs/plugin-react": "6.0.5",
33
- "create-threenative": "0.2.9",
33
+ "create-threenative": "0.2.10",
34
34
  "esbuild": "0.27.0",
35
35
  "playwright": "1.62.1",
36
36
  "tailwindcss": "4.3.3",
@@ -40,10 +40,11 @@
40
40
  "@typescript/typescript6": "6.0.2"
41
41
  },
42
42
  "optionalDependencies": {
43
- "@threenative/runtime-native": "0.3.5"
43
+ "@threenative/runtime-native": "0.3.6"
44
44
  },
45
45
  "overrides": {
46
- "sharp": ">=0.35.4"
46
+ "sharp": ">=0.35.4",
47
+ "@vitejs/devtools": "0.4.1"
47
48
  },
48
49
  "pnpm": {
49
50
  "overrides": {
@@ -16,8 +16,8 @@
16
16
  "typecheck": "tsc --noEmit -p tsconfig.json"
17
17
  },
18
18
  "dependencies": {
19
- "@threenative/core": "0.3.5",
20
- "@threenative/ui": "0.3.5",
19
+ "@threenative/core": "0.3.6",
20
+ "@threenative/ui": "0.3.6",
21
21
  "react": "19.2.0",
22
22
  "react-dom": "19.2.0",
23
23
  "three": "0.185.1"
@@ -25,13 +25,13 @@
25
25
  "devDependencies": {
26
26
  "@gltf-transform/cli": "4.4.2",
27
27
  "@tailwindcss/vite": "4.3.3",
28
- "@threenative/assets": "0.3.6",
29
- "@threenative/playtest": "0.3.5",
28
+ "@threenative/assets": "0.3.7",
29
+ "@threenative/playtest": "0.3.6",
30
30
  "@types/react": "19.2.0",
31
31
  "@types/react-dom": "19.2.0",
32
32
  "@types/three": "0.185.3",
33
33
  "@vitejs/plugin-react": "6.0.5",
34
- "create-threenative": "0.2.9",
34
+ "create-threenative": "0.2.10",
35
35
  "esbuild": "0.27.0",
36
36
  "playwright": "1.62.1",
37
37
  "tailwindcss": "4.3.3",
@@ -39,10 +39,11 @@
39
39
  "vite": "8.2.0"
40
40
  },
41
41
  "optionalDependencies": {
42
- "@threenative/runtime-native": "0.3.5"
42
+ "@threenative/runtime-native": "0.3.6"
43
43
  },
44
44
  "overrides": {
45
- "sharp": ">=0.35.4"
45
+ "sharp": ">=0.35.4",
46
+ "@vitejs/devtools": "0.4.1"
46
47
  },
47
48
  "pnpm": {
48
49
  "overrides": {
@@ -15,9 +15,9 @@
15
15
  "typecheck": "tsc --noEmit -p tsconfig.json"
16
16
  },
17
17
  "dependencies": {
18
- "@threenative/core": "0.3.5",
19
- "@threenative/physics": "0.3.5",
20
- "@threenative/ui": "0.3.5",
18
+ "@threenative/core": "0.3.6",
19
+ "@threenative/physics": "0.3.6",
20
+ "@threenative/ui": "0.3.6",
21
21
  "react": "19.2.0",
22
22
  "react-dom": "19.2.0",
23
23
  "three": "0.185.1"
@@ -25,13 +25,13 @@
25
25
  "devDependencies": {
26
26
  "@gltf-transform/cli": "4.4.2",
27
27
  "@tailwindcss/vite": "4.3.3",
28
- "@threenative/assets": "0.3.6",
29
- "@threenative/playtest": "0.3.5",
28
+ "@threenative/assets": "0.3.7",
29
+ "@threenative/playtest": "0.3.6",
30
30
  "@types/react": "19.2.0",
31
31
  "@types/react-dom": "19.2.0",
32
32
  "@types/three": "0.185.3",
33
33
  "@vitejs/plugin-react": "6.0.5",
34
- "create-threenative": "0.2.9",
34
+ "create-threenative": "0.2.10",
35
35
  "esbuild": "0.27.0",
36
36
  "playwright": "1.62.1",
37
37
  "tailwindcss": "4.3.3",
@@ -39,10 +39,11 @@
39
39
  "vite": "8.2.0"
40
40
  },
41
41
  "optionalDependencies": {
42
- "@threenative/runtime-native": "0.3.5"
42
+ "@threenative/runtime-native": "0.3.6"
43
43
  },
44
44
  "overrides": {
45
- "sharp": ">=0.35.4"
45
+ "sharp": ">=0.35.4",
46
+ "@vitejs/devtools": "0.4.1"
46
47
  },
47
48
  "pnpm": {
48
49
  "overrides": {
@@ -16,9 +16,9 @@
16
16
  "typecheck": "tsc --noEmit -p tsconfig.json"
17
17
  },
18
18
  "dependencies": {
19
- "@threenative/core": "0.3.5",
20
- "@threenative/physics": "0.3.5",
21
- "@threenative/ui": "0.3.5",
19
+ "@threenative/core": "0.3.6",
20
+ "@threenative/physics": "0.3.6",
21
+ "@threenative/ui": "0.3.6",
22
22
  "react": "19.2.0",
23
23
  "react-dom": "19.2.0",
24
24
  "react-reconciler": "0.33.0",
@@ -26,13 +26,13 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@tailwindcss/vite": "4.3.3",
29
- "@threenative/assets": "0.3.6",
30
- "@threenative/playtest": "0.3.5",
29
+ "@threenative/assets": "0.3.7",
30
+ "@threenative/playtest": "0.3.6",
31
31
  "@types/react": "19.2.0",
32
32
  "@types/react-dom": "19.2.0",
33
33
  "@types/three": "0.185.3",
34
34
  "@vitejs/plugin-react": "6.0.5",
35
- "create-threenative": "0.2.9",
35
+ "create-threenative": "0.2.10",
36
36
  "esbuild": "0.27.0",
37
37
  "playwright": "1.62.1",
38
38
  "tailwindcss": "4.3.3",
@@ -41,10 +41,11 @@
41
41
  "@gltf-transform/cli": "4.4.2"
42
42
  },
43
43
  "optionalDependencies": {
44
- "@threenative/runtime-native": "0.3.5"
44
+ "@threenative/runtime-native": "0.3.6"
45
45
  },
46
46
  "overrides": {
47
- "sharp": ">=0.35.4"
47
+ "sharp": ">=0.35.4",
48
+ "@vitejs/devtools": "0.4.1"
48
49
  },
49
50
  "pnpm": {
50
51
  "overrides": {
@@ -16,9 +16,9 @@
16
16
  "typecheck": "tsc --noEmit -p tsconfig.json"
17
17
  },
18
18
  "dependencies": {
19
- "@threenative/core": "0.3.5",
20
- "@threenative/physics": "0.3.5",
21
- "@threenative/ui": "0.3.5",
19
+ "@threenative/core": "0.3.6",
20
+ "@threenative/physics": "0.3.6",
21
+ "@threenative/ui": "0.3.6",
22
22
  "react": "19.2.0",
23
23
  "react-dom": "19.2.0",
24
24
  "three": "0.185.1"
@@ -27,12 +27,12 @@
27
27
  "@tailwindcss/vite": "4.3.3",
28
28
  "@types/three": "0.185.3",
29
29
  "@vitejs/plugin-react": "6.0.5",
30
- "@threenative/assets": "0.3.6",
31
- "@threenative/playtest": "0.3.5",
30
+ "@threenative/assets": "0.3.7",
31
+ "@threenative/playtest": "0.3.6",
32
32
  "@types/react": "19.2.0",
33
33
  "@types/react-dom": "19.2.0",
34
34
  "playwright": "1.62.1",
35
- "create-threenative": "0.2.9",
35
+ "create-threenative": "0.2.10",
36
36
  "esbuild": "0.27.0",
37
37
  "tailwindcss": "4.3.3",
38
38
  "typescript": "7.0.2",
@@ -40,10 +40,11 @@
40
40
  "@gltf-transform/cli": "4.4.2"
41
41
  },
42
42
  "optionalDependencies": {
43
- "@threenative/runtime-native": "0.3.5"
43
+ "@threenative/runtime-native": "0.3.6"
44
44
  },
45
45
  "overrides": {
46
- "sharp": ">=0.35.4"
46
+ "sharp": ">=0.35.4",
47
+ "@vitejs/devtools": "0.4.1"
47
48
  },
48
49
  "pnpm": {
49
50
  "overrides": {
@@ -16,9 +16,9 @@
16
16
  "typecheck": "tsc --noEmit -p tsconfig.json"
17
17
  },
18
18
  "dependencies": {
19
- "@threenative/core": "0.3.5",
20
- "@threenative/physics": "0.3.5",
21
- "@threenative/ui": "0.3.5",
19
+ "@threenative/core": "0.3.6",
20
+ "@threenative/physics": "0.3.6",
21
+ "@threenative/ui": "0.3.6",
22
22
  "react": "19.2.0",
23
23
  "react-dom": "19.2.0",
24
24
  "react-reconciler": "0.33.0",
@@ -26,13 +26,13 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@tailwindcss/vite": "4.3.3",
29
- "@threenative/assets": "0.3.6",
30
- "@threenative/playtest": "0.3.5",
29
+ "@threenative/assets": "0.3.7",
30
+ "@threenative/playtest": "0.3.6",
31
31
  "@types/react": "19.2.0",
32
32
  "@types/react-dom": "19.2.0",
33
33
  "@types/three": "0.185.3",
34
34
  "@vitejs/plugin-react": "6.0.5",
35
- "create-threenative": "0.2.9",
35
+ "create-threenative": "0.2.10",
36
36
  "esbuild": "0.27.0",
37
37
  "playwright": "1.62.1",
38
38
  "tailwindcss": "4.3.3",
@@ -41,10 +41,11 @@
41
41
  "@gltf-transform/cli": "4.4.2"
42
42
  },
43
43
  "optionalDependencies": {
44
- "@threenative/runtime-native": "0.3.5"
44
+ "@threenative/runtime-native": "0.3.6"
45
45
  },
46
46
  "overrides": {
47
- "sharp": ">=0.35.4"
47
+ "sharp": ">=0.35.4",
48
+ "@vitejs/devtools": "0.4.1"
48
49
  },
49
50
  "pnpm": {
50
51
  "overrides": {
@@ -17,9 +17,9 @@
17
17
  "typecheck": "tsc --noEmit -p tsconfig.json"
18
18
  },
19
19
  "dependencies": {
20
- "@threenative/core": "0.3.5",
21
- "@threenative/physics": "0.3.5",
22
- "@threenative/ui": "0.3.5",
20
+ "@threenative/core": "0.3.6",
21
+ "@threenative/physics": "0.3.6",
22
+ "@threenative/ui": "0.3.6",
23
23
  "react": "19.2.0",
24
24
  "react-dom": "19.2.0",
25
25
  "react-reconciler": "0.33.0",
@@ -27,13 +27,13 @@
27
27
  },
28
28
  "devDependencies": {
29
29
  "@tailwindcss/vite": "4.3.3",
30
- "@threenative/assets": "0.3.6",
31
- "@threenative/playtest": "0.3.5",
30
+ "@threenative/assets": "0.3.7",
31
+ "@threenative/playtest": "0.3.6",
32
32
  "@types/react": "19.2.0",
33
33
  "@types/react-dom": "19.2.0",
34
34
  "@types/three": "0.185.3",
35
35
  "@vitejs/plugin-react": "6.0.5",
36
- "create-threenative": "0.2.9",
36
+ "create-threenative": "0.2.10",
37
37
  "esbuild": "0.27.0",
38
38
  "playwright": "1.62.1",
39
39
  "tailwindcss": "4.3.3",
@@ -42,10 +42,11 @@
42
42
  "@gltf-transform/cli": "4.4.2"
43
43
  },
44
44
  "optionalDependencies": {
45
- "@threenative/runtime-native": "0.3.5"
45
+ "@threenative/runtime-native": "0.3.6"
46
46
  },
47
47
  "overrides": {
48
- "sharp": ">=0.35.4"
48
+ "sharp": ">=0.35.4",
49
+ "@vitejs/devtools": "0.4.1"
49
50
  },
50
51
  "pnpm": {
51
52
  "overrides": {
@@ -35,6 +35,32 @@
35
35
  "waitTicks": 120,
36
36
  "release": true
37
37
  },
38
+ {
39
+ "kind": "input",
40
+ "label": "restart-2",
41
+ "press": "KeyR",
42
+ "holdTicks": 1,
43
+ "release": true
44
+ },
45
+ {
46
+ "kind": "wait",
47
+ "label": "restarted-2",
48
+ "waitTicks": 60,
49
+ "release": true
50
+ },
51
+ {
52
+ "kind": "input",
53
+ "label": "restart-3",
54
+ "press": "KeyR",
55
+ "holdTicks": 1,
56
+ "release": true
57
+ },
58
+ {
59
+ "kind": "wait",
60
+ "label": "restarted-3",
61
+ "waitTicks": 60,
62
+ "release": true
63
+ },
38
64
  {
39
65
  "kind": "input",
40
66
  "label": "moved-after-restart",
@@ -67,6 +93,14 @@
67
93
  {
68
94
  "label": "restarted",
69
95
  "equals": 0
96
+ },
97
+ {
98
+ "label": "restarted-2",
99
+ "equals": 0
100
+ },
101
+ {
102
+ "label": "restarted-3",
103
+ "equals": 0
70
104
  }
71
105
  ]
72
106
  },
@@ -81,6 +115,14 @@
81
115
  {
82
116
  "label": "restarted",
83
117
  "equals": 4
118
+ },
119
+ {
120
+ "label": "restarted-2",
121
+ "equals": 4
122
+ },
123
+ {
124
+ "label": "restarted-3",
125
+ "equals": 4
84
126
  }
85
127
  ]
86
128
  }
@@ -39,6 +39,12 @@ interface IPostController {
39
39
  const GRADE_TABLE_URL = "grade.cube";
40
40
 
41
41
  let active: IPostController | undefined;
42
+ /**
43
+ * The table, kept for the page's life. Every scene entry builds a controller, and a restart is an
44
+ * entry: fetching the file again and rebuilding the chain around it compiled the whole graph
45
+ * twice, and the world stayed black behind the HUD for both compiles.
46
+ */
47
+ let cachedTable: IGradeTable | undefined;
42
48
 
43
49
  /** The starter's game.ts connects its existing completed frame-window callback here. */
44
50
  export function observeQualityWindow(window: IQualityWindow): void {
@@ -73,7 +79,7 @@ export function setupPost(
73
79
  let disposed = false;
74
80
  let disposeGraph: (() => void) | undefined;
75
81
  let medium: FogMedium | undefined;
76
- let table: IGradeTable | undefined;
82
+ let table: IGradeTable | undefined = cachedTable;
77
83
  // The opt-in `traa` stage publishes its provider here once the chain has built it, so `debug()`
78
84
  // reports the live reconstruction state and a scene can reset history on a teleport.
79
85
  let temporal: TemporalAAProvider | undefined;
@@ -113,8 +119,9 @@ export function setupPost(
113
119
  environment.onTierChanged?.(policy.tier);
114
120
  }
115
121
  apply();
116
- // The table is a file, so it lands after the chain that would read it. Until then both stages
117
- // are refused with a reason rather than grading nothing, and the chain is rebuilt once it does.
122
+ // The table is a file, so on the first entry it lands after the chain that would read it. Until
123
+ // then both stages are refused with a reason rather than grading nothing, and the chain is
124
+ // rebuilt once it does. Later entries start with the table and never rebuild.
118
125
  // The loader parses `FloatType`, because the default 8-bit load *truncates* `value * 255` into a
119
126
  // `Uint8Array`. An identity table then reads low by up to 0.875 of a step, and the round trip
120
127
  // through the grade is never the frame the game drew. Parsed floats keep the file's own numbers.
@@ -122,20 +129,20 @@ export function setupPost(
122
129
  // without the optional `float32-filterable` feature, so the lookup would sample the nearest of
123
130
  // the nine cells. The arithmetic in `__tests__/grade.spec.ts` runs on those half floats.
124
131
  const tableLoader = new LUTCubeLoader().setType(FloatType);
125
- void tableLoader.loadAsync(GRADE_TABLE_URL).then(
126
- (loaded) => {
127
- table?.texture.dispose();
128
- table = { size: loaded.size, texture: filterableTable(loaded.texture3D) };
129
- if (!disposed) apply();
130
- },
131
- (error: unknown) => {
132
- // A missing table is this game's file, not the harness's: name it and leave the frame
133
- // ungraded rather than reporting a stage as applied that never ran.
134
- console.error(
135
- `TN_GRADE_TABLE ${GRADE_TABLE_URL}: ${error instanceof Error ? error.message : String(error)}`,
136
- );
137
- },
138
- );
132
+ if (table === undefined)
133
+ void tableLoader.loadAsync(GRADE_TABLE_URL).then(
134
+ (loaded) => {
135
+ table = cachedTable = { size: loaded.size, texture: filterableTable(loaded.texture3D) };
136
+ if (!disposed) apply();
137
+ },
138
+ (error: unknown) => {
139
+ // A missing table is this game's file, not the harness's: name it and leave the frame
140
+ // ungraded rather than reporting a stage as applied that never ran.
141
+ console.error(
142
+ `TN_GRADE_TABLE ${GRADE_TABLE_URL}: ${error instanceof Error ? error.message : String(error)}`,
143
+ );
144
+ },
145
+ );
139
146
  const source = environment.tier === undefined ? "platform" : "override";
140
147
  console.info(
141
148
  `TN_QUALITY_TIER ${policy.tier} mobile=${environment.mobile === true} software=${
@@ -166,9 +173,8 @@ export function setupPost(
166
173
  disposeGraph = undefined;
167
174
  medium?.dispose();
168
175
  medium = undefined;
169
- // The table outlives any one chain — a tier change rebuilds the graph around the same one —
170
- // so it is released here and not by a stage that would take it with the first replacement.
171
- table?.texture.dispose();
176
+ // The table outlives any one chain and any one scene — a tier change or a restart builds a
177
+ // graph around the same one — so no stage and no controller releases it.
172
178
  table = undefined;
173
179
  temporal = undefined;
174
180
  if (active === controller) active = undefined;
@@ -15,9 +15,9 @@
15
15
  "typecheck": "tsc --noEmit -p tsconfig.json"
16
16
  },
17
17
  "dependencies": {
18
- "@threenative/core": "0.3.5",
19
- "@threenative/physics": "0.3.5",
20
- "@threenative/ui": "0.3.5",
18
+ "@threenative/core": "0.3.6",
19
+ "@threenative/physics": "0.3.6",
20
+ "@threenative/ui": "0.3.6",
21
21
  "react": "19.2.0",
22
22
  "react-dom": "19.2.0",
23
23
  "three": "0.185.1"
@@ -25,13 +25,13 @@
25
25
  "devDependencies": {
26
26
  "@gltf-transform/cli": "4.4.2",
27
27
  "@tailwindcss/vite": "4.3.3",
28
- "@threenative/assets": "0.3.6",
29
- "@threenative/playtest": "0.3.5",
28
+ "@threenative/assets": "0.3.7",
29
+ "@threenative/playtest": "0.3.6",
30
30
  "@types/react": "19.2.0",
31
31
  "@types/react-dom": "19.2.0",
32
32
  "@types/three": "0.185.3",
33
33
  "@vitejs/plugin-react": "6.0.5",
34
- "create-threenative": "0.2.9",
34
+ "create-threenative": "0.2.10",
35
35
  "esbuild": "0.27.0",
36
36
  "playwright": "1.62.1",
37
37
  "tailwindcss": "4.3.3",
@@ -39,10 +39,11 @@
39
39
  "vite": "8.2.0"
40
40
  },
41
41
  "optionalDependencies": {
42
- "@threenative/runtime-native": "0.3.5"
42
+ "@threenative/runtime-native": "0.3.6"
43
43
  },
44
44
  "overrides": {
45
- "sharp": ">=0.35.4"
45
+ "sharp": ">=0.35.4",
46
+ "@vitejs/devtools": "0.4.1"
46
47
  },
47
48
  "pnpm": {
48
49
  "overrides": {