@pascal-app/viewer 1.0.4 → 1.0.6

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 (183) hide show
  1. package/dist/capture/capture-runtime.js +1 -1
  2. package/dist/components/error-boundary.d.ts.map +1 -1
  3. package/dist/components/renderers/node-renderer.d.ts +1 -1
  4. package/dist/components/renderers/node-renderer.d.ts.map +1 -1
  5. package/dist/components/renderers/node-renderer.js +4 -1
  6. package/dist/components/renderers/parametric-node-renderer.d.ts.map +1 -1
  7. package/dist/components/viewer/bvh-ecctrl.d.ts.map +1 -1
  8. package/dist/components/viewer/frame-limiter.d.ts.map +1 -1
  9. package/dist/components/viewer/glb-interactive.js +1 -1
  10. package/dist/components/viewer/glb-reference-nodes.js +1 -1
  11. package/dist/components/viewer/glb-replace-instances.js +1 -1
  12. package/dist/components/viewer/glb-scene.d.ts.map +1 -1
  13. package/dist/components/viewer/glb-scene.js +2 -3
  14. package/dist/components/viewer/glb-walkthrough-controller.js +1 -1
  15. package/dist/components/viewer/index.d.ts +10 -1
  16. package/dist/components/viewer/index.d.ts.map +1 -1
  17. package/dist/components/viewer/index.js +28 -12
  18. package/dist/components/viewer/lights.d.ts.map +1 -1
  19. package/dist/components/viewer/lights.js +107 -21
  20. package/dist/components/viewer/perf-panel.d.ts.map +1 -1
  21. package/dist/components/viewer/perf-panel.js +1 -1
  22. package/dist/components/viewer/post-processing.d.ts.map +1 -1
  23. package/dist/components/viewer/post-processing.js +96 -33
  24. package/dist/components/viewer/registered-systems.js +1 -1
  25. package/dist/components/viewer/scene-bvh.d.ts.map +1 -1
  26. package/dist/components/viewer/scene-bvh.js +1 -1
  27. package/dist/components/viewer/scene-environment.d.ts.map +1 -1
  28. package/dist/components/viewer/scene-environment.js +31 -11
  29. package/dist/components/viewer/selection-manager.js +15 -7
  30. package/dist/components/viewer/underground-ambiance.d.ts +9 -0
  31. package/dist/components/viewer/underground-ambiance.d.ts.map +1 -0
  32. package/dist/components/viewer/underground-ambiance.js +105 -0
  33. package/dist/components/viewer/viewer-camera.d.ts.map +1 -1
  34. package/dist/components/viewer/viewer-camera.js +1 -1
  35. package/dist/components/viewer/viewer-presentations.d.ts.map +1 -1
  36. package/dist/hooks/use-gltf-ktx2.d.ts.map +1 -1
  37. package/dist/hooks/use-gltf-ktx2.js +2 -0
  38. package/dist/hooks/use-node-events.d.ts.map +1 -1
  39. package/dist/index.d.ts +16 -7
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +16 -7
  42. package/dist/lib/backdrop.d.ts +17 -0
  43. package/dist/lib/backdrop.d.ts.map +1 -1
  44. package/dist/lib/backdrop.js +18 -1
  45. package/dist/lib/construction-dust.d.ts +57 -0
  46. package/dist/lib/construction-dust.d.ts.map +1 -0
  47. package/dist/lib/construction-dust.js +187 -0
  48. package/dist/lib/csg-utils.js +1 -1
  49. package/dist/lib/foundation-materials.d.ts +26 -0
  50. package/dist/lib/foundation-materials.d.ts.map +1 -0
  51. package/dist/lib/foundation-materials.js +65 -0
  52. package/dist/lib/gltf-unlit.d.ts +10 -0
  53. package/dist/lib/gltf-unlit.d.ts.map +1 -0
  54. package/dist/lib/gltf-unlit.js +23 -0
  55. package/dist/lib/ground-window.d.ts +33 -0
  56. package/dist/lib/ground-window.d.ts.map +1 -0
  57. package/dist/lib/ground-window.js +114 -0
  58. package/dist/lib/hero-pose.d.ts +1 -1
  59. package/dist/lib/hero-pose.d.ts.map +1 -1
  60. package/dist/lib/ink-edges.d.ts +2 -1
  61. package/dist/lib/ink-edges.d.ts.map +1 -1
  62. package/dist/lib/ktx2-loader.d.ts +7 -0
  63. package/dist/lib/ktx2-loader.d.ts.map +1 -1
  64. package/dist/lib/ktx2-loader.js +35 -0
  65. package/dist/lib/layer-pass.d.ts.map +1 -1
  66. package/dist/lib/layers.d.ts +11 -7
  67. package/dist/lib/layers.d.ts.map +1 -1
  68. package/dist/lib/layers.js +16 -6
  69. package/dist/lib/materials.d.ts +5 -0
  70. package/dist/lib/materials.d.ts.map +1 -1
  71. package/dist/lib/materials.js +34 -4
  72. package/dist/lib/merged-outline-node.d.ts +5 -0
  73. package/dist/lib/merged-outline-node.d.ts.map +1 -1
  74. package/dist/lib/merged-outline-node.js +80 -2
  75. package/dist/lib/pointer-events.d.ts +20 -4
  76. package/dist/lib/pointer-events.d.ts.map +1 -1
  77. package/dist/lib/pointer-events.js +78 -14
  78. package/dist/lib/post-processing-resources.d.ts.map +1 -1
  79. package/dist/lib/reveal-candidates.d.ts +80 -0
  80. package/dist/lib/reveal-candidates.d.ts.map +1 -0
  81. package/dist/lib/reveal-candidates.js +524 -0
  82. package/dist/lib/reveal-ghost.d.ts +9 -0
  83. package/dist/lib/reveal-ghost.d.ts.map +1 -0
  84. package/dist/lib/reveal-ghost.js +62 -0
  85. package/dist/lib/reveal-pending.d.ts +12 -0
  86. package/dist/lib/reveal-pending.d.ts.map +1 -0
  87. package/dist/lib/reveal-pending.js +12 -0
  88. package/dist/lib/reveal-pose.d.ts +70 -0
  89. package/dist/lib/reveal-pose.d.ts.map +1 -0
  90. package/dist/lib/reveal-pose.js +248 -0
  91. package/dist/lib/reveal-schedule.d.ts +208 -0
  92. package/dist/lib/reveal-schedule.d.ts.map +1 -0
  93. package/dist/lib/reveal-schedule.js +410 -0
  94. package/dist/lib/reveal-texture-scale.d.ts +5 -0
  95. package/dist/lib/reveal-texture-scale.d.ts.map +1 -0
  96. package/dist/lib/reveal-texture-scale.js +113 -0
  97. package/dist/lib/reveal-windows.d.ts +23 -0
  98. package/dist/lib/reveal-windows.d.ts.map +1 -0
  99. package/dist/lib/reveal-windows.js +31 -0
  100. package/dist/lib/reveal-wipe.d.ts +71 -0
  101. package/dist/lib/reveal-wipe.d.ts.map +1 -0
  102. package/dist/lib/reveal-wipe.js +105 -0
  103. package/dist/lib/scene-pass-mrt.d.ts +12 -0
  104. package/dist/lib/scene-pass-mrt.d.ts.map +1 -0
  105. package/dist/lib/scene-pass-mrt.js +23 -0
  106. package/dist/lib/scene-themes.d.ts +30 -8
  107. package/dist/lib/scene-themes.d.ts.map +1 -1
  108. package/dist/lib/scene-themes.js +36 -0
  109. package/dist/lib/scene-visibility.d.ts +11 -1
  110. package/dist/lib/scene-visibility.d.ts.map +1 -1
  111. package/dist/lib/scene-visibility.js +38 -0
  112. package/dist/lib/site-surfaces.d.ts +32 -0
  113. package/dist/lib/site-surfaces.d.ts.map +1 -0
  114. package/dist/lib/site-surfaces.js +70 -0
  115. package/dist/lib/snapshot-pipeline.d.ts +2 -1
  116. package/dist/lib/snapshot-pipeline.d.ts.map +1 -1
  117. package/dist/lib/snapshot-pipeline.js +35 -15
  118. package/dist/lib/tsl-compat.d.ts +2 -2
  119. package/dist/lib/tsl-compat.d.ts.map +1 -1
  120. package/dist/lib/underground-ambiance.d.ts +168 -0
  121. package/dist/lib/underground-ambiance.d.ts.map +1 -0
  122. package/dist/lib/underground-ambiance.js +334 -0
  123. package/dist/store/use-viewer.d.ts +184 -27
  124. package/dist/store/use-viewer.d.ts.map +1 -1
  125. package/dist/store/use-viewer.js +155 -19
  126. package/dist/systems/ceiling/ceiling-system.d.ts.map +1 -1
  127. package/dist/systems/ceiling/ceiling-system.js +2 -0
  128. package/dist/systems/construction-reveal/construction-dust.d.ts +16 -0
  129. package/dist/systems/construction-reveal/construction-dust.d.ts.map +1 -0
  130. package/dist/systems/construction-reveal/construction-dust.js +92 -0
  131. package/dist/systems/construction-reveal/construction-reveal.d.ts +276 -0
  132. package/dist/systems/construction-reveal/construction-reveal.d.ts.map +1 -0
  133. package/dist/systems/construction-reveal/construction-reveal.js +2383 -0
  134. package/dist/systems/construction-reveal/dust-material.d.ts +10 -0
  135. package/dist/systems/construction-reveal/dust-material.d.ts.map +1 -0
  136. package/dist/systems/construction-reveal/dust-material.js +17 -0
  137. package/dist/systems/construction-reveal/ghost-dress.d.ts +10 -0
  138. package/dist/systems/construction-reveal/ghost-dress.d.ts.map +1 -0
  139. package/dist/systems/construction-reveal/ghost-dress.js +24 -0
  140. package/dist/systems/elevator/elevator-interaction-system.d.ts +7 -0
  141. package/dist/systems/elevator/elevator-interaction-system.d.ts.map +1 -1
  142. package/dist/systems/elevator/elevator-interaction-system.js +18 -1
  143. package/dist/systems/geometry/geometry-system.d.ts.map +1 -1
  144. package/dist/systems/interactive/control-widget.d.ts.map +1 -1
  145. package/dist/systems/interactive/interactive-system.d.ts.map +1 -1
  146. package/dist/systems/interactive/interactive-system.js +16 -6
  147. package/dist/systems/interactive/scripted-clips.js +1 -1
  148. package/dist/systems/item-light/item-light-system.js +1 -1
  149. package/dist/systems/level/level-hold.d.ts +4 -0
  150. package/dist/systems/level/level-hold.d.ts.map +1 -0
  151. package/dist/systems/level/level-hold.js +14 -0
  152. package/dist/systems/level/level-system.d.ts.map +1 -1
  153. package/dist/systems/level/level-system.js +16 -1
  154. package/dist/systems/level/level-utils.d.ts +13 -3
  155. package/dist/systems/level/level-utils.d.ts.map +1 -1
  156. package/dist/systems/level/level-utils.js +56 -8
  157. package/dist/systems/roof/__fixtures__/roof-plane-cases.d.ts +103 -0
  158. package/dist/systems/roof/__fixtures__/roof-plane-cases.d.ts.map +1 -0
  159. package/dist/systems/roof/__fixtures__/roof-plane-cases.js +317 -0
  160. package/dist/systems/roof/roof-materials.d.ts +4 -2
  161. package/dist/systems/roof/roof-materials.d.ts.map +1 -1
  162. package/dist/systems/roof/roof-materials.js +18 -24
  163. package/dist/systems/roof/roof-system.d.ts +8 -1
  164. package/dist/systems/roof/roof-system.d.ts.map +1 -1
  165. package/dist/systems/roof/roof-system.js +195 -45
  166. package/dist/systems/wall/wall-cutout-cache.d.ts +32 -3
  167. package/dist/systems/wall/wall-cutout-cache.d.ts.map +1 -1
  168. package/dist/systems/wall/wall-cutout-cache.js +95 -2
  169. package/dist/systems/wall/wall-cutout.d.ts.map +1 -1
  170. package/dist/systems/wall/wall-material-variant.d.ts.map +1 -1
  171. package/dist/systems/wall/wall-materials.d.ts.map +1 -1
  172. package/dist/systems/wall/wall-materials.js +39 -4
  173. package/dist/systems/wall/wall-placeholder-sweep.d.ts.map +1 -1
  174. package/dist/systems/wall/wall-system.d.ts +5 -0
  175. package/dist/systems/wall/wall-system.d.ts.map +1 -1
  176. package/dist/systems/wall/wall-system.js +42 -19
  177. package/dist/systems/window/corner-frame.d.ts +10 -0
  178. package/dist/systems/window/corner-frame.d.ts.map +1 -0
  179. package/dist/systems/window/corner-frame.js +17 -0
  180. package/dist/systems/window/window-system.d.ts +1 -1
  181. package/dist/systems/window/window-system.d.ts.map +1 -1
  182. package/dist/systems/window/window-system.js +31 -6
  183. package/package.json +8 -8
