@threenative/core 0.3.12 → 0.3.13

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.
Files changed (150) hide show
  1. package/README.md +1 -1
  2. package/capabilities.json +746 -32
  3. package/dist/{assets-YUbXa3-Y.d.ts → assets-CfMKnOsK.d.ts} +78 -1
  4. package/dist/{canvas-layer-CWuFRT7G.d.ts → canvas-layer-G7ttVy7y.d.ts} +1 -1
  5. package/dist/{chunk-7UUT3TY5.js → chunk-4SRAQFTU.js} +1 -1
  6. package/dist/{chunk-GMHATRPW.js → chunk-DIPIJICH.js} +1590 -375
  7. package/dist/{chunk-OKXUCASC.js → chunk-EEABDLUC.js} +3 -4
  8. package/dist/{chunk-5O73CDMR.js → chunk-EFWZWLPY.js} +62 -16
  9. package/dist/{chunk-N5LRP4BR.js → chunk-GYUZJQ7U.js} +63 -3
  10. package/dist/{chunk-VAZM36TV.js → chunk-H4J6IAJE.js} +17 -10
  11. package/dist/{chunk-2Z44XSI2.js → chunk-SV4QVUTQ.js} +3 -7
  12. package/dist/{chunk-DBELTTTM.js → chunk-U4YHUKKL.js} +1 -1
  13. package/dist/chunk-VP43GIWW.js +18 -0
  14. package/dist/{chunk-6KLNISRJ.js → chunk-XDTZ4QMO.js} +11 -4
  15. package/dist/default-tone-mapping-GgKPTiBP.d.ts +4 -0
  16. package/dist/{game-D7pAzZUY.d.ts → game-k8K3hZai.d.ts} +72 -8
  17. package/dist/hot.d.ts +5 -4
  18. package/dist/hot.js +5 -8
  19. package/dist/index.d.ts +289 -1034
  20. package/dist/index.js +3096 -1305
  21. package/dist/{model-lod-B6BMqS1r.d.ts → model-lod-DPTzeCcD.d.ts} +4 -2
  22. package/dist/playtest.d.ts +5 -4
  23. package/dist/playtest.js +6 -5
  24. package/dist/quality-BYqKGAwo.d.ts +868 -0
  25. package/dist/react.d.ts +3 -2
  26. package/dist/render-environment.d.ts +170 -0
  27. package/dist/render-environment.js +352 -0
  28. package/dist/{renderer-DvFVoAgj.d.ts → renderer-BtOSseYf.d.ts} +29 -31
  29. package/dist/spells/index.js +1 -1
  30. package/dist/ui-layer.js +3 -2
  31. package/dist/worker.js +12 -5
  32. package/dist/world.d.ts +269 -15
  33. package/dist/world.js +1372 -628
  34. package/mcp/animation-server.mjs +1 -1
  35. package/mcp/engine-server.mjs +105 -7
  36. package/mcp/servers.mjs +4 -4
  37. package/package.json +10 -6
  38. package/src/animation-batch.ts +193 -0
  39. package/src/animation-layers.ts +7 -3
  40. package/src/animation.ts +209 -29
  41. package/src/asset-cache.ts +3 -3
  42. package/src/asset-memo.ts +202 -0
  43. package/src/assets.ts +436 -131
  44. package/src/auto-batch.ts +190 -44
  45. package/src/compute-driven.ts +1 -1
  46. package/src/config.ts +8 -0
  47. package/src/debug.ts +103 -22
  48. package/src/dev-global.ts +54 -0
  49. package/src/engine-hooks.ts +37 -0
  50. package/src/frame-budget.ts +19 -3
  51. package/src/game-boot-phase.ts +269 -0
  52. package/src/game-dev-tools.ts +7 -14
  53. package/src/game-frame-loop.ts +45 -82
  54. package/src/game-startup.ts +145 -70
  55. package/src/game-ui.ts +84 -0
  56. package/src/game.ts +168 -552
  57. package/src/gamepad-mappings.ts +269 -0
  58. package/src/generated/console-markers.ts +13 -0
  59. package/src/geometry-capture.ts +28 -4
  60. package/src/gpu-readings.ts +98 -0
  61. package/src/gpu-scene-bvh.ts +149 -36
  62. package/src/hot.ts +4 -7
  63. package/src/index.ts +115 -8
  64. package/src/input.ts +237 -25
  65. package/src/instanced-batch-lod.ts +3 -8
  66. package/src/interpolation.ts +171 -40
  67. package/src/look/ao-admission.ts +4 -3
  68. package/src/look/auto-exposure.ts +5 -16
  69. package/src/look/default-tone-mapping.ts +41 -5
  70. package/src/look/local-exposure.ts +2 -7
  71. package/src/look/quad-pass.ts +21 -0
  72. package/src/look/quality.ts +4 -0
  73. package/src/look/unreal-bloom.ts +4 -13
  74. package/src/look/world-environment.ts +58 -115
  75. package/src/merge-parts.ts +20 -24
  76. package/src/model-lod.ts +97 -14
  77. package/src/particle-significance.ts +12 -0
  78. package/src/particles.ts +19 -10
  79. package/src/platform.ts +23 -4
  80. package/src/profiling/FrameStages.ts +5 -6
  81. package/src/profiling/Spans.ts +3 -17
  82. package/src/profiling/debug-telemetry.ts +2 -6
  83. package/src/profiling/render-list-validate.ts +6 -15
  84. package/src/projection-marker.ts +2 -1
  85. package/src/quiet-markers.ts +3 -10
  86. package/src/render/cpu-bvh.ts +100 -0
  87. package/src/render/depth-pyramid.ts +6 -14
  88. package/src/render/environment/environmentContribution.ts +202 -0
  89. package/src/render/environment/environmentRadiance.ts +44 -0
  90. package/src/render/environment/environmentSampleCache.ts +56 -0
  91. package/src/render/environment/environmentSampling.ts +201 -0
  92. package/src/render/environment/environmentSnapshot.ts +71 -0
  93. package/src/render/environment/gate.ts +57 -0
  94. package/src/render/mesh-pool.ts +3 -19
  95. package/src/render/probe-trace.ts +872 -0
  96. package/src/render/probe-volume.ts +780 -34
  97. package/src/render/radiance-cache.ts +17 -0
  98. package/src/render/virtual-shadow-partial.ts +13 -0
  99. package/src/render/virtual-shadow.ts +18 -16
  100. package/src/render/world-impostor-surface.ts +109 -6
  101. package/src/render/world-impostor.ts +5 -2
  102. package/src/render-camera-cull.ts +98 -3
  103. package/src/render-environment.ts +41 -0
  104. package/src/renderer-config.ts +36 -0
  105. package/src/renderer-facts.ts +37 -0
  106. package/src/renderer.ts +52 -28
  107. package/src/resolution-scaler.ts +3 -2
  108. package/src/scene-entry-inspectors.ts +61 -0
  109. package/src/snow-field.ts +1 -0
  110. package/src/startup-offscreen-bytes.ts +78 -0
  111. package/src/static-transform.ts +25 -19
  112. package/src/streamed-textures.ts +112 -0
  113. package/src/streaming.ts +68 -4
  114. package/src/texture-streaming.ts +331 -0
  115. package/src/version.ts +1 -1
  116. package/src/worker.ts +12 -2
  117. package/src/world-bundle-safety.ts +55 -10
  118. package/src/world-cell-batches.ts +162 -200
  119. package/src/world-cell-chunks.ts +3 -7
  120. package/src/world-cell-impostors.ts +20 -8
  121. package/src/world-cell-options.ts +2 -14
  122. package/src/world-cell-placements.ts +194 -90
  123. package/src/world-cell-prewarm.ts +39 -4
  124. package/src/world-cell-records.ts +401 -0
  125. package/src/world-cell-render-bundles.ts +2 -2
  126. package/src/world-cell-render-gpu-dress.ts +13 -17
  127. package/src/world-cell-render-main-cull.ts +73 -17
  128. package/src/world-cell-render-util.ts +17 -4
  129. package/src/world-cell-render.ts +13 -5
  130. package/src/world-cell-residency.ts +15 -6
  131. package/src/world-cell-stale.ts +238 -0
  132. package/src/world-cells.ts +22 -5
  133. package/src/world-gpu-flags.ts +18 -50
  134. package/src/world-gpu-reference.ts +22 -8
  135. package/src/world-gpu-scene.ts +44 -24
  136. package/src/world-gpu-shadow.ts +21 -8
  137. package/src/world-gpu-types.ts +41 -13
  138. package/src/world-load-limiter.ts +5 -0
  139. package/src/world-model-sections.ts +80 -0
  140. package/src/world-river-ribbon.ts +282 -0
  141. package/src/world-root-frame.ts +39 -0
  142. package/src/world-shore-field.ts +91 -0
  143. package/src/world-static-pose.ts +163 -0
  144. package/src/world-surface-sampler.ts +48 -0
  145. package/src/world-terrain-splat.ts +10 -18
  146. package/src/world-tile-budget.ts +4 -11
  147. package/src/world-tiles.ts +79 -12
  148. package/src/world-validate.ts +6 -14
  149. package/src/world-warm.ts +51 -0
  150. package/src/world.ts +13 -0