@@ -0,0 +1,23 @@
1
+ export function importedUnlitMaterial(material) {
2
+ return material?.userData.pascalImportedUnlit === true;
3
+ }
4
+ /** Native basic materials still use AO; imported unlit assets already own their lighting. */
5
+ export function preserveGltfUnlit() {
6
+ return {
7
+ name: 'PASCAL_imported_unlit',
8
+ afterRoot({ scenes }) {
9
+ for (const scene of scenes) {
10
+ scene.traverse((object) => {
11
+ const mesh = object;
12
+ if (!mesh.isMesh)
13
+ return;
14
+ for (const material of [mesh.material].flat()) {
15
+ if ('isMeshBasicMaterial' in material)
16
+ material.userData.pascalImportedUnlit = true;
17
+ }
18
+ });
19
+ }
20
+ return null;
21
+ },
22
+ };
23
+ }
@@ -0,0 +1,33 @@
1
+ import { type AnyNode, type AnyNodeId, type GroundBox } from '@pascal-app/core';
2
+ import type { Camera } from 'three';
3
+ import { Vector3 } from 'three';
4
+ /** Opens the window for `box` (kept with its margin), or closes it with `null`. */
5
+ export declare function setGroundWindow(box: GroundBox | null): void;
6
+ /** The box the window is currently open for, without its margin. */
7
+ export declare function groundWindowBoxNow(): GroundBox | null;
8
+ /** True while the window is open at all (the veil's word for "only in the window"). */
9
+ export declare function groundWindowEnabledNode(): import("three/webgpu").Node<"bool">;
10
+ /**
11
+ * True for a fragment the window veils: the ray from the eye through it goes on to meet the
12
+ * box (the fragment stands in front of the box, or inside it with box still beyond). The eye
13
+ * inside the box never veils: there the box's near planes are behind it.
14
+ */
15
+ export declare function inGroundWindowNode(): import("three/webgpu").Node<"bool">;
16
+ /** The mask solid ground draws with: everywhere but in the window. */
17
+ export declare function groundWindowMaskNode(): import("three/webgpu").Node<"bool">;
18
+ /**
19
+ * The CPU twin of {@link inGroundWindowNode} for one pick: whether `point`, seen from
20
+ * `origin`, is ground the window veils — so a click there falls through to what the window
21
+ * reveals, as a click on the wholesale veil does. `false` while the window is closed.
22
+ */
23
+ export declare function groundWindowContains(origin: Vector3, point: Vector3): boolean;
24
+ /**
25
+ * The window as one capture's own camera sees it, whatever the person's view holds: opened
26
+ * for the interior's floor, or the whole building, when ground stands between that camera
27
+ * and it — and closed when it does not, so a window open for the person's eye never leaks
28
+ * into a picture taken from the other side. The veil surfaces are stood up for the frame
29
+ * (the solid ground stays, its mask cut by the same window). The returned function gives
30
+ * the person's view back.
31
+ */
32
+ export declare function temporarilyGroundWindowForCapture(camera: Camera, nodes: Record<AnyNodeId, AnyNode>, levelId?: string): () => void;
33
+ //# sourceMappingURL=ground-window.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ground-window.d.ts","sourceRoot":"","sources":["../../src/lib/ground-window.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,SAAS,EAEd,KAAK,SAAS,EAGf,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,EAAa,OAAO,EAAE,MAAM,OAAO,CAAA;AAwB1C,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAiB3D;AAED,oEAAoE;AACpE,wBAAgB,kBAAkB,IAAI,SAAS,GAAG,IAAI,CAErD;AAED,uFAAuF;AACvF,wBAAgB,uBAAuB,wCAEtC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,wCAiBjC;AAED,sEAAsE;AACtE,wBAAgB,oBAAoB,wCAEnC;AAMD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAkB7E;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,EACjC,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,IAAI,CAaZ"}
@@ -0,0 +1,114 @@
1
+ import { buildingGroundBox, levelGroundBox, terrainBetweenEyeAndBox, } from '@pascal-app/core';
2
+ import { Box3, Ray, Vector3 } from 'three';
3
+ import { cameraPosition, max, min, positionWorld, uniform, vec3 } from 'three/tsl';
4
+ import { siteGround } from './site-surfaces';
5
+ /**
6
+ * The ground window: where sculpted ground stands between the eye and the box that is shown
7
+ * (a level, or the whole building), that patch of ground is veiled and the rest stays solid.
8
+ * Decided per fragment here — a ray from the eye through the fragment that goes on to meet
9
+ * the box — because the patch's shape is exactly the box's silhouette against the hillside,
10
+ * which no CPU mesh rebuild could follow as cheaply. Whether the window opens at all is the
11
+ * CPU's word (`terrainBetweenEyeAndBox`, a handful of sight lines), read by the site renderer
12
+ * for the live view and by {@link temporarilyGroundWindowForCapture} for a picture, so both
13
+ * agree from their own cameras.
14
+ *
15
+ * One set of uniforms for the whole scene: there is one shown box at a time.
16
+ */
17
+ const windowEnabled = uniform(0);
18
+ const windowBoxMin = uniform(new Vector3());
19
+ const windowBoxMax = uniform(new Vector3());
20
+ let currentBox = null;
21
+ /** The margin the window keeps around the box, so the house is not seen through a letterbox. */
22
+ const WINDOW_MARGIN = 0.6;
23
+ /** Opens the window for `box` (kept with its margin), or closes it with `null`. */
24
+ export function setGroundWindow(box) {
25
+ currentBox = box;
26
+ if (!box) {
27
+ windowEnabled.value = 0;
28
+ return;
29
+ }
30
+ windowBoxMin.value.set(box.min[0] - WINDOW_MARGIN, box.min[1] - WINDOW_MARGIN, box.min[2] - WINDOW_MARGIN);
31
+ windowBoxMax.value.set(box.max[0] + WINDOW_MARGIN, box.max[1] + WINDOW_MARGIN, box.max[2] + WINDOW_MARGIN);
32
+ windowEnabled.value = 1;
33
+ }
34
+ /** The box the window is currently open for, without its margin. */
35
+ export function groundWindowBoxNow() {
36
+ return currentBox;
37
+ }
38
+ /** True while the window is open at all (the veil's word for "only in the window"). */
39
+ export function groundWindowEnabledNode() {
40
+ return windowEnabled.greaterThan(0.5);
41
+ }
42
+ /**
43
+ * True for a fragment the window veils: the ray from the eye through it goes on to meet the
44
+ * box (the fragment stands in front of the box, or inside it with box still beyond). The eye
45
+ * inside the box never veils: there the box's near planes are behind it.
46
+ */
47
+ export function inGroundWindowNode() {
48
+ const toFragment = positionWorld.sub(cameraPosition);
49
+ const fragmentT = toFragment.length();
50
+ // The epsilon keeps an axis-aligned ray's reciprocal finite where a component is exactly 0.
51
+ const dir = toFragment.normalize().add(vec3(1e-6, 1e-6, 1e-6));
52
+ const invDir = vec3(1).div(dir);
53
+ const near = windowBoxMin.sub(cameraPosition).mul(invDir);
54
+ const far = windowBoxMax.sub(cameraPosition).mul(invDir);
55
+ const tMin = min(near, far);
56
+ const tMax = max(near, far);
57
+ const enter = max(max(tMin.x, tMin.y), tMin.z);
58
+ const exit = min(min(tMax.x, tMax.y), tMax.z);
59
+ return windowEnabled
60
+ .greaterThan(0.5)
61
+ .and(enter.greaterThan(0))
62
+ .and(enter.lessThanEqual(exit))
63
+ .and(exit.greaterThan(fragmentT));
64
+ }
65
+ /** The mask solid ground draws with: everywhere but in the window. */
66
+ export function groundWindowMaskNode() {
67
+ return inGroundWindowNode().not();
68
+ }
69
+ const inflatedBox = new Box3();
70
+ const scratchRay = new Ray();
71
+ const scratchPoint = new Vector3();
72
+ /**
73
+ * The CPU twin of {@link inGroundWindowNode} for one pick: whether `point`, seen from
74
+ * `origin`, is ground the window veils — so a click there falls through to what the window
75
+ * reveals, as a click on the wholesale veil does. `false` while the window is closed.
76
+ */
77
+ export function groundWindowContains(origin, point) {
78
+ if (!currentBox)
79
+ return false;
80
+ inflatedBox.min.set(currentBox.min[0] - WINDOW_MARGIN, currentBox.min[1] - WINDOW_MARGIN, currentBox.min[2] - WINDOW_MARGIN);
81
+ inflatedBox.max.set(currentBox.max[0] + WINDOW_MARGIN, currentBox.max[1] + WINDOW_MARGIN, currentBox.max[2] + WINDOW_MARGIN);
82
+ if (inflatedBox.containsPoint(origin))
83
+ return false;
84
+ if (inflatedBox.containsPoint(point))
85
+ return true;
86
+ scratchRay.origin.copy(origin);
87
+ scratchRay.direction.copy(point).sub(origin).normalize();
88
+ const entry = scratchRay.intersectBox(inflatedBox, scratchPoint);
89
+ return entry !== null && entry.distanceTo(origin) >= point.distanceTo(origin) - 1e-4;
90
+ }
91
+ /**
92
+ * The window as one capture's own camera sees it, whatever the person's view holds: opened
93
+ * for the interior's floor, or the whole building, when ground stands between that camera
94
+ * and it — and closed when it does not, so a window open for the person's eye never leaks
95
+ * into a picture taken from the other side. The veil surfaces are stood up for the frame
96
+ * (the solid ground stays, its mask cut by the same window). The returned function gives
97
+ * the person's view back.
98
+ */
99
+ export function temporarilyGroundWindowForCapture(camera, nodes, levelId) {
100
+ const previous = currentBox;
101
+ const box = levelId ? levelGroundBox(nodes, levelId) : buildingGroundBox(nodes);
102
+ const eye = [camera.position.x, camera.position.y, camera.position.z];
103
+ const open = box !== null && terrainBetweenEyeAndBox(nodes, eye, box);
104
+ setGroundWindow(open ? box : null);
105
+ const { veil } = siteGround();
106
+ const flipped = open ? veil.filter((surface) => !surface.visible) : [];
107
+ for (const surface of flipped)
108
+ surface.visible = true;
109
+ return () => {
110
+ for (const surface of flipped)
111
+ surface.visible = false;
112
+ setGroundWindow(previous);
113
+ };
114
+ }
@@ -1,5 +1,5 @@
1
1
  import { Box3 } from 'three';
2
- export declare const DEFAULT_FRAMING_EXCLUDED_TYPES: readonly ["site", "scan", "guide", "spawn"];
2
+ export declare const DEFAULT_FRAMING_EXCLUDED_TYPES: readonly ['site', 'scan', 'guide', 'spawn'];
3
3
  export declare function heroCameraPose({ boxes, aspect, aim, fovDeg, azimuthRad, elevationRad, padding, minDistance, frameShift, tightFit, }: {
4
4
  boxes: Box3 | readonly Box3[];
5
5
  aspect: number;
@@ -1 +1 @@
1
- {"version":3,"file":"hero-pose.d.ts","sourceRoot":"","sources":["../../src/lib/hero-pose.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAA0B,MAAM,OAAO,CAAA;AAEpD,eAAO,MAAM,8BAA8B,6CAA8C,CAAA;AAEzF,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,MAAM,EACN,GAAG,EACH,MAAW,EACX,UAAwB,EACxB,YAAmC,EACnC,OAAc,EACd,WAAe,EACf,UAAc,EACd,QAAgB,GACjB,EAAE;IACD,KAAK,EAAE,IAAI,GAAG,SAAS,IAAI,EAAE,CAAA;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd;;;qDAGiD;IACjD,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;yDACqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;uCAGmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,GAAG;IACF,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC,CAgHA;AAED,wBAAgB,yBAAyB,CAAC,EACxC,YAAY,GACb,EAAE;IACD,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;CAChC,GAAG,IAAI,GAAG,IAAI,CAgBd;AAiFD,MAA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CAAA;IACpB;yDACqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;uCAGmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,GAAG;IACF,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC,CAgHA;AAED,wBAAgB,yBAAyB,CAAC,EACxC,YAAY,GACb,EAAE;IACD,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;CAChC,GAAG,IAAI,GAAG,IAAI,CAgBd;AAiFD,MAAM,MAAM,WAAW,GAAG;IACxB,4DAA4D;IAC5D,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,wEAAwE;IACxE,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAA;IAClB,0EAA0E;IAC1E,eAAe,EAAE,MAAM,EAAE,CAAA;CAC1B,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,UAAiB,GAClB,GAAE;IACD,0EAA0E;IAC1E,UAAU,CAAC,EAAE,OAAO,CAAA;CAChB,GAAG,WAAW,GAAG,IAAI,CAgD1B;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,IAAI,CAiB7E"}
@@ -1,10 +1,11 @@
1
1
  import type { Camera } from 'three';
2
+ import type { Node } from 'three/webgpu';
2
3
  export declare function createEdgeDepthSampler(depthTex: any, camera: Camera): (uv: any) => any;
3
4
  export declare function inkedEdges({ sampleDepth, normalTex, inkColor, radius, opacity, sceneRgb, }: {
4
5
  sampleDepth: (uv: any) => any;
5
6
  normalTex: any;
6
7
  inkColor: any;
7
- radius: number;
8
+ radius: number | Node<'float'>;
8
9
  opacity: any;
9
10
  sceneRgb: any;
10
11
  }): any;
@@ -1 +1 @@
1
- {"version":3,"file":"ink-edges.d.ts","sourceRoot":"","sources":["../../src/lib/ink-edges.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAqB,MAAM,OAAO,CAAA;AAkBtD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,QACd,GAAG,SAYxD;AAkBD,wBAAgB,UAAU,CAAC,EACzB,WAAW,EACX,SAAS,EACT,QAAQ,EACR,MAAM,EACN,OAAO,EACP,QAAQ,GACT,EAAE;IACD,WAAW,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,GAAG,CAAA;IAC7B,SAAS,EAAE,GAAG,CAAA;IACd,QAAQ,EAAE,GAAG,CAAA;IAKb,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,GAAG,CAAA;IACZ,QAAQ,EAAE,GAAG,CAAA;CACd,OAsCA"}
1
+ {"version":3,"file":"ink-edges.d.ts","sourceRoot":"","sources":["../../src/lib/ink-edges.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAqB,MAAM,OAAO,CAAA;AAgBtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAGxC,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,QACd,GAAG,SAYxD;AAkBD,wBAAgB,UAAU,CAAC,EACzB,WAAW,EACX,SAAS,EACT,QAAQ,EACR,MAAM,EACN,OAAO,EACP,QAAQ,GACT,EAAE;IACD,WAAW,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,GAAG,CAAA;IAC7B,SAAS,EAAE,GAAG,CAAA;IACd,QAAQ,EAAE,GAAG,CAAA;IAKb,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAA;IAC9B,OAAO,EAAE,GAAG,CAAA;IACZ,QAAQ,EAAE,GAAG,CAAA;CACd,OAsCA"}
@@ -1,4 +1,10 @@
1
+ import { type CompressedTexture } from 'three';
1
2
  import { KTX2Loader } from 'three/examples/jsm/loaders/KTX2Loader.js';
3
+ /** Includes GLTF textures loaded by the shared loader, not just finish textures. */
4
+ export declare function ktx2TextureLoadState(): {
5
+ pending: number;
6
+ failed: number;
7
+ };
2
8
  /**
3
9
  * KTX2Loader that survives block-misaligned textures. WebGPU rejects
4
10
  * block-compressed textures whose base dimensions aren't multiples of 4;
@@ -12,6 +18,7 @@ import { KTX2Loader } from 'three/examples/jsm/loaders/KTX2Loader.js';
12
18
  */
13
19
  declare class AlignmentSafeKTX2Loader extends KTX2Loader {
14
20
  private rgbaFallback;
21
+ load(url: string, onLoad: (texture: CompressedTexture) => void, onProgress?: (event: ProgressEvent) => void, onError?: (error: unknown) => void): void;
15
22
  private fallbackLoader;
16
23
  /** Both `load()` and GLTFLoader's KHR_texture_basisu path funnel through
17
24
  * this internal — overriding it covers every entry point. */
@@ -1 +1 @@
1
- {"version":3,"file":"ktx2-loader.d.ts","sourceRoot":"","sources":["../../src/lib/ktx2-loader.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAA;AAwBrE;;;;;;;;;;GAUG;AACH,cAAM,uBAAwB,SAAQ,UAAU;IAC9C,OAAO,CAAC,YAAY,CAA0B;IAE9C,OAAO,CAAC,cAAc;IAkBtB;kEAC8D;IACxD,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAmC7F,OAAO,IAAI,IAAI;CAMhB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,yBAAgC,CAAA;AAWvD;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAE7C;AAED,yFAAyF;AACzF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAkB5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B,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAkB5D;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,MAAM,EAAE;IAAE,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAA;CAAE,EAC/C,QAAQ,EAAE,OAAO,GAChB,OAAO,CAIT;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE9C"}
@@ -18,6 +18,12 @@ function readMisalignedBasisSize(buffer) {
18
18
  const height = view.getUint32(24, true);
19
19
  return width % 4 !== 0 || height % 4 !== 0 ? { width, height } : null;
20
20
  }
21
+ const pendingTextureLoads = new Set();
22
+ const failedTextureUrls = new Set();
23
+ /** Includes GLTF textures loaded by the shared loader, not just finish textures. */
24
+ export function ktx2TextureLoadState() {
25
+ return { pending: pendingTextureLoads.size, failed: failedTextureUrls.size };
26
+ }
21
27
  /**
22
28
  * KTX2Loader that survives block-misaligned textures. WebGPU rejects
23
29
  * block-compressed textures whose base dimensions aren't multiples of 4;
@@ -31,6 +37,35 @@ function readMisalignedBasisSize(buffer) {
31
37
  */
32
38
  class AlignmentSafeKTX2Loader extends KTX2Loader {
33
39
  rgbaFallback = null;
40
+ load(url, onLoad, onProgress, onError) {
41
+ const token = Symbol(url);
42
+ pendingTextureLoads.add(token);
43
+ const settle = (failed) => {
44
+ pendingTextureLoads.delete(token);
45
+ // A later successful request cannot repair a GLTF already resolved with
46
+ // a missing texture. Keep failures conservative for this shared cache.
47
+ if (failed)
48
+ failedTextureUrls.add(url);
49
+ };
50
+ try {
51
+ super.load(url, (texture) => {
52
+ settle(false);
53
+ onLoad?.(texture);
54
+ }, onProgress,
55
+ // Preserve the loader's absent-error-callback behavior. Such a failed
56
+ // fire-and-forget request conservatively remains pending for capture.
57
+ onError
58
+ ? (error) => {
59
+ settle(true);
60
+ onError(error);
61
+ }
62
+ : undefined);
63
+ }
64
+ catch (error) {
65
+ settle(true);
66
+ throw error;
67
+ }
68
+ }
34
69
  fallbackLoader() {
35
70
  if (!this.rgbaFallback) {
36
71
  this.rgbaFallback = new KTX2Loader(this.manager);
@@ -1 +1 @@
1
- {"version":3,"file":"layer-pass.d.ts","sourceRoot":"","sources":["../../src/lib/layer-pass.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAiB,QAAQ,EAAE,KAAK,KAAK,EAAW,MAAM,OAAO,CAAA;AACjF,OAAO,EAAE,KAAK,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAoBvD,qBAAa,cAAc;IAKvB,QAAQ,CAAC,MAAM,EAAE,KAAK;IAJxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmC;IAC3D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;gBAGhD,MAAM,EAAE,KAAK,EACtB,MAAM,EAAE,MAAM,EAAE;IAWlB,QAAQ,CAAC,OAAO,EAAE,QAAQ;IAU1B,OAAO,CAAC,MAAM,CA2Cb;IAED,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE;;;;IAoCxC,OAAO;CAIR;AAiBD,qBAAa,aAAc,SAAQ,QAAQ;IAMvC,OAAO,CAAC,QAAQ,CAAC,KAAK;IAEtB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAR3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiB;IACvC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgB;IACrC,OAAO,CAAC,UAAU,CAAO;gBAGN,KAAK,EAAE,cAAc,EACtC,MAAM,EAAE,MAAM,EACG,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,QAAQ;IAc5B,OAAO;IAKP,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS;CAgEnD"}
1
+ {"version":3,"file":"layer-pass.d.ts","sourceRoot":"","sources":["../../src/lib/layer-pass.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAiB,QAAQ,EAAE,KAAK,KAAK,EAAW,MAAM,OAAO,CAAA;AACjF,OAAO,EAAE,KAAK,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAoBvD,qBAAa,cAAc;IAKvB,QAAQ,CAAC,MAAM,EAAE,KAAK;IAJxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmC;IAC3D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;IAE3D,YACW,MAAM,EAAE,KAAK,EACtB,MAAM,EAAE,MAAM,EAAE,EASjB;IAED,QAAQ,CAAC,OAAO,EAAE,QAAQ,QAQzB;IAED,OAAO,CAAC,MAAM,CA2Cb;IAED,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE;;;MAkCvC;IAED,OAAO,SAGN;CACF;AAiBD,qBAAa,aAAc,SAAQ,QAAQ;IAMvC,OAAO,CAAC,QAAQ,CAAC,KAAK;IAEtB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAR3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiB;IACvC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgB;IACrC,OAAO,CAAC,UAAU,CAAO;IAEzB,YACmB,KAAK,EAAE,cAAc,EACtC,MAAM,EAAE,MAAM,EACG,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,QAAQ,EAYpC;IAEQ,OAAO,SAGf;IAEQ,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CA+DjD;CACF"}
@@ -1,4 +1,4 @@
1
- import type { Layers } from 'three';
1
+ import { Layers } from 'three';
2
2
  /** Default Three.js layer for main scene geometry. */
3
3
  export declare const SCENE_LAYER = 0;
4
4
  /**
@@ -13,12 +13,14 @@ export declare const OVERLAY_LAYER = 1;
13
13
  /** Layer used for zone rendering (floor fills and wall borders). */
14
14
  export declare const ZONE_LAYER = 2;
15
15
  /**
16
- * Layer for the editor ground grid. Rendered *inside* the scene pass (so scene
17
- * geometry depth-occludes it instead of it bleeding through walls/objects) — it
18
- * is a flat, depth-non-writing plane, so the screen-space ink never picks it up.
19
- * Kept off OVERLAY_LAYER because overlays composite on top with no scene-depth
20
- * test, which is exactly what we don't want for a full-floor plane. Excluded
21
- * from thumbnails like the other editor-only layers.
16
+ * Layer for editor-only visuals that scene geometry must hide: the ground grid
17
+ * and the construction reveal's dust. Rendered *inside* the scene pass (so
18
+ * walls and objects depth-occlude them instead of them bleeding through) —
19
+ * they write no depth, and a transparent one must write alpha 0 to the pass's
20
+ * normal and diffuse attachments (`scenePassMrt`), or the screen-space ink
21
+ * reads its whole quad as an edge. Kept off OVERLAY_LAYER because overlays
22
+ * composite on top with no scene-depth test.
23
+ * Excluded from thumbnails like the other editor-only layers.
22
24
  */
23
25
  export declare const GRID_LAYER = 3;
24
26
  /**
@@ -41,6 +43,8 @@ export declare const SHADOW_ONLY_LAYER = 4;
41
43
  * measurement rays.
42
44
  */
43
45
  export declare const BATCHED_LAYER = 5;
46
+ /** What the post-processing scene pass draws: the scene geometry, and the grid layer it depth-tests. */
47
+ export declare function scenePassLayers(): Layers;
44
48
  /**
45
49
  * Aims a raycaster at every real scene surface, whether a wall still draws
46
50
  * itself or a level batch draws it for us.
@@ -1 +1 @@
1
- {"version":3,"file":"layers.d.ts","sourceRoot":"","sources":["../../src/lib/layers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEnC,sDAAsD;AACtD,eAAO,MAAM,WAAW,IAAI,CAAA;AAE5B;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,IAAI,CAAA;AAE9B,oEAAoE;AACpE,eAAO,MAAM,UAAU,IAAI,CAAA;AAE3B;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,IAAI,CAAA;AAE3B;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,IAAI,CAAA;AAElC;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,IAAI,CAAA;AAE9B;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAG5D"}
1
+ {"version":3,"file":"layers.d.ts","sourceRoot":"","sources":["../../src/lib/layers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAE9B,sDAAsD;AACtD,eAAO,MAAM,WAAW,IAAI,CAAA;AAE5B;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,IAAI,CAAA;AAE9B,oEAAoE;AACpE,eAAO,MAAM,UAAU,IAAI,CAAA;AAE3B;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,IAAI,CAAA;AAE3B;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,IAAI,CAAA;AAElC;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,IAAI,CAAA;AAE9B,wGAAwG;AACxG,wBAAgB,eAAe,IAAI,MAAM,CAKxC;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAG5D"}
@@ -1,3 +1,4 @@
1
+ import { Layers } from 'three';
1
2
  /** Default Three.js layer for main scene geometry. */
2
3
  export const SCENE_LAYER = 0;
3
4
  /**
@@ -12,12 +13,14 @@ export const OVERLAY_LAYER = 1;
12
13
  /** Layer used for zone rendering (floor fills and wall borders). */
13
14
  export const ZONE_LAYER = 2;
14
15
  /**
15
- * Layer for the editor ground grid. Rendered *inside* the scene pass (so scene
16
- * geometry depth-occludes it instead of it bleeding through walls/objects) — it
17
- * is a flat, depth-non-writing plane, so the screen-space ink never picks it up.
18
- * Kept off OVERLAY_LAYER because overlays composite on top with no scene-depth
19
- * test, which is exactly what we don't want for a full-floor plane. Excluded
20
- * from thumbnails like the other editor-only layers.
16
+ * Layer for editor-only visuals that scene geometry must hide: the ground grid
17
+ * and the construction reveal's dust. Rendered *inside* the scene pass (so
18
+ * walls and objects depth-occlude them instead of them bleeding through) —
19
+ * they write no depth, and a transparent one must write alpha 0 to the pass's
20
+ * normal and diffuse attachments (`scenePassMrt`), or the screen-space ink
21
+ * reads its whole quad as an edge. Kept off OVERLAY_LAYER because overlays
22
+ * composite on top with no scene-depth test.
23
+ * Excluded from thumbnails like the other editor-only layers.
21
24
  */
22
25
  export const GRID_LAYER = 3;
23
26
  /**
@@ -40,6 +43,13 @@ export const SHADOW_ONLY_LAYER = 4;
40
43
  * measurement rays.
41
44
  */
42
45
  export const BATCHED_LAYER = 5;
46
+ /** What the post-processing scene pass draws: the scene geometry, and the grid layer it depth-tests. */
47
+ export function scenePassLayers() {
48
+ const layers = new Layers();
49
+ layers.set(SCENE_LAYER);
50
+ layers.enable(GRID_LAYER);
51
+ return layers;
52
+ }
43
53
  /**
44
54
  * Aims a raycaster at every real scene surface, whether a wall still draws
45
55
  * itself or a level batch draws it for us.
@@ -11,6 +11,11 @@ export declare const PRESET_PALETTES: Record<ColorPreset, Record<SurfaceRole, st
11
11
  export declare function resolveSurfaceColor(role: SurfaceRole, preset: ColorPreset, sceneThemeId?: string): string;
12
12
  export declare const glassMaterial: MeshLambertNodeMaterial;
13
13
  export declare function getMaterialTextureVersion(): number;
14
+ /** Conservative capture readiness across the current material cache. */
15
+ export declare function materialTextureLoadState(): {
16
+ pending: number;
17
+ failed: number;
18
+ };
14
19
  export declare function resolveTextureRepeat(repeat: unknown, scale: unknown): [number, number];
15
20
  export declare function getTextureKey(material?: MaterialSchema): string;
16
21
  /** Glass lets light through; shadow maps would otherwise treat it as a solid panel. */
@@ -1 +1 @@
1
- {"version":3,"file":"materials.d.ts","sourceRoot":"","sources":["../../src/lib/materials.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAE1B,KAAK,cAAc,EAKnB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,WAAW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,4BAA4B,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,IAAI,CAKtF;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CA0BzC"}
@@ -82,12 +82,35 @@ const defaultMaterialCache = new Map();
82
82
  const surfaceRoleMaterialCache = new Map();
83
83
  const textureCache = new Map();
84
84
  const textureLoadPromises = new Map();
85
+ const pendingTextures = new Set();
86
+ const failedTextures = new Set();
85
87
  const textureLoader = new THREE.TextureLoader();
86
88
  let materialTextureVersion = 0;
87
89
  // Highlight clones can observe late assignments without polling every material.
88
90
  export function getMaterialTextureVersion() {
89
91
  return materialTextureVersion;
90
92
  }
93
+ /** Conservative capture readiness across the current material cache. */
94
+ export function materialTextureLoadState() {
95
+ return { pending: pendingTextures.size + textureLoadPromises.size, failed: failedTextures.size };
96
+ }
97
+ function loadTexture(url, key) {
98
+ pendingTextures.add(key);
99
+ try {
100
+ return pickTextureLoader(url).load(url, () => {
101
+ pendingTextures.delete(key);
102
+ failedTextures.delete(key);
103
+ }, undefined, () => {
104
+ pendingTextures.delete(key);
105
+ failedTextures.add(key);
106
+ });
107
+ }
108
+ catch (error) {
109
+ pendingTextures.delete(key);
110
+ failedTextures.add(key);
111
+ throw error;
112
+ }
113
+ }
91
114
  // `.ktx2` finish maps transcode through the shared KTX2 loader (support is
92
115
  // detected once at viewer init); everything else loads as a normal image.
93
116
  function pickTextureLoader(url) {
@@ -157,7 +180,7 @@ function getTexture(material) {
157
180
  const resolvedUrl = /^(?:asset|blob|data):/.test(textureConfig.url)
158
181
  ? textureConfig.url
159
182
  : (resolveCdnUrl(textureConfig.url) ?? textureConfig.url);
160
- const texture = pickTextureLoader(resolvedUrl).load(resolvedUrl);
183
+ const texture = loadTexture(resolvedUrl, cacheKey);
161
184
  texture.wrapS = THREE.RepeatWrapping;
162
185
  texture.wrapT = THREE.RepeatWrapping;
163
186
  const [repeatX, repeatY] = resolveTextureRepeat(textureConfig.repeat, textureConfig.scale);
@@ -207,7 +230,7 @@ function getPresetTexture(path, props, slot) {
207
230
  const cached = textureCache.get(cacheKey);
208
231
  if (cached)
209
232
  return cached;
210
- const texture = pickTextureLoader(resolvedPath).load(resolvedPath);
233
+ const texture = loadTexture(resolvedPath, cacheKey);
211
234
  applyTextureProperties(texture, props, slot);
212
235
  stampPascalTextureRef(texture, {
213
236
  kind: 'material',
@@ -263,11 +286,13 @@ async function loadPresetTexture(path, props, slot) {
263
286
  setTextureCacheKey(texture, cacheKey);
264
287
  textureCache.set(cacheKey, texture);
265
288
  textureLoadPromises.delete(cacheKey);
289
+ failedTextures.delete(cacheKey);
266
290
  return texture;
267
291
  })
268
292
  .catch((error) => {
269
293
  console.warn('[viewer] Failed to load material texture', resolvedPath, error);
270
294
  textureLoadPromises.delete(cacheKey);
295
+ failedTextures.add(cacheKey);
271
296
  return null;
272
297
  });
273
298
  textureLoadPromises.set(cacheKey, promise);
@@ -419,7 +444,8 @@ export function createMaterialFromPresetRef(materialPreset, shading = 'rendered'
419
444
  }
420
445
  export function createMaterial(material, shading = 'rendered') {
421
446
  const props = resolveMaterial(material);
422
- const cacheKey = `${getCacheKey(props, shading)}-${getTextureKey(material)}`;
447
+ const glassPreset = material?.preset === 'glass';
448
+ const cacheKey = `${getCacheKey(props, shading)}-${getTextureKey(material)}-${glassPreset}`;
423
449
  if (materialCache.has(cacheKey)) {
424
450
  return materialCache.get(cacheKey);
425
451
  }
@@ -439,7 +465,9 @@ export function createMaterial(material, shading = 'rendered') {
439
465
  roughness: props.roughness,
440
466
  metalness: props.metalness,
441
467
  });
442
- maybeApplyGlassFresnel(threeMaterial);
468
+ // Explicit source transparency keeps its opacity; the glass preset owns this styling.
469
+ if (glassPreset)
470
+ maybeApplyGlassFresnel(threeMaterial);
443
471
  threeMaterial.userData.__pascalCachedMaterial = true;
444
472
  materialCache.set(cacheKey, threeMaterial);
445
473
  return threeMaterial;
@@ -630,6 +658,8 @@ export function clearMaterialCache() {
630
658
  surfaceRoleMaterialCache.clear();
631
659
  textureCache.clear();
632
660
  textureLoadPromises.clear();
661
+ pendingTextures.clear();
662
+ failedTextures.clear();
633
663
  const disposals = [];
634
664
  for (const cleanup of materialCacheCleanups) {
635
665
  const dispose = cleanup();
@@ -63,6 +63,10 @@ export declare class MergedOutlineNode extends TempNode {
63
63
  private readonly _proxiesA;
64
64
  private readonly _proxiesB;
65
65
  private readonly _proxyMaskMaterials;
66
+ private readonly _cutoutMasksA;
67
+ private readonly _cutoutMasksB;
68
+ private readonly _usedCutoutMasksA;
69
+ private readonly _usedCutoutMasksB;
66
70
  private readonly _maskSceneA;
67
71
  private readonly _maskSceneB;
68
72
  private _wroteGroupALastFrame;
@@ -90,6 +94,7 @@ export declare class MergedOutlineNode extends TempNode {
90
94
  private _syncProxies;
91
95
  private _supportsProxies;
92
96
  private _disposeProxyMaterial;
97
+ private _pruneCutoutMasks;
93
98
  private _runEdgePipeline;
94
99
  setup(builder: any): any;
95
100
  dispose(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"merged-outline-node.d.ts","sourceRoot":"","sources":["../../src/lib/merged-outline-node.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AAEH,OAAO,EAIL,QAAQ,EAKT,MAAM,OAAO,CAAA;AA2Bd,OAAO,EAML,QAAQ,EACT,MAAM,cAAc,CAAA;AAiErB,qBAAa,iBAAkB,SAAQ,QAAQ;IAC7C,MAAM,KAAK,IAAI,WAEd;IAED,KAAK,EAAE,GAAG,CAAA;IACV,MAAM,EAAE,GAAG,CAAA;IACX,cAAc,EAAE,QAAQ,EAAE,CAAA;IAC1B,gBAAgB,EAAE,QAAQ,EAAE,CAAA;IAC5B,wBAAwB,EAAE,GAAG,CAAA;IAC7B,0BAA0B,EAAE,GAAG,CAAA;IAC/B,mBAAmB,EAAE,GAAG,CAAA;IACxB,qBAAqB,EAAE,GAAG,CAAA;IAC1B,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IAExB,OAAO,CAAC,QAAQ,CAAC,eAAe,CA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