@@ -1,7 +1,9 @@
1
- import { debugRequested, countDebug, isContentScaled } from './chunk-N5LRP4BR.js';
1
+ import { debugRequested, countDebug, isContentScaled } from './chunk-GYUZJQ7U.js';
2
2
  import { mrt, velocity, output, context } from 'three/tsl';
3
3
  import { BatchedMesh, DataTexture } from 'three';
4
4
 
5
+ // src/version.ts
6
+ var CORE_VERSION = "0.3.13";
5
7
  var THREE_NATIVE_BATCHED_VELOCITY_PATCH = "threeNativeBatchedVelocityPatch";
6
8
  function isBatchedMeshVelocityPatched() {
7
9
  return Reflect.get(BatchedMesh, THREE_NATIVE_BATCHED_VELOCITY_PATCH) === true;
@@ -333,9 +335,6 @@ function copyInto(target, source) {
333
335
  return target;
334
336
  }
335
337
 
336
- // src/version.ts
337
- var CORE_VERSION = "0.3.12";
338
-
339
338
  // src/pipeline-census.ts
340
339
  var PIPELINE_CENSUS_VERSION = 1;
341
340
  var PIPELINE_CENSUS_CAPABILITY = "runtime.pipelineCensus";
@@ -412,11 +412,21 @@ function biasedLodDistance(distance) {
412
412
  return distance * lodBiasState.value;
413
413
  }
414
414
  var nearest = new Vector3();
415
+ var LOD_NEAR_PLANE = 0;
415
416
  function conservativeViewDepth(camera, center, radius, nearPlane) {
416
417
  nearest.copy(center).applyMatrix4(camera.matrixWorldInverse);
417
418
  const depth = -nearest.z - Math.max(0, radius);
418
419
  return { depth, degenerate: depth <= nearPlane };
419
420
  }
421
+ function selectLodFor(camera, sphere, nearPlane) {
422
+ const { depth, degenerate } = conservativeViewDepth(
423
+ camera,
424
+ sphere.center,
425
+ sphere.radius,
426
+ nearPlane
427
+ );
428
+ return { biased: biasedLodDistance(depth), degenerate, depth };
429
+ }
420
430
  function worldSphere(local, object, out = new Sphere().copy(local), matrix = object.matrixWorld) {
421
431
  out.center.copy(local.center).applyMatrix4(matrix);
422
432
  const scale = matrix.getMaxScaleOnAxis();
@@ -492,9 +502,15 @@ async function readPendingLevels(parser, def) {
492
502
  }
493
503
  return { absoluteErrors, indices: resolved, lod0Triangles: def.lod0Triangles };
494
504
  }
505
+ var levelTriangles = /* @__PURE__ */ new WeakMap();
495
506
  function drawTriangles(geometry) {
496
- const drawn = geometry.index?.count ?? geometry.getAttribute("position")?.count ?? 0;
497
- return Math.floor(drawn / 3);
507
+ let triangles = levelTriangles.get(geometry);
508
+ if (triangles === void 0) {
509
+ const drawn = geometry.index?.count ?? geometry.getAttribute("position")?.count ?? 0;
510
+ triangles = Math.floor(drawn / 3);
511
+ levelTriangles.set(geometry, triangles);
512
+ }
513
+ return triangles;
498
514
  }
499
515
  var ModelLod = class {
500
516
  #mesh;
@@ -533,16 +549,15 @@ var ModelLod = class {
533
549
  return;
534
550
  }
535
551
  const world = worldSphere(this.#chain.sphere, this.#mesh, void 0, this.#mesh.matrixWorld);
536
- const { depth, degenerate } = conservativeViewDepth(
552
+ const { biased, degenerate } = selectLodFor(
537
553
  camera,
538
- world.center,
539
- world.radius,
554
+ world,
540
555
  camera.near ?? 0
541
556
  );
542
557
  const view = {
543
558
  camera,
544
559
  degenerate,
545
- depth: biasedLodDistance(depth),
560
+ depth: biased,
546
561
  viewportHeight
547
562
  };
548
563
  const index = selectLodLevel(
@@ -568,10 +583,9 @@ var ModelLod = class {
568
583
  const container = this.#container;
569
584
  if (container === null) return;
570
585
  const world = worldSphere(rung.sphere, container, void 0, container.matrixWorld);
571
- const { depth, degenerate } = conservativeViewDepth(
586
+ const { biased, degenerate } = selectLodFor(
572
587
  camera,
573
- world.center,
574
- world.radius,
588
+ world,
575
589
  camera.near ?? 0
576
590
  );
577
591
  const errors = [...this.#chain.errors, rung.error];
@@ -579,7 +593,7 @@ var ModelLod = class {
579
593
  const view = {
580
594
  camera,
581
595
  degenerate,
582
- depth: biasedLodDistance(depth),
596
+ depth: biased,
583
597
  viewportHeight
584
598
  };
585
599
  const index = selectLodLevel(
@@ -856,7 +870,27 @@ function registerModelLodController(mesh, controller) {
856
870
  function isChained(object) {
857
871
  const mesh = object;
858
872
  const geometry = mesh.geometry;
859
- return mesh.isMesh === true && geometry !== void 0 && chains.has(geometry);
873
+ return mesh.isMesh === true && geometry !== void 0 && (chains.has(geometry) || streaming.has(geometry));
874
+ }
875
+ var streaming = /* @__PURE__ */ new WeakSet();
876
+ function markStreamedGeometry(coarse) {
877
+ streaming.add(coarse);
878
+ }
879
+ function isStreamedGeometry(geometry) {
880
+ return streaming.has(geometry);
881
+ }
882
+ function upgradeStreamedGeometry(coarse, full) {
883
+ const attributes = full.attributes;
884
+ for (const name of Object.keys(coarse.attributes))
885
+ if (attributes[name] === void 0) coarse.deleteAttribute(name);
886
+ for (const [name, attribute] of Object.entries(attributes)) coarse.setAttribute(name, attribute);
887
+ coarse.setIndex(full.index);
888
+ coarse.computeBoundingBox();
889
+ coarse.computeBoundingSphere();
890
+ levelTriangles.delete(coarse);
891
+ const registered = chains.get(full);
892
+ if (registered !== void 0) chains.set(coarse, registered);
893
+ streaming.delete(coarse);
860
894
  }
861
895
  function controllerFor(mesh) {
862
896
  const existing = controllers.get(mesh);
@@ -1211,7 +1245,7 @@ function updateModelLods(root, camera, viewportHeight) {
1211
1245
  for (const mesh of tracking.items) {
1212
1246
  const entry = controllerFor(mesh);
1213
1247
  if (entry === void 0) {
1214
- tracking.items.delete(mesh);
1248
+ if (!streaming.has(mesh.geometry)) tracking.items.delete(mesh);
1215
1249
  continue;
1216
1250
  }
1217
1251
  entry.update(camera, viewportHeight);
@@ -1314,12 +1348,12 @@ function projectedCenter(centre, camera, viewportWidth, viewportHeight) {
1314
1348
  function projectedSize(sphere, camera, viewportHeight) {
1315
1349
  if (!(viewportHeight > 0)) return void 0;
1316
1350
  const like = camera;
1317
- const near = like.near ?? 0.1;
1351
+ const near = like.near ?? LOD_NEAR_PLANE;
1318
1352
  const distance = centreScratch.copy(sphere.center).distanceTo(camera.getWorldPosition(new Vector3()));
1319
1353
  let depth;
1320
1354
  let degenerate;
1321
1355
  try {
1322
- const view = conservativeViewDepth(camera, sphere.center, sphere.radius, near);
1356
+ const view = selectLodFor(camera, sphere, near);
1323
1357
  depth = view.depth;
1324
1358
  degenerate = view.degenerate;
1325
1359
  } catch {
@@ -1344,6 +1378,7 @@ function rendererBackendIdentity(raw) {
1344
1378
  var GeometryCapture = class {
1345
1379
  #pending;
1346
1380
  #armed;
1381
+ #deferredPasses;
1347
1382
  /**
1348
1383
  * Arms one capture and answers its report. A malformed request throws rather than quietly
1349
1384
  * choosing a scope the caller did not ask for. Concurrent requests coalesce onto one frame.
@@ -1436,7 +1471,12 @@ var GeometryCapture = class {
1436
1471
  * Ends the frame: removes every hook, reconciles the rows against the measured pass totals and
1437
1472
  * answers the waiting request.
1438
1473
  */
1439
- finishFrame(passes) {
1474
+ finishFrame(passes, options) {
1475
+ if (options?.drawsAfterFrame === true && this.#pending !== void 0) {
1476
+ this.#deferredPasses = passes;
1477
+ return;
1478
+ }
1479
+ this.#deferredPasses = void 0;
1440
1480
  const armed = this.#armed;
1441
1481
  const pending = this.#pending;
1442
1482
  this.#restore();
@@ -1445,8 +1485,14 @@ var GeometryCapture = class {
1445
1485
  this.#pending = void 0;
1446
1486
  pending.settle(buildReport(armed, passes, pending));
1447
1487
  }
1488
+ /** Answers a capture whose frame a host drew after the frame callback. A no-op otherwise. */
1489
+ settleDeferred() {
1490
+ const passes = this.#deferredPasses;
1491
+ if (passes !== void 0) this.finishFrame(passes);
1492
+ }
1448
1493
  /** Drops a pending capture and every hook. A scene exit is not a reason to report a stale frame. */
1449
1494
  cancel(reason) {
1495
+ this.#deferredPasses = void 0;
1450
1496
  const pending = this.#pending;
1451
1497
  this.#restore();
1452
1498
  this.#pending = void 0;
@@ -1846,4 +1892,4 @@ function reconcile(passes, drafts) {
1846
1892
  });
1847
1893
  }
1848
1894
 
1849
- export { ClusteredMesh, DISCRETE_LOD_DEFAULT_ERROR_PIXELS, DISCRETE_LOD_DEFAULT_HYSTERESIS, DiscreteLodPlugin, GEOMETRY_ASSET_KEY, GEOMETRY_CAPTURE_CAPABILITY, GEOMETRY_CAPTURE_DEFAULT_LIMIT, GEOMETRY_CAPTURE_MAX_LIMIT, GEOMETRY_CAPTURE_SORTS, GEOMETRY_CAPTURE_TIMEOUT_MS, GEOMETRY_CAPTURE_WALK_CAP, GeometryCapture, TN_DISCRETE_LOD, TN_VIRTUAL_GEOMETRY, VirtualGeometryPlugin, baseGeometryOf, biasedLodDistance, conservativeViewDepth, isEngineRenderHook, isLodJoinProxy, lodChainOf, lodPixelScale, markEngineRenderHook, pixelsPerUnit, projectedLodError, registerModelLodController, rendererBackendIdentity, selectClusterCut, selectLodLevel, setLodBias, setModelLodLayers, updateClusteredMeshes, updateModelLods, worldSphere };
1895
+ export { ClusteredMesh, DISCRETE_LOD_DEFAULT_ERROR_PIXELS, DISCRETE_LOD_DEFAULT_HYSTERESIS, DiscreteLodPlugin, GEOMETRY_ASSET_KEY, GEOMETRY_CAPTURE_CAPABILITY, GEOMETRY_CAPTURE_DEFAULT_LIMIT, GEOMETRY_CAPTURE_MAX_LIMIT, GEOMETRY_CAPTURE_SORTS, GEOMETRY_CAPTURE_TIMEOUT_MS, GEOMETRY_CAPTURE_WALK_CAP, GeometryCapture, LOD_NEAR_PLANE, TN_DISCRETE_LOD, TN_VIRTUAL_GEOMETRY, VirtualGeometryPlugin, baseGeometryOf, biasedLodDistance, isEngineRenderHook, isLodJoinProxy, isStreamedGeometry, lodChainOf, lodPixelScale, markEngineRenderHook, markStreamedGeometry, pixelsPerUnit, projectedLodError, registerModelLodController, rendererBackendIdentity, selectClusterCut, selectLodFor, selectLodLevel, setLodBias, setModelLodLayers, updateClusteredMeshes, updateModelLods, upgradeStreamedGeometry, worldSphere };
@@ -1,3 +1,64 @@
1
+ import { devGlobal, publishDevGlobal } from './chunk-VP43GIWW.js';
2
+
3
+ // src/debug.ts
4
+ function envName(name) {
5
+ return `TN_DEBUG_${name.replace(/([a-z0-9])([A-Z])/gu, "$1_$2").toUpperCase()}`;
6
+ }
7
+ function readLaunchSeams(spec, search) {
8
+ const values = [];
9
+ if (spec.environment.length > 0) {
10
+ const env = envValue(spec.environment);
11
+ if (env !== void 0 && env !== "") values.push(env);
12
+ }
13
+ const query = search ?? globalThis.location?.search;
14
+ if (typeof query === "string") {
15
+ const fromQuery = new URLSearchParams(query).get(spec.query);
16
+ if (fromQuery !== null) values.push(fromQuery);
17
+ }
18
+ if (spec.global !== void 0) {
19
+ const fromGlobal = globalThis[spec.global];
20
+ if (typeof fromGlobal === "string") values.push(fromGlobal);
21
+ else if (typeof fromGlobal === "number") values.push(String(fromGlobal));
22
+ else if (typeof fromGlobal === "boolean") values.push(fromGlobal ? "true" : "false");
23
+ }
24
+ return values;
25
+ }
26
+ function isOff(value) {
27
+ return value === "0" || value === "false";
28
+ }
29
+ function readLaunchFlag(spec, askedFor = "on", search) {
30
+ const values = readLaunchSeams(spec, search);
31
+ return askedFor === "off" ? values.some((value) => isOff(value)) : values.some((value) => !isOff(value));
32
+ }
33
+ function readLaunchValue(spec) {
34
+ return readLaunchSeams(spec)[0];
35
+ }
36
+ function readLaunchValues(spec) {
37
+ return readLaunchSeams(spec);
38
+ }
39
+ function envValue(name) {
40
+ const scope = globalThis;
41
+ if (typeof scope !== "object" || scope === null || !("process" in scope)) return void 0;
42
+ const hostProcess = scope.process;
43
+ if (typeof hostProcess !== "object" || hostProcess === null || !("env" in hostProcess))
44
+ return void 0;
45
+ const env = hostProcess.env;
46
+ if (typeof env !== "object" || env === null) return void 0;
47
+ const value = env[name];
48
+ return typeof value === "string" ? value : void 0;
49
+ }
50
+ function debugFlag(name) {
51
+ return readLaunchFlag({ environment: envName(name), query: name });
52
+ }
53
+ function exposeDebug(name, value) {
54
+ const isDev = import.meta.env?.DEV === true;
55
+ if (!isDev) return;
56
+ const tools = devGlobal(globalThis) ?? {};
57
+ const debug = tools.debug ?? {};
58
+ debug[name] = value;
59
+ publishDevGlobal("debug", debug, globalThis);
60
+ }
61
+
1
62
  // src/profiling/debug-telemetry.ts
2
63
  var CONTENT_SCALED_LIMIT = 10;
3
64
  function isContentScaled(name) {
@@ -5,8 +66,7 @@ function isContentScaled(name) {
5
66
  }
6
67
  var DEBUG_GLOBAL = "__THREENATIVE_DEBUG__";
7
68
  function debugRequested() {
8
- const host = globalThis;
9
- return host.process?.env?.TN_DEBUG === "1" || globalThis[DEBUG_GLOBAL] === true || /[?&]tnDebug=1(?:&|$)/u.test(globalThis.location?.search ?? "");
69
+ return readLaunchFlag({ environment: "TN_DEBUG", global: DEBUG_GLOBAL, query: "tnDebug" });
10
70
  }
11
71
  function countDebug(name, value, area, caller, unit = "count") {
12
72
  if (!Number.isFinite(value) || value < 0)
@@ -217,4 +277,4 @@ function debugHotCalls(window) {
217
277
  return calls.length === 0 ? void 0 : `TN_HOT_CALL:${JSON.stringify({ window: window.window, intervalMs: interval, calls })}`;
218
278
  }
219
279
 
220
- export { countDebug, debugHotCalls, debugRequested, formatDebugReport, isContentScaled, measureDebug, observeDebugGc };
280
+ export { countDebug, debugFlag, debugHotCalls, debugRequested, exposeDebug, formatDebugReport, isContentScaled, measureDebug, observeDebugGc, readLaunchFlag, readLaunchValue, readLaunchValues };
@@ -359,16 +359,23 @@ var GPUParticles3D = class extends Sprite {
359
359
  if (camera !== void 0 && !this.castShadow && this.#authoredVisible) {
360
360
  const bounds = this.measuredBounds;
361
361
  if (bounds !== void 0 && this.#graceSeconds !== Number.POSITIVE_INFINITY) {
362
- if (camera.matrixWorldAutoUpdate) camera.updateMatrixWorld();
363
- this.updateWorldMatrix(true, false);
364
- viewProjection.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);
365
- frustum.setFromProjectionMatrix(
366
- viewProjection,
367
- camera.coordinateSystem,
368
- camera.reversedDepth
369
- );
370
- worldBox.copy(bounds).applyMatrix4(this.matrixWorld).expandByScalar(this.#worldPadding);
371
- if (frustum.intersectsBox(worldBox)) this.#outsideSince = void 0;
362
+ const engine = this.__boundsInView;
363
+ let inView;
364
+ if (typeof engine === "function")
365
+ inView = engine.call(this, camera, bounds, this.#padding ?? Number.NaN);
366
+ else {
367
+ if (camera.matrixWorldAutoUpdate) camera.updateMatrixWorld();
368
+ this.updateWorldMatrix(true, false);
369
+ viewProjection.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);
370
+ frustum.setFromProjectionMatrix(
371
+ viewProjection,
372
+ camera.coordinateSystem,
373
+ camera.reversedDepth
374
+ );
375
+ worldBox.copy(bounds).applyMatrix4(this.matrixWorld).expandByScalar(this.#worldPadding);
376
+ inView = frustum.intersectsBox(worldBox);
377
+ }
378
+ if (inView) this.#outsideSince = void 0;
372
379
  else {
373
380
  const now = simulatedSeconds ?? performance.now() / 1e3;
374
381
  this.#outsideSince ??= now;
@@ -1,15 +1,11 @@
1
+ import { readLaunchFlag } from './chunk-GYUZJQ7U.js';
2
+
1
3
  // src/quiet-markers.ts
2
4
  var LOG_FLAG = "TN_LOG";
3
5
  var BROWSER_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "file:"]);
4
6
  var restore;
5
- var isOn = (value) => value === true || typeof value === "string" && value !== "" && value !== "0" && value !== "false";
6
7
  function markerLogRequested() {
7
- const host = globalThis;
8
- if (isOn(host.process?.env?.[LOG_FLAG])) return true;
9
- const query = globalThis.location?.search;
10
- if (typeof query === "string" && /[?&]tnLog=(?!0(?:&|$))(?!false(?:&|$))[^&]/u.test(query))
11
- return true;
12
- return isOn(globalThis.__THREENATIVE_LOG__);
8
+ return readLaunchFlag({ environment: LOG_FLAG, global: "__THREENATIVE_LOG__", query: "tnLog" });
13
9
  }
14
10
  function installQuietMarkers() {
15
11
  const protocol = globalThis.location?.protocol;
@@ -1,4 +1,4 @@
1
- import { hostGestureTarget, hostWindow } from './chunk-6KLNISRJ.js';
1
+ import { hostGestureTarget, hostWindow } from './chunk-XDTZ4QMO.js';
2
2
  import { AudioListener, Object3D, Audio, PositionalAudio, AudioContext } from 'three';
3
3
 
4
4
  var AUDIO_STATE = /* @__PURE__ */ Symbol.for("threenative.audio.runtime");
@@ -0,0 +1,18 @@
1
+ // src/dev-global.ts
2
+ var DEV_GLOBAL_KEY = "__THREENATIVE__";
3
+ function devGlobal(scope) {
4
+ const value = scope?.[DEV_GLOBAL_KEY];
5
+ return typeof value === "object" && value !== null ? value : void 0;
6
+ }
7
+ function publishDevGlobal(name, value, scope) {
8
+ const host = scope;
9
+ if (host === void 0) return;
10
+ const current = devGlobal(scope);
11
+ if (current !== void 0) {
12
+ current[name] = value;
13
+ return;
14
+ }
15
+ host[DEV_GLOBAL_KEY] = { [name]: value };
16
+ }
17
+
18
+ export { DEV_GLOBAL_KEY, devGlobal, publishDevGlobal };
@@ -1,6 +1,7 @@
1
1
  // src/platform.ts
2
2
  var DESKTOP_OS = /* @__PURE__ */ new Set(["linux", "macos", "windows"]);
3
3
  var MOBILE_OS = /* @__PURE__ */ new Set(["android", "ios"]);
4
+ var CONSOLE_OS = /* @__PURE__ */ new Set(["ps4"]);
4
5
  function isRecord(value) {
5
6
  return typeof value === "object" && value !== null && !Array.isArray(value);
6
7
  }
@@ -19,16 +20,16 @@ function nativePlatform(source) {
19
20
  const formFactor = descriptor.formFactor;
20
21
  const maxTouchPoints = descriptor.maxTouchPoints;
21
22
  if (runtime !== "native") invalidNativePlatform("runtime must be native");
22
- if (os !== "android" && os !== "ios" && os !== "linux" && os !== "macos" && os !== "windows" && os !== "unknown") {
23
+ if (os !== "android" && os !== "ios" && os !== "linux" && os !== "macos" && os !== "windows" && os !== "ps4" && os !== "unknown") {
23
24
  invalidNativePlatform("os is unknown");
24
25
  }
25
- if (formFactor !== "mobile" && formFactor !== "desktop" && formFactor !== "unknown") {
26
+ if (formFactor !== "mobile" && formFactor !== "desktop" && formFactor !== "console" && formFactor !== "unknown") {
26
27
  invalidNativePlatform("formFactor is unknown");
27
28
  }
28
29
  if (!Number.isInteger(maxTouchPoints) || maxTouchPoints < 0) {
29
30
  invalidNativePlatform("maxTouchPoints must be a non-negative integer");
30
31
  }
31
- const expectedFormFactor = MOBILE_OS.has(os) ? "mobile" : DESKTOP_OS.has(os) ? "desktop" : "unknown";
32
+ const expectedFormFactor = MOBILE_OS.has(os) ? "mobile" : DESKTOP_OS.has(os) ? "desktop" : CONSOLE_OS.has(os) ? "console" : "unknown";
32
33
  if (formFactor !== expectedFormFactor) {
33
34
  invalidNativePlatform("os and formFactor disagree");
34
35
  }
@@ -134,6 +135,12 @@ function isNative() {
134
135
  function isMobile() {
135
136
  return getPlatform().formFactor === "mobile";
136
137
  }
138
+ function isConsole() {
139
+ return getPlatform().formFactor === "console";
140
+ }
141
+ function isPs4() {
142
+ return getPlatform().os === "ps4";
143
+ }
137
144
  function isTouchscreenAvailable() {
138
145
  return getPlatform().maxTouchPoints > 0;
139
146
  }
@@ -150,4 +157,4 @@ function hostResizeObserver() {
150
157
  return typeof ResizeObserver === "undefined" ? void 0 : ResizeObserver;
151
158
  }
152
159
 
153
- export { getPlatform, hostDocument, hostGestureTarget, hostResizeObserver, hostWindow, isMobile, isNative, isTouchscreenAvailable, isWeb };
160
+ export { getPlatform, hostDocument, hostGestureTarget, hostResizeObserver, hostWindow, isConsole, isMobile, isNative, isPs4, isTouchscreenAvailable, isWeb };
@@ -0,0 +1,4 @@
1
+ /** `filmic` is a fresh Unreal 5.8.3 project's curve and the default; the rest are the named overrides. */
2
+ type RendererToneMapping = "filmic" | "aces" | "agx" | "neutral" | "none";
3
+
4
+ export type { RendererToneMapping as R };
@@ -1,7 +1,7 @@
1
- import { I as IAssetLoader, a as IAssetLoaderOptions } from './assets-YUbXa3-Y.js';
2
- import { F as FramePassKind, c as IRenderPassSample, d as IFramePhaseSample, e as IPipelineCensus, I as IRendererLike, f as IRendererOptions, a as IFrameBudgetWindow, g as IFrameBudgetOptions } from './renderer-DvFVoAgj.js';
1
+ import { I as IAssetLoader, a as IAssetLoaderOptions } from './assets-CfMKnOsK.js';
2
+ import { F as FramePassKind, c as IRenderPassSample, d as IFramePhaseSample, e as IRendererOptions, f as IPipelineCensus, I as IRendererLike, a as IFrameBudgetWindow, g as IFrameBudgetOptions } from './renderer-BtOSseYf.js';
3
3
  import { Vector2, Vector3, Object3D, Camera, Intersection, Scene as Scene$1 } from 'three';
4
- import { V as Viewport, C as CanvasLayer, I as IViewportOptions } from './canvas-layer-CWuFRT7G.js';
4
+ import { V as Viewport, C as CanvasLayer, I as IViewportOptions } from './canvas-layer-G7ttVy7y.js';
5
5
  import { StoreApi } from 'zustand/vanilla';
6
6
 
7
7
  type EntitySnapshot = Record<string, Record<string, unknown> & {
@@ -349,6 +349,14 @@ interface IThreeNativeConfig {
349
349
  readonly orientation?: ThreeNativeOrientation;
350
350
  readonly fullscreen?: boolean;
351
351
  readonly keepScreenOn?: boolean;
352
+ /**
353
+ * CPU priority of a shipped native game (PRD-859). `"game"`, the default, raises the game, render
354
+ * and present threads above other programs and lowers the game's own background work (shader
355
+ * compiles, workers, the HUD processes), through the route each OS allows without admin rights.
356
+ * `"normal"` keeps the OS default. The player reports what the OS applied on its
357
+ * `TN_PROCESS_PRIORITY` line. The browser owns scheduling, so a web build ignores it.
358
+ */
359
+ readonly priority?: "game" | "normal";
352
360
  /**
353
361
  * Maximum native presentation rate in frames per second. Left out, it follows the display's own
354
362
  * refresh rate capped at 120 on desktop and web, and stays 60 on mobile where the ceiling is
@@ -838,8 +846,24 @@ interface IInputGamepad {
838
846
  readonly buttons: readonly {
839
847
  readonly pressed: boolean;
840
848
  }[];
849
+ /** The browser's device name, which carries the vendor:product an unmapped pad is looked up by. */
850
+ readonly id?: string;
851
+ /**
852
+ * `"standard"` when the pad already uses the W3C standard layout, and `""` when the browser does
853
+ * not know the device. A source with no `mapping` at all is standard by construction: the owned
854
+ * native host builds standard pads, and so does a fixture.
855
+ */
856
+ readonly mapping?: string;
841
857
  }
842
858
  type InputPlatformSource = () => readonly (IInputGamepad | null)[];
859
+ interface IInputMapOptions {
860
+ /**
861
+ * Radial dead zone for both sticks, `0`..`1`. Default `0.2`, the stock Enhanced Input dead zone
862
+ * (`UInputModifierDeadZone`, `LowerThreshold = 0.2`, `EDeadZoneType::Radial`). A stick inside it
863
+ * reads zero, one outside it is rescaled so full tilt is still `1`. `0` publishes raw axes.
864
+ */
865
+ readonly gamepadDeadZone?: number;
866
+ }
843
867
  interface IRawInputPointer {
844
868
  readonly id: number;
845
869
  buttons: number;
@@ -880,7 +904,13 @@ declare function captureMouse(target: EventTarget): Promise<void> | undefined;
880
904
  declare class InputMap {
881
905
  #private;
882
906
  readonly raw: IRawInputState;
883
- constructor(bindings?: InputBindings, target?: EventTarget, pointerTarget?: EventTarget, source?: InputPlatformSource, contextMenu?: ContextMenuPolicy);
907
+ /**
908
+ * Radial dead zone for both sticks; `0` publishes the raw axes. Read on every tick, so a game may
909
+ * change it while running, and a value that is not a finite number from 0 through 1 reads as raw
910
+ * axes. `defineGame({ gamepadDeadZone })` sets the starting value and refuses one it cannot honour.
911
+ */
912
+ gamepadDeadZone: number;
913
+ constructor(bindings?: InputBindings, target?: EventTarget, pointerTarget?: EventTarget, source?: InputPlatformSource, contextMenu?: ContextMenuPolicy, options?: IInputMapOptions);
884
914
  /**
885
915
  * Returns a 2D action vector where +y is up. On a conventional XZ ground plane whose
886
916
  * forward direction is -z, map `vector.y` to `-z`. This differs from Godot's
@@ -897,7 +927,11 @@ declare class InputMap {
897
927
  * a third pointer is ignored and a changing pair starts a new gesture without a jump.
898
928
  */
899
929
  axis(name: string): number;
900
- /** Request pointer capture explicitly from a named game gesture. Relative bindings request it on canvas click by default. */
930
+ /**
931
+ * Request pointer capture explicitly from a named game gesture. Relative bindings request it on
932
+ * canvas click by default. A refused lock — an unfocused window, an untrusted gesture — leaves
933
+ * `raw.pointer.captured` false and warns once as `TN_POINTER_LOCK_REFUSED:`, never a rejection.
934
+ */
901
935
  captureMouse(): void;
902
936
  /** Release pointer capture. A browser refusal remains an unhandled rejection. */
903
937
  releaseMouse(): void;
@@ -938,6 +972,18 @@ interface IRandom {
938
972
  }
939
973
  declare function createRandom(seed?: number): IRandom;
940
974
 
975
+ type RendererConfig = NonNullable<IThreeNativeConfig["renderer"]>;
976
+ /**
977
+ * What `defineGame({ renderer })` accepts: the project's portable renderer config (`threenative.config.ts`
978
+ * `renderer`, including its `android` block and `"auto"` scale) beside the live renderer options.
979
+ *
980
+ * One key for both. `defineGame` once took the portable config as `render` and the live options as
981
+ * `renderer`, so a game wrote `render: config.renderer` beside a second `renderer:` and the
982
+ * antialias and scale resolvers each fell back from one to the other. The scale is the one field
983
+ * the two disagreed on, and the portable form (a number or `"auto"`) is the superset.
984
+ */
985
+ type GameRendererConfig = Omit<IRendererOptions, "resolutionScale" | "scaleSource"> & RendererConfig;
986
+
941
987
  interface IRaycastOptions {
942
988
  /** Screen point in canvas pixels. Mutually exclusive with `origin` and `direction`. */
943
989
  readonly screen?: Vector2;
@@ -1695,6 +1741,12 @@ interface IGameConfig<TState extends Record<string, unknown> = Record<string, un
1695
1741
  * the browser menu over its canvas.
1696
1742
  */
1697
1743
  readonly contextMenu?: ContextMenuPolicy;
1744
+ /**
1745
+ * Radial dead zone for both controller sticks, `0`..`1`. Default `0.2`, the stock Enhanced Input
1746
+ * value, so a worn stick resting at `0.08` reads zero instead of walking the character. A stick
1747
+ * past the zone is rescaled so full tilt is still `1`. Pass `0` to read raw axes.
1748
+ */
1749
+ readonly gamepadDeadZone?: number;
1698
1750
  /**
1699
1751
  * Per-frame cost attribution, on by default. Every `reportEvery` presented frames the game
1700
1752
  * prints one `TN_FRAME_BUDGET` line naming where the frame went — present wait, simulation,
@@ -1756,8 +1808,20 @@ interface IGameConfig<TState extends Record<string, unknown> = Record<string, un
1756
1808
  * 60 fps default rather than a scaler with no target.
1757
1809
  */
1758
1810
  readonly display?: NonNullable<IThreeNativeConfig["display"]>;
1759
- readonly render?: NonNullable<IThreeNativeConfig["renderer"]>;
1760
- readonly renderer?: IRendererOptions;
1811
+ /**
1812
+ * The project's renderer settings: `config.renderer` from `threenative.config.ts` beside the live
1813
+ * renderer options, as one key.
1814
+ *
1815
+ * `render` once carried the portable half, so a game wrote `render: config.renderer` beside a
1816
+ * second `renderer:` and the antialias and scale resolvers each fell back from one to the other.
1817
+ * The keys are one now; `render` is adopted onto this one and reported as renamed.
1818
+ */
1819
+ readonly renderer?: GameRendererConfig;
1820
+ /**
1821
+ * @deprecated The retired name for {@link renderer}, adopted onto it and reported. Move the object
1822
+ * to `renderer` with no other change.
1823
+ */
1824
+ readonly render?: GameRendererConfig;
1761
1825
  readonly seed?: number;
1762
1826
  readonly scenes: Record<string, SceneConstructor<TState, TPhysics>>;
1763
1827
  /**
@@ -1840,4 +1904,4 @@ interface IGame<TState extends Record<string, unknown> = Record<string, unknown>
1840
1904
  }
1841
1905
  declare function defineGame<TState extends Record<string, unknown>, TPhysics = undefined>(config: IGameConfig<TState, TPhysics>): IGame<TState, TPhysics>;
1842
1906
 
1843
- export { type IWarmUpRenderer as $, type AfterPhysicsCallback as A, type IRandom as B, type ContextMenuPolicy as C, type IRawInputPointer as D, type IRawInputPointerEdge as E, type IRawInputState as F, GEOMETRY_ASSET_KEY as G, type IRaycastOptions as H, type IGame as I, type IScenePickerOptions as J, type IThreeNativeAudioConfig as K, type IThreeNativeAudioLoop as L, type IThreeNativeAudioOverride as M, type IThreeNativeAudioSpectrum as N, type IThreeNativeBootSplash as O, type IThreeNativeConfig as P, type IThreeNativeIconVariants as Q, type IThreeNativeLodConfig as R, type IThreeNativeLodGenerationConfig as S, type IThreeNativeLodOverride as T, type IThreeNativeLodRuntimeConfig as U, type IThreeNativeTexturesConfig as V, type ITweenOptions as W, type IWarmUpCacheOptions as X, type IWarmUpObservation as Y, type IWarmUpOptions as Z, type IWarmUpProgress as _, type IGamePluginHooks as a, type IWarmUpReport as a0, type InputBindings as a1, InputMap as a2, type InputPlatformSource as a3, type PointerEvent3DListener as a4, type PointerEvent3DType as a5, PointerEvents3D as a6, Scene as a7, type SceneFrame as a8, ScenePicker as a9, type ScheduleHandle as aa, Scheduler as ab, type ThreeNativeBackgroundMode as ac, type ThreeNativeLodMinTrianglesScope as ad, type ThreeNativeLodPreset as ae, type ThreeNativeOrientation as af, type ThreeNativeUiRenderer as ag, type WarmUpCacheStatus as ah, type WarmUpObservationStatus as ai, afterPhysics as aj, captureMouse as ak, createRandom as al, defineGame as am, warmUpScene as an, type IGamePluginRuntime as b, GEOMETRY_CAPTURE_DEFAULT_LIMIT as c, GEOMETRY_CAPTURE_MAX_LIMIT as d, GEOMETRY_CAPTURE_SORTS as e, GEOMETRY_CAPTURE_TIMEOUT_MS as f, GEOMETRY_CAPTURE_WALK_CAP as g, type GeometryCaptureSort as h, type ICtx as i, type IGameObservationContribution as j, type IGameObservationSampleRequest as k, type IGamePlatformSource as l, type IGeometryCaptureAsset as m, type IGeometryCaptureMesh as n, type IGeometryCapturePass as o, type IGeometryCaptureReport as p, type IGeometryCaptureRequest as q, type IGeometryCaptureRow as r, type IInputAction as s, type IInputGamepad as t, type IPointerDragHandle as u, type IPointerEvent3D as v, type IPointerEvents3D as w, type IPointerEvents3DOptions as x, type IPointerEvents3DPicker as y, type IPointerState as z };
1907
+ export { type IWarmUpOptions as $, type AfterPhysicsCallback as A, type IPointerState as B, type ContextMenuPolicy as C, type IRandom as D, type EntitySnapshot as E, type IRawInputPointer as F, GEOMETRY_ASSET_KEY as G, type IRawInputPointerEdge as H, type IGame as I, type IRawInputState as J, type IRaycastOptions as K, type IScenePickerOptions as L, type IThreeNativeAudioConfig as M, type IThreeNativeAudioLoop as N, type IThreeNativeAudioOverride as O, type IThreeNativeAudioSpectrum as P, type IThreeNativeBootSplash as Q, type IThreeNativeConfig as R, type IThreeNativeIconVariants as S, type IThreeNativeLodConfig as T, type IThreeNativeLodGenerationConfig as U, type IThreeNativeLodOverride as V, type IThreeNativeLodRuntimeConfig as W, type IThreeNativeTexturesConfig as X, type ITweenOptions as Y, type IWarmUpCacheOptions as Z, type IWarmUpObservation as _, type IGamePluginHooks as a, type IWarmUpProgress as a0, type IWarmUpRenderer as a1, type IWarmUpReport as a2, type InputBindings as a3, InputMap as a4, type InputPlatformSource as a5, type PointerEvent3DListener as a6, type PointerEvent3DType as a7, PointerEvents3D as a8, Scene as a9, type SceneFrame as aa, ScenePicker as ab, type ScheduleHandle as ac, Scheduler as ad, type ThreeNativeBackgroundMode as ae, type ThreeNativeLodMinTrianglesScope as af, type ThreeNativeLodPreset as ag, type ThreeNativeOrientation as ah, type ThreeNativeUiRenderer as ai, type WarmUpCacheStatus as aj, type WarmUpObservationStatus as ak, afterPhysics as al, captureMouse as am, createRandom as an, defineGame as ao, warmUpScene as ap, type IGeometryCaptureRequest as b, type IGeometryCaptureReport as c, type IGamePluginRuntime as d, GEOMETRY_CAPTURE_DEFAULT_LIMIT as e, GEOMETRY_CAPTURE_MAX_LIMIT as f, GEOMETRY_CAPTURE_SORTS as g, GEOMETRY_CAPTURE_TIMEOUT_MS as h, GEOMETRY_CAPTURE_WALK_CAP as i, type GeometryCaptureSort as j, type ICtx as k, type IGameObservationContribution as l, type IGameObservationSampleRequest as m, type IGamePlatformSource as n, type IGeometryCaptureAsset as o, type IGeometryCaptureMesh as p, type IGeometryCapturePass as q, type IGeometryCaptureRow as r, type IInputAction as s, type IInputGamepad as t, type IInputMapOptions as u, type IPointerDragHandle as v, type IPointerEvent3D as w, type IPointerEvents3D as x, type IPointerEvents3DOptions as y, type IPointerEvents3DPicker as z };
package/dist/hot.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import { a as audioRuntimeSnapshot } from './audio-DIJE5HTr.js';
2
- import { I as IGame } from './game-D7pAzZUY.js';
2
+ import { I as IGame } from './game-k8K3hZai.js';
3
3
  import 'three';
4
- import './assets-YUbXa3-Y.js';
5
- import './renderer-DvFVoAgj.js';
4
+ import './assets-CfMKnOsK.js';
5
+ import './renderer-BtOSseYf.js';
6
6
  import 'three/webgpu';
7
- import './canvas-layer-CWuFRT7G.js';
7
+ import './default-tone-mapping-GgKPTiBP.js';
8
+ import './canvas-layer-G7ttVy7y.js';
8
9
  import 'zustand/vanilla';
9
10
 
10
11
  interface IHotDiagnostics {
package/dist/hot.js CHANGED
@@ -1,5 +1,6 @@
1
- import { audioRuntimeSnapshot } from './chunk-DBELTTTM.js';
2
- import { hostWindow, hostDocument } from './chunk-6KLNISRJ.js';
1
+ import { audioRuntimeSnapshot } from './chunk-U4YHUKKL.js';
2
+ import { hostWindow, hostDocument } from './chunk-XDTZ4QMO.js';
3
+ import { publishDevGlobal, devGlobal } from './chunk-VP43GIWW.js';
3
4
 
4
5
  // src/hot.ts
5
6
  var isDev = import.meta.env?.DEV === true;
@@ -22,12 +23,8 @@ function acceptHotUpdate(game, hot) {
22
23
  }
23
24
  const page = hostWindow();
24
25
  if (isDev && page !== void 0) {
25
- const host = page;
26
- host.__THREENATIVE__ = {
27
- ...host.__THREENATIVE__,
28
- hot: () => diagnostics(game, reloads),
29
- snapshot: host.__THREENATIVE__?.snapshot ?? (() => ({}))
30
- };
26
+ publishDevGlobal("hot", () => diagnostics(game, reloads), page);
27
+ if (devGlobal(page)?.snapshot === void 0) publishDevGlobal("snapshot", () => ({}), page);
31
28
  }
32
29
  let disposed = false;
33
30
  hot.dispose((data) => {