@pascal-app/viewer 1.0.3 → 1.0.5
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/capture/capture-runtime.js +1 -1
- package/dist/components/error-boundary.d.ts.map +1 -1
- package/dist/components/renderers/node-renderer.d.ts +1 -1
- package/dist/components/renderers/node-renderer.d.ts.map +1 -1
- package/dist/components/renderers/node-renderer.js +12 -4
- package/dist/components/renderers/parametric-node-renderer.d.ts.map +1 -1
- package/dist/components/viewer/bvh-ecctrl.d.ts.map +1 -1
- package/dist/components/viewer/frame-limiter.d.ts +1 -0
- package/dist/components/viewer/frame-limiter.d.ts.map +1 -1
- package/dist/components/viewer/frame-limiter.js +22 -3
- package/dist/components/viewer/glb-interactive.d.ts +25 -1
- package/dist/components/viewer/glb-interactive.d.ts.map +1 -1
- package/dist/components/viewer/glb-interactive.js +253 -86
- package/dist/components/viewer/glb-mechanisms.d.ts +10 -0
- package/dist/components/viewer/glb-mechanisms.d.ts.map +1 -0
- package/dist/components/viewer/glb-mechanisms.js +19 -0
- package/dist/components/viewer/glb-reference-nodes.js +1 -1
- package/dist/components/viewer/glb-replace-instances.js +1 -1
- package/dist/components/viewer/glb-scene.d.ts +45 -27
- package/dist/components/viewer/glb-scene.d.ts.map +1 -1
- package/dist/components/viewer/glb-scene.js +421 -508
- package/dist/components/viewer/glb-walkthrough-controller.d.ts +1 -1
- package/dist/components/viewer/glb-walkthrough-controller.d.ts.map +1 -1
- package/dist/components/viewer/glb-walkthrough-controller.js +13 -2
- package/dist/components/viewer/index.d.ts +24 -1
- package/dist/components/viewer/index.d.ts.map +1 -1
- package/dist/components/viewer/index.js +111 -37
- package/dist/components/viewer/lights.d.ts.map +1 -1
- package/dist/components/viewer/lights.js +113 -22
- package/dist/components/viewer/perf-monitor.d.ts.map +1 -1
- package/dist/components/viewer/perf-monitor.js +6 -0
- package/dist/components/viewer/perf-panel.d.ts.map +1 -1
- package/dist/components/viewer/perf-panel.js +1 -1
- package/dist/components/viewer/post-processing.d.ts.map +1 -1
- package/dist/components/viewer/post-processing.js +104 -36
- package/dist/components/viewer/registered-systems.d.ts.map +1 -1
- package/dist/components/viewer/registered-systems.js +17 -3
- package/dist/components/viewer/render-error.d.ts +18 -0
- package/dist/components/viewer/render-error.d.ts.map +1 -0
- package/dist/components/viewer/render-error.js +29 -0
- package/dist/components/viewer/scene-bvh.d.ts.map +1 -1
- package/dist/components/viewer/scene-bvh.js +1 -1
- package/dist/components/viewer/scene-environment.d.ts.map +1 -1
- package/dist/components/viewer/scene-environment.js +31 -11
- package/dist/components/viewer/scene-ground-replacement.d.ts +6 -0
- package/dist/components/viewer/scene-ground-replacement.d.ts.map +1 -1
- package/dist/components/viewer/scene-ground-replacement.js +15 -0
- package/dist/components/viewer/selection-manager.d.ts.map +1 -1
- package/dist/components/viewer/selection-manager.js +25 -7
- package/dist/components/viewer/underground-ambiance.d.ts +9 -0
- package/dist/components/viewer/underground-ambiance.d.ts.map +1 -0
- package/dist/components/viewer/underground-ambiance.js +105 -0
- package/dist/components/viewer/viewer-camera.d.ts +4 -0
- package/dist/components/viewer/viewer-camera.d.ts.map +1 -1
- package/dist/components/viewer/viewer-camera.js +12 -2
- package/dist/components/viewer/viewer-presentations.d.ts.map +1 -1
- package/dist/hooks/use-gltf-ktx2.d.ts.map +1 -1
- package/dist/hooks/use-gltf-ktx2.js +2 -0
- package/dist/hooks/use-node-events.d.ts.map +1 -1
- package/dist/index.d.ts +36 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -19
- package/dist/lib/asset-url.d.ts.map +1 -1
- package/dist/lib/asset-url.js +7 -1
- package/dist/lib/backdrop.d.ts +17 -0
- package/dist/lib/backdrop.d.ts.map +1 -1
- package/dist/lib/backdrop.js +18 -1
- package/dist/lib/construction-dust.d.ts +57 -0
- package/dist/lib/construction-dust.d.ts.map +1 -0
- package/dist/lib/construction-dust.js +187 -0
- package/dist/lib/csg-utils.js +1 -1
- package/dist/lib/display-state.d.ts +25 -0
- package/dist/lib/display-state.d.ts.map +1 -0
- package/dist/lib/display-state.js +1 -0
- package/dist/lib/foundation-materials.d.ts +26 -0
- package/dist/lib/foundation-materials.d.ts.map +1 -0
- package/dist/lib/foundation-materials.js +65 -0
- package/dist/lib/gltf-unlit.d.ts +10 -0
- package/dist/lib/gltf-unlit.d.ts.map +1 -0
- package/dist/lib/gltf-unlit.js +23 -0
- package/dist/lib/ground-window.d.ts +33 -0
- package/dist/lib/ground-window.d.ts.map +1 -0
- package/dist/lib/ground-window.js +114 -0
- package/dist/lib/hero-pose.d.ts +13 -3
- package/dist/lib/hero-pose.d.ts.map +1 -1
- package/dist/lib/hero-pose.js +72 -5
- package/dist/lib/ink-edges.d.ts +6 -3
- package/dist/lib/ink-edges.d.ts.map +1 -1
- package/dist/lib/ink-edges.js +17 -7
- package/dist/lib/key-light-override.d.ts +11 -0
- package/dist/lib/key-light-override.d.ts.map +1 -0
- package/dist/lib/key-light-override.js +14 -0
- package/dist/lib/ktx2-loader.d.ts +7 -0
- package/dist/lib/ktx2-loader.d.ts.map +1 -1
- package/dist/lib/ktx2-loader.js +35 -0
- package/dist/lib/layer-pass.d.ts.map +1 -1
- package/dist/lib/layers.d.ts +11 -7
- package/dist/lib/layers.d.ts.map +1 -1
- package/dist/lib/layers.js +16 -6
- package/dist/lib/live-frame-hold.d.ts +14 -0
- package/dist/lib/live-frame-hold.d.ts.map +1 -0
- package/dist/lib/live-frame-hold.js +28 -0
- package/dist/lib/materials.d.ts +19 -7
- package/dist/lib/materials.d.ts.map +1 -1
- package/dist/lib/materials.js +65 -9
- package/dist/lib/merged-outline-node.d.ts +5 -0
- package/dist/lib/merged-outline-node.d.ts.map +1 -1
- package/dist/lib/merged-outline-node.js +80 -2
- package/dist/lib/node-top-surface-height.d.ts +6 -0
- package/dist/lib/node-top-surface-height.d.ts.map +1 -0
- package/dist/lib/node-top-surface-height.js +74 -0
- package/dist/lib/perf-probe-state.d.ts +39 -0
- package/dist/lib/perf-probe-state.d.ts.map +1 -0
- package/dist/lib/perf-probe-state.js +17 -0
- package/dist/lib/pointer-events.d.ts +26 -2
- package/dist/lib/pointer-events.d.ts.map +1 -1
- package/dist/lib/pointer-events.js +99 -12
- package/dist/lib/post-processing-resources.d.ts.map +1 -1
- package/dist/lib/procedural-emission.d.ts +7 -0
- package/dist/lib/procedural-emission.d.ts.map +1 -0
- package/dist/lib/procedural-emission.js +54 -0
- package/dist/lib/reveal-candidates.d.ts +80 -0
- package/dist/lib/reveal-candidates.d.ts.map +1 -0
- package/dist/lib/reveal-candidates.js +524 -0
- package/dist/lib/reveal-ghost.d.ts +9 -0
- package/dist/lib/reveal-ghost.d.ts.map +1 -0
- package/dist/lib/reveal-ghost.js +62 -0
- package/dist/lib/reveal-pending.d.ts +12 -0
- package/dist/lib/reveal-pending.d.ts.map +1 -0
- package/dist/lib/reveal-pending.js +12 -0
- package/dist/lib/reveal-pose.d.ts +70 -0
- package/dist/lib/reveal-pose.d.ts.map +1 -0
- package/dist/lib/reveal-pose.js +248 -0
- package/dist/lib/reveal-schedule.d.ts +208 -0
- package/dist/lib/reveal-schedule.d.ts.map +1 -0
- package/dist/lib/reveal-schedule.js +410 -0
- package/dist/lib/reveal-texture-scale.d.ts +5 -0
- package/dist/lib/reveal-texture-scale.d.ts.map +1 -0
- package/dist/lib/reveal-texture-scale.js +113 -0
- package/dist/lib/reveal-windows.d.ts +23 -0
- package/dist/lib/reveal-windows.d.ts.map +1 -0
- package/dist/lib/reveal-windows.js +31 -0
- package/dist/lib/reveal-wipe.d.ts +71 -0
- package/dist/lib/reveal-wipe.d.ts.map +1 -0
- package/dist/lib/reveal-wipe.js +105 -0
- package/dist/lib/scene-pass-mrt.d.ts +12 -0
- package/dist/lib/scene-pass-mrt.d.ts.map +1 -0
- package/dist/lib/scene-pass-mrt.js +23 -0
- package/dist/lib/scene-support-height.d.ts +4 -0
- package/dist/lib/scene-support-height.d.ts.map +1 -0
- package/dist/lib/scene-support-height.js +34 -0
- package/dist/lib/scene-themes.d.ts +30 -8
- package/dist/lib/scene-themes.d.ts.map +1 -1
- package/dist/lib/scene-themes.js +36 -0
- package/dist/lib/scene-visibility.d.ts +17 -1
- package/dist/lib/scene-visibility.d.ts.map +1 -1
- package/dist/lib/scene-visibility.js +53 -3
- package/dist/lib/scripted-opening.d.ts +11 -0
- package/dist/lib/scripted-opening.d.ts.map +1 -0
- package/dist/lib/scripted-opening.js +20 -0
- package/dist/lib/site-surfaces.d.ts +32 -0
- package/dist/lib/site-surfaces.d.ts.map +1 -0
- package/dist/lib/site-surfaces.js +70 -0
- package/dist/lib/snapshot-pipeline.d.ts +34 -3
- package/dist/lib/snapshot-pipeline.d.ts.map +1 -1
- package/dist/lib/snapshot-pipeline.js +247 -117
- package/dist/lib/terrain-perimeter-fill.d.ts.map +1 -1
- package/dist/lib/terrain-perimeter-fill.js +22 -14
- package/dist/lib/tsl-compat.d.ts +2 -2
- package/dist/lib/tsl-compat.d.ts.map +1 -1
- package/dist/lib/underground-ambiance.d.ts +168 -0
- package/dist/lib/underground-ambiance.d.ts.map +1 -0
- package/dist/lib/underground-ambiance.js +334 -0
- package/dist/lib/zone-geometry.d.ts +11 -0
- package/dist/lib/zone-geometry.d.ts.map +1 -0
- package/dist/lib/zone-geometry.js +46 -0
- package/dist/store/use-item-light-pool.d.ts +14 -10
- package/dist/store/use-item-light-pool.d.ts.map +1 -1
- package/dist/store/use-item-light-pool.js +52 -26
- package/dist/store/use-viewer.d.ts +194 -26
- package/dist/store/use-viewer.d.ts.map +1 -1
- package/dist/store/use-viewer.js +164 -21
- package/dist/systems/ceiling/ceiling-system.d.ts +15 -1
- package/dist/systems/ceiling/ceiling-system.d.ts.map +1 -1
- package/dist/systems/ceiling/ceiling-system.js +88 -6
- package/dist/systems/construction-reveal/construction-dust.d.ts +16 -0
- package/dist/systems/construction-reveal/construction-dust.d.ts.map +1 -0
- package/dist/systems/construction-reveal/construction-dust.js +92 -0
- package/dist/systems/construction-reveal/construction-reveal.d.ts +276 -0
- package/dist/systems/construction-reveal/construction-reveal.d.ts.map +1 -0
- package/dist/systems/construction-reveal/construction-reveal.js +2383 -0
- package/dist/systems/construction-reveal/dust-material.d.ts +10 -0
- package/dist/systems/construction-reveal/dust-material.d.ts.map +1 -0
- package/dist/systems/construction-reveal/dust-material.js +17 -0
- package/dist/systems/construction-reveal/ghost-dress.d.ts +10 -0
- package/dist/systems/construction-reveal/ghost-dress.d.ts.map +1 -0
- package/dist/systems/construction-reveal/ghost-dress.js +24 -0
- package/dist/systems/door/door-system.d.ts.map +1 -1
- package/dist/systems/door/door-system.js +55 -17
- package/dist/systems/elevator/elevator-interaction-system.d.ts +7 -0
- package/dist/systems/elevator/elevator-interaction-system.d.ts.map +1 -1
- package/dist/systems/elevator/elevator-interaction-system.js +18 -1
- package/dist/systems/floor-elevation/floor-elevation-system.d.ts +3 -1
- package/dist/systems/floor-elevation/floor-elevation-system.d.ts.map +1 -1
- package/dist/systems/floor-elevation/floor-elevation-system.js +33 -5
- package/dist/systems/geometry/geometry-system.d.ts.map +1 -1
- package/dist/systems/geometry/geometry-system.js +71 -11
- package/dist/systems/interactive/control-widget.d.ts.map +1 -1
- package/dist/systems/interactive/interactive-system.d.ts.map +1 -1
- package/dist/systems/interactive/interactive-system.js +52 -17
- package/dist/systems/interactive/procedural-controls.d.ts +13 -0
- package/dist/systems/interactive/procedural-controls.d.ts.map +1 -0
- package/dist/systems/interactive/procedural-controls.js +17 -0
- package/dist/systems/interactive/scripted-clips.d.ts +19 -0
- package/dist/systems/interactive/scripted-clips.d.ts.map +1 -0
- package/dist/systems/interactive/scripted-clips.js +134 -0
- package/dist/systems/item/item-system.d.ts.map +1 -1
- package/dist/systems/item/item-system.js +9 -3
- package/dist/systems/item/object-cut-invalidation.d.ts +3 -0
- package/dist/systems/item/object-cut-invalidation.d.ts.map +1 -0
- package/dist/systems/item/object-cut-invalidation.js +68 -0
- package/dist/systems/item-light/item-light-system.d.ts +1 -1
- package/dist/systems/item-light/item-light-system.d.ts.map +1 -1
- package/dist/systems/item-light/item-light-system.js +48 -53
- package/dist/systems/level/level-hold.d.ts +4 -0
- package/dist/systems/level/level-hold.d.ts.map +1 -0
- package/dist/systems/level/level-hold.js +14 -0
- package/dist/systems/level/level-system.d.ts.map +1 -1
- package/dist/systems/level/level-system.js +19 -6
- package/dist/systems/level/level-utils.d.ts +19 -6
- package/dist/systems/level/level-utils.d.ts.map +1 -1
- package/dist/systems/level/level-utils.js +68 -9
- package/dist/systems/level/shadow-only-levels.d.ts +9 -0
- package/dist/systems/level/shadow-only-levels.d.ts.map +1 -0
- package/dist/systems/level/shadow-only-levels.js +7 -0
- package/dist/systems/roof/__fixtures__/roof-plane-cases.d.ts +103 -0
- package/dist/systems/roof/__fixtures__/roof-plane-cases.d.ts.map +1 -0
- package/dist/systems/roof/__fixtures__/roof-plane-cases.js +317 -0
- package/dist/systems/roof/roof-materials.d.ts +16 -2
- package/dist/systems/roof/roof-materials.d.ts.map +1 -1
- package/dist/systems/roof/roof-materials.js +64 -31
- package/dist/systems/roof/roof-system.d.ts +21 -4
- package/dist/systems/roof/roof-system.d.ts.map +1 -1
- package/dist/systems/roof/roof-system.js +374 -49
- package/dist/systems/slab/slab-system.d.ts +1 -1
- package/dist/systems/slab/slab-system.d.ts.map +1 -1
- package/dist/systems/slab/slab-system.js +49 -19
- package/dist/systems/stair/stair-system.d.ts.map +1 -1
- package/dist/systems/stair/stair-system.js +133 -354
- package/dist/systems/wall/wall-cutout-cache.d.ts +39 -3
- package/dist/systems/wall/wall-cutout-cache.d.ts.map +1 -1
- package/dist/systems/wall/wall-cutout-cache.js +141 -19
- package/dist/systems/wall/wall-cutout.d.ts +6 -0
- package/dist/systems/wall/wall-cutout.d.ts.map +1 -1
- package/dist/systems/wall/wall-cutout.js +42 -28
- package/dist/systems/wall/wall-finish-data.d.ts +22 -0
- package/dist/systems/wall/wall-finish-data.d.ts.map +1 -0
- package/dist/systems/wall/wall-finish-data.js +17 -0
- package/dist/systems/wall/wall-material-variant.d.ts.map +1 -1
- package/dist/systems/wall/wall-materials.d.ts +9 -4
- package/dist/systems/wall/wall-materials.d.ts.map +1 -1
- package/dist/systems/wall/wall-materials.js +135 -153
- package/dist/systems/wall/wall-placeholder-sweep.d.ts.map +1 -1
- package/dist/systems/wall/wall-system.d.ts +33 -2
- package/dist/systems/wall/wall-system.d.ts.map +1 -1
- package/dist/systems/wall/wall-system.js +621 -159
- package/dist/systems/window/corner-frame.d.ts +10 -0
- package/dist/systems/window/corner-frame.d.ts.map +1 -0
- package/dist/systems/window/corner-frame.js +17 -0
- package/dist/systems/window/window-system.d.ts +1 -1
- package/dist/systems/window/window-system.d.ts.map +1 -1
- package/dist/systems/window/window-system.js +71 -27
- package/package.json +10 -10
- package/dist/systems/fence/fence-system.d.ts +0 -22
- package/dist/systems/fence/fence-system.d.ts.map +0 -1
- package/dist/systems/fence/fence-system.js +0 -357
package/dist/lib/hero-pose.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Box3 } from 'three';
|
|
2
|
-
export declare const DEFAULT_FRAMING_EXCLUDED_TYPES: readonly [
|
|
3
|
-
export declare function heroCameraPose({ boxes, aspect, aim, fovDeg, azimuthRad, elevationRad, padding, minDistance, frameShift, }: {
|
|
2
|
+
export declare const DEFAULT_FRAMING_EXCLUDED_TYPES: readonly ['site', 'scan', 'guide', 'spawn'];
|
|
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;
|
|
6
6
|
/** Where the camera looks (frame center). Defaults to the union-box center;
|
|
@@ -16,6 +16,11 @@ export declare function heroCameraPose({ boxes, aspect, aim, fovDeg, azimuthRad,
|
|
|
16
16
|
/** Fraction of the frustum half-height to drop the aim by. 0 keeps the aim
|
|
17
17
|
* (the building center) exactly at frame center. */
|
|
18
18
|
frameShift?: number;
|
|
19
|
+
/** Fit the PROJECTED extents instead of a symmetric fit around `aim`: the
|
|
20
|
+
* aim may drift off-center so the subject fills the frame. A symmetric fit
|
|
21
|
+
* pins the nearest corner to one edge and leaves the far side empty, since
|
|
22
|
+
* far corners project smaller. */
|
|
23
|
+
tightFit?: boolean;
|
|
19
24
|
}): {
|
|
20
25
|
position: [number, number, number];
|
|
21
26
|
target: [number, number, number];
|
|
@@ -30,6 +35,8 @@ export type HeroFraming = {
|
|
|
30
35
|
aim: [number, number, number];
|
|
31
36
|
/** 45° to the dominant facade (falls back to world 45°). */
|
|
32
37
|
azimuthRad: number;
|
|
38
|
+
/** Items left out of `boxes` because they sit away from the structure. */
|
|
39
|
+
detachedItemIds: string[];
|
|
33
40
|
};
|
|
34
41
|
/**
|
|
35
42
|
* Framing for a scene hero shot. The base set is the built structure (walls,
|
|
@@ -42,6 +49,9 @@ export type HeroFraming = {
|
|
|
42
49
|
* structure (pure furniture arrangements) fall back to framing every
|
|
43
50
|
* non-helper node.
|
|
44
51
|
*/
|
|
45
|
-
export declare function computeHeroFraming(
|
|
52
|
+
export declare function computeHeroFraming({ sitePlates, }?: {
|
|
53
|
+
/** false frames the built structure only, ignoring shaped site plates. */
|
|
54
|
+
sitePlates?: boolean;
|
|
55
|
+
}): HeroFraming | null;
|
|
46
56
|
export declare function temporarilyHideNodeTypes(types: readonly string[]): () => void;
|
|
47
57
|
//# sourceMappingURL=hero-pose.d.ts.map
|
|
@@ -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,
|
|
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,8B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,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"}
|
package/dist/lib/hero-pose.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { sceneRegistry, useScene } from '@pascal-app/core';
|
|
2
2
|
import { Box3, Vector3 } from 'three';
|
|
3
3
|
export const DEFAULT_FRAMING_EXCLUDED_TYPES = ['site', 'scan', 'guide', 'spawn'];
|
|
4
|
-
export function heroCameraPose({ boxes, aspect, aim, fovDeg = 60, azimuthRad = Math.PI / 4, elevationRad = (13 * Math.PI) / 180, padding = 1.03, minDistance = 4, frameShift = 0, }) {
|
|
4
|
+
export function heroCameraPose({ boxes, aspect, aim, fovDeg = 60, azimuthRad = Math.PI / 4, elevationRad = (13 * Math.PI) / 180, padding = 1.03, minDistance = 4, frameShift = 0, tightFit = false, }) {
|
|
5
5
|
const list = Array.isArray(boxes) ? boxes : [boxes];
|
|
6
6
|
const union = new Box3();
|
|
7
7
|
for (const box of list)
|
|
@@ -37,6 +37,62 @@ export function heroCameraPose({ boxes, aspect, aim, fovDeg = 60, azimuthRad = M
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
if (tightFit) {
|
|
41
|
+
// Every corner as (lateral, vertical, depth) around `center`. For a camera
|
|
42
|
+
// distance d, a shift (sx, sy) of aim+camera along right/up keeps a corner
|
|
43
|
+
// in frame iff |lateral − sx| ≤ tanH·(d + depth) (same vertically), so each
|
|
44
|
+
// corner bounds the feasible shift window; the tightest d whose windows
|
|
45
|
+
// still intersect is the fit, bisected from the symmetric distance.
|
|
46
|
+
const samples = [];
|
|
47
|
+
for (const box of list) {
|
|
48
|
+
for (const x of [box.min.x, box.max.x]) {
|
|
49
|
+
for (const y of [box.min.y, box.max.y]) {
|
|
50
|
+
for (const z of [box.min.z, box.max.z]) {
|
|
51
|
+
offset.subVectors(corner.set(x, y, z), center);
|
|
52
|
+
samples.push([offset.dot(right), offset.dot(up), offset.dot(forward)]);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const tanH = tanHorizontal / padding;
|
|
58
|
+
const tanV = tanVertical / padding;
|
|
59
|
+
const shiftWindow = (d) => {
|
|
60
|
+
let loX = Number.NEGATIVE_INFINITY;
|
|
61
|
+
let hiX = Number.POSITIVE_INFINITY;
|
|
62
|
+
let loY = Number.NEGATIVE_INFINITY;
|
|
63
|
+
let hiY = Number.POSITIVE_INFINITY;
|
|
64
|
+
for (const [lateral, vertical, depth] of samples) {
|
|
65
|
+
const z = d + depth;
|
|
66
|
+
if (z <= 0.1)
|
|
67
|
+
return null;
|
|
68
|
+
loX = Math.max(loX, lateral - tanH * z);
|
|
69
|
+
hiX = Math.min(hiX, lateral + tanH * z);
|
|
70
|
+
loY = Math.max(loY, vertical - tanV * z);
|
|
71
|
+
hiY = Math.min(hiY, vertical + tanV * z);
|
|
72
|
+
}
|
|
73
|
+
return loX <= hiX && loY <= hiY ? { sx: (loX + hiX) / 2, sy: (loY + hiY) / 2 } : null;
|
|
74
|
+
};
|
|
75
|
+
let lo = minDistance;
|
|
76
|
+
let hi = distance;
|
|
77
|
+
while (!shiftWindow(hi))
|
|
78
|
+
hi *= 1.5;
|
|
79
|
+
for (let i = 0; i < 40; i++) {
|
|
80
|
+
const mid = (lo + hi) / 2;
|
|
81
|
+
if (shiftWindow(mid))
|
|
82
|
+
hi = mid;
|
|
83
|
+
else
|
|
84
|
+
lo = mid;
|
|
85
|
+
}
|
|
86
|
+
const shift = shiftWindow(hi);
|
|
87
|
+
const target = center
|
|
88
|
+
.clone()
|
|
89
|
+
.addScaledVector(right, shift.sx)
|
|
90
|
+
.addScaledVector(up, shift.sy - frameShift * hi * tanVertical);
|
|
91
|
+
return {
|
|
92
|
+
position: [target.x + dir.x * hi, target.y + dir.y * hi, target.z + dir.z * hi],
|
|
93
|
+
target: [target.x, target.y, target.z],
|
|
94
|
+
};
|
|
95
|
+
}
|
|
40
96
|
// Reframe: slide aim and camera together along the view-up axis — pure
|
|
41
97
|
// composition shift, no perspective change.
|
|
42
98
|
const drop = up.clone().multiplyScalar(-frameShift * distance * tanVertical);
|
|
@@ -166,7 +222,7 @@ function dominantWallYaw() {
|
|
|
166
222
|
* structure (pure furniture arrangements) fall back to framing every
|
|
167
223
|
* non-helper node.
|
|
168
224
|
*/
|
|
169
|
-
export function computeHeroFraming() {
|
|
225
|
+
export function computeHeroFraming({ sitePlates = true, } = {}) {
|
|
170
226
|
const structural = perNodeBoxes([...DEFAULT_FRAMING_EXCLUDED_TYPES, 'item', 'building', 'level']);
|
|
171
227
|
if (structural.length === 0) {
|
|
172
228
|
const all = perNodeBoxes([...DEFAULT_FRAMING_EXCLUDED_TYPES, 'building', 'level']);
|
|
@@ -176,12 +232,17 @@ export function computeHeroFraming() {
|
|
|
176
232
|
for (const box of all)
|
|
177
233
|
union.union(box);
|
|
178
234
|
const center = union.getCenter(new Vector3());
|
|
179
|
-
return {
|
|
235
|
+
return {
|
|
236
|
+
boxes: all,
|
|
237
|
+
aim: [center.x, center.y, center.z],
|
|
238
|
+
azimuthRad: Math.PI / 4,
|
|
239
|
+
detachedItemIds: [],
|
|
240
|
+
};
|
|
180
241
|
}
|
|
181
242
|
const structuralUnion = new Box3();
|
|
182
243
|
for (const box of structural)
|
|
183
244
|
structuralUnion.union(box);
|
|
184
|
-
const plates = sitePlateBoxes();
|
|
245
|
+
const plates = sitePlates ? sitePlateBoxes() : [];
|
|
185
246
|
const groundUnion = structuralUnion.clone();
|
|
186
247
|
for (const box of plates)
|
|
187
248
|
groundUnion.union(box);
|
|
@@ -189,14 +250,19 @@ export function computeHeroFraming() {
|
|
|
189
250
|
.clone()
|
|
190
251
|
.expandByVector(groundUnion.getSize(new Vector3()).multiplyScalar(0.15));
|
|
191
252
|
const boxes = [...structural, ...plates];
|
|
253
|
+
const detachedItemIds = [];
|
|
192
254
|
const itemIds = sceneRegistry.byType.item;
|
|
193
255
|
for (const id of itemIds) {
|
|
194
256
|
const object = sceneRegistry.nodes.get(id);
|
|
195
257
|
if (!object)
|
|
196
258
|
continue;
|
|
197
259
|
const bounds = new Box3().setFromObject(object);
|
|
198
|
-
if (
|
|
260
|
+
if (bounds.isEmpty())
|
|
261
|
+
continue;
|
|
262
|
+
if (nearby.intersectsBox(bounds))
|
|
199
263
|
boxes.push(bounds);
|
|
264
|
+
else
|
|
265
|
+
detachedItemIds.push(id);
|
|
200
266
|
}
|
|
201
267
|
const groundCenter = groundUnion.getCenter(new Vector3());
|
|
202
268
|
const structuralCenter = structuralUnion.getCenter(new Vector3());
|
|
@@ -205,6 +271,7 @@ export function computeHeroFraming() {
|
|
|
205
271
|
boxes,
|
|
206
272
|
aim: [groundCenter.x, structuralCenter.y, groundCenter.z],
|
|
207
273
|
azimuthRad: Math.PI / 4 - (yaw ?? 0),
|
|
274
|
+
detachedItemIds,
|
|
208
275
|
};
|
|
209
276
|
}
|
|
210
277
|
export function temporarilyHideNodeTypes(types) {
|
package/dist/lib/ink-edges.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { Camera } from 'three';
|
|
2
|
+
import type { Node } from 'three/webgpu';
|
|
3
|
+
export declare function createEdgeDepthSampler(depthTex: any, camera: Camera): (uv: any) => any;
|
|
4
|
+
export declare function inkedEdges({ sampleDepth, normalTex, inkColor, radius, opacity, sceneRgb, }: {
|
|
5
|
+
sampleDepth: (uv: any) => any;
|
|
3
6
|
normalTex: any;
|
|
4
7
|
inkColor: any;
|
|
5
|
-
radius: number
|
|
8
|
+
radius: number | Node<'float'>;
|
|
6
9
|
opacity: any;
|
|
7
10
|
sceneRgb: any;
|
|
8
11
|
}): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ink-edges.d.ts","sourceRoot":"","sources":["../../src/lib/ink-edges.ts"],"names":[],"mappings":"
|
|
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"}
|
package/dist/lib/ink-edges.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import { abs, float, max, min, mix, screenSize, screenUV, smoothstep, vec2 } from 'three/tsl';
|
|
1
|
+
import { abs, float, max, min, mix, perspectiveDepthToViewZ, screenSize, screenUV, smoothstep, uniform, vec2, viewZToPerspectiveDepth, } from 'three/tsl';
|
|
2
2
|
import { unpackRGBToNormal } from './tsl-compat';
|
|
3
|
+
export function createEdgeDepthSampler(depthTex, camera) {
|
|
4
|
+
if (!('isPerspectiveCamera' in camera))
|
|
5
|
+
return (uv) => depthTex.sample(uv).r;
|
|
6
|
+
const perspective = camera;
|
|
7
|
+
const near = uniform(perspective.near).onRenderUpdate(() => perspective.near);
|
|
8
|
+
const far = uniform(perspective.far).onRenderUpdate(() => perspective.far);
|
|
9
|
+
// Ink and AO thresholds were calibrated at near 0.1 / far 1000. Keep
|
|
10
|
+
// their world distances when orbit, walkthrough or capture clipping changes.
|
|
11
|
+
return (uv) => viewZToPerspectiveDepth(perspectiveDepthToViewZ(depthTex.sample(uv).r, near, far), float(0.1), float(1000));
|
|
12
|
+
}
|
|
3
13
|
// Screen-space ink outline (SketchUp / Moebius look). Reads the scene-pass
|
|
4
14
|
// depth + normal MRT and inks two signals:
|
|
5
15
|
//
|
|
@@ -16,14 +26,14 @@ import { unpackRGBToNormal } from './tsl-compat';
|
|
|
16
26
|
// Topology-agnostic: works on CSG triangle soup, organic GLBs, anything — it
|
|
17
27
|
// only sees the rendered buffers. `intensity` scales the final mask; `inkColor`
|
|
18
28
|
// should track the background luminance (dark lines on light scenes).
|
|
19
|
-
export function inkedEdges({
|
|
29
|
+
export function inkedEdges({ sampleDepth, normalTex, inkColor, radius, opacity, sceneRgb, }) {
|
|
20
30
|
const px = vec2(1, 1).div(screenSize).mul(radius);
|
|
21
31
|
const uvN = screenUV;
|
|
22
|
-
const dC =
|
|
23
|
-
const dR =
|
|
24
|
-
const dL =
|
|
25
|
-
const dU =
|
|
26
|
-
const dD =
|
|
32
|
+
const dC = sampleDepth(uvN);
|
|
33
|
+
const dR = sampleDepth(uvN.add(vec2(px.x, 0)));
|
|
34
|
+
const dL = sampleDepth(uvN.sub(vec2(px.x, 0)));
|
|
35
|
+
const dU = sampleDepth(uvN.add(vec2(0, px.y)));
|
|
36
|
+
const dD = sampleDepth(uvN.sub(vec2(0, px.y)));
|
|
27
37
|
const depthLap = abs(dR.add(dL).add(dU).add(dD).sub(dC.mul(4)));
|
|
28
38
|
const invDepth = float(1).sub(dC);
|
|
29
39
|
const depthMetric = depthLap.div(invDepth.mul(invDepth).add(float(0.00002)));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Vector3Tuple } from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Aims the key (shadow-casting) light along a world direction, ahead of the
|
|
4
|
+
* theme or atmosphere source. For captures that compose their own camera —
|
|
5
|
+
* the worker thumbnail sets the sun relative to its hero angle so shadows
|
|
6
|
+
* read instead of falling straight behind the building. `null` restores the
|
|
7
|
+
* theme/atmosphere direction.
|
|
8
|
+
*/
|
|
9
|
+
export declare function setKeyLightDirectionOverride(direction: Vector3Tuple | null): void;
|
|
10
|
+
export declare function getKeyLightDirectionOverride(): Vector3Tuple | null;
|
|
11
|
+
//# sourceMappingURL=key-light-override.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-light-override.d.ts","sourceRoot":"","sources":["../../src/lib/key-light-override.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAIzC;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,YAAY,GAAG,IAAI,QAE1E;AAED,wBAAgB,4BAA4B,IAAI,YAAY,GAAG,IAAI,CAElE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
let keyLightDirection = null;
|
|
2
|
+
/**
|
|
3
|
+
* Aims the key (shadow-casting) light along a world direction, ahead of the
|
|
4
|
+
* theme or atmosphere source. For captures that compose their own camera —
|
|
5
|
+
* the worker thumbnail sets the sun relative to its hero angle so shadows
|
|
6
|
+
* read instead of falling straight behind the building. `null` restores the
|
|
7
|
+
* theme/atmosphere direction.
|
|
8
|
+
*/
|
|
9
|
+
export function setKeyLightDirectionOverride(direction) {
|
|
10
|
+
keyLightDirection = direction;
|
|
11
|
+
}
|
|
12
|
+
export function getKeyLightDirectionOverride() {
|
|
13
|
+
return keyLightDirection;
|
|
14
|
+
}
|
|
@@ -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":"
|
|
1
|
+
{"version":3,"file":"ktx2-loader.d.ts","sourceRoot":"","sources":["../../src/lib/ktx2-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EAMvB,MAAM,OAAO,CAAA;AAId,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAA;AA2BrE,oFAAoF;AACpF,wBAAgB,oBAAoB,IAAI;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAE1E;AAED;;;;;;;;;;GAUG;AACH,cAAM,uBAAwB,SAAQ,UAAU;IAC9C,OAAO,CAAC,YAAY,CAA0B;IAErC,IAAI,CACX,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,EAC5C,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,EAC3C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GACjC,IAAI,CA8BN;IAED,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,CAiC5F;IAED,OAAO,IAAI,IAAI,CAKd;CACF;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,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"}
|
package/dist/lib/ktx2-loader.js
CHANGED
|
@@ -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,KAA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layers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
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.
|
package/dist/lib/layers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layers.d.ts","sourceRoot":"","sources":["../../src/lib/layers.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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"}
|
package/dist/lib/layers.js
CHANGED
|
@@ -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
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
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.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Holds the viewport's LAST presented frame on screen while a capture works
|
|
3
|
+
* on the shared scene: the frame loop keeps ticking (useFrame systems still
|
|
4
|
+
* run, a capture can pump frames by hand) but the live draw is skipped, so
|
|
5
|
+
* whatever a capture swaps in for its own renders — a presentation flip, a
|
|
6
|
+
* hidden ground, an override material held across a GPU readback — never
|
|
7
|
+
* reaches the canvas.
|
|
8
|
+
*
|
|
9
|
+
* Holds nest; each one expires on its own after `maxMs` so a capture that
|
|
10
|
+
* never settles cannot freeze the viewport for the session.
|
|
11
|
+
*/
|
|
12
|
+
export declare function holdLiveFrame(maxMs?: number): () => void;
|
|
13
|
+
export declare function isLiveFrameHeld(): boolean;
|
|
14
|
+
//# sourceMappingURL=live-frame-hold.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-frame-hold.d.ts","sourceRoot":"","sources":["../../src/lib/live-frame-hold.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,wBAAgB,aAAa,CAAC,KAAK,SAAS,GAAG,MAAM,IAAI,CAWxD;AAED,wBAAgB,eAAe,IAAI,OAAO,CAEzC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Holds the viewport's LAST presented frame on screen while a capture works
|
|
3
|
+
* on the shared scene: the frame loop keeps ticking (useFrame systems still
|
|
4
|
+
* run, a capture can pump frames by hand) but the live draw is skipped, so
|
|
5
|
+
* whatever a capture swaps in for its own renders — a presentation flip, a
|
|
6
|
+
* hidden ground, an override material held across a GPU readback — never
|
|
7
|
+
* reaches the canvas.
|
|
8
|
+
*
|
|
9
|
+
* Holds nest; each one expires on its own after `maxMs` so a capture that
|
|
10
|
+
* never settles cannot freeze the viewport for the session.
|
|
11
|
+
*/
|
|
12
|
+
let holds = 0;
|
|
13
|
+
export function holdLiveFrame(maxMs = 60_000) {
|
|
14
|
+
holds += 1;
|
|
15
|
+
let released = false;
|
|
16
|
+
const release = () => {
|
|
17
|
+
if (released)
|
|
18
|
+
return;
|
|
19
|
+
released = true;
|
|
20
|
+
clearTimeout(expiry);
|
|
21
|
+
holds -= 1;
|
|
22
|
+
};
|
|
23
|
+
const expiry = setTimeout(release, maxMs);
|
|
24
|
+
return release;
|
|
25
|
+
}
|
|
26
|
+
export function isLiveFrameHeld() {
|
|
27
|
+
return holds > 0;
|
|
28
|
+
}
|
package/dist/lib/materials.d.ts
CHANGED
|
@@ -11,8 +11,15 @@ 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;
|
|
21
|
+
/** Glass lets light through; shadow maps would otherwise treat it as a solid panel. */
|
|
22
|
+
export declare function materialCastsShadow(material: THREE.Material | THREE.Material[]): boolean;
|
|
16
23
|
export declare function applyMaterialPresetToMaterials(materialInput: THREE.Material | THREE.Material[], preset: MaterialPresetPayload | null | undefined): void;
|
|
17
24
|
export declare function createMaterialFromPreset(preset: MaterialPresetPayload, shading?: RenderShading): THREE.Material;
|
|
18
25
|
export declare function createMaterialFromPresetRef(materialPreset?: string, shading?: RenderShading): THREE.Material | null;
|
|
@@ -26,17 +33,22 @@ export declare function createMaterial(material?: MaterialSchema, shading?: Rend
|
|
|
26
33
|
*/
|
|
27
34
|
export declare function materialPresetRefSignature(ref: string): string;
|
|
28
35
|
/**
|
|
29
|
-
* Resolve a MaterialRef ('library:<id>' | 'scene:<id>')
|
|
30
|
-
*
|
|
31
|
-
*
|
|
36
|
+
* Resolve a MaterialRef ('library:<id>' | 'scene:<id>') or a plain '#rrggbb'
|
|
37
|
+
* colour to a three.js material; the colour paints like
|
|
38
|
+
* `material: { properties: { color } }`. Returns null for an unknown / dangling
|
|
39
|
+
* ref so callers fall back to the slot's default (authored material, then
|
|
40
|
+
* themed default). Never throws.
|
|
32
41
|
*/
|
|
33
42
|
export declare function resolveMaterialRef(ref: string | undefined, sceneMaterials: Record<SceneMaterialId, SceneMaterial> | undefined, shading?: RenderShading): THREE.Material | null;
|
|
34
43
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
44
|
+
* Swaps declared slot DEFAULTS (never painted refs) for another finish, e.g.
|
|
45
|
+
* the worker thumbnail renders unpainted walls as plaster instead of the
|
|
46
|
+
* prepared-drywall default. Must be set before the scene builds its
|
|
47
|
+
* materials; `null` restores the declared defaults.
|
|
39
48
|
*/
|
|
49
|
+
export declare function setSlotDefaultOverrides(overrides: Readonly<Record<string, string>> | null): void;
|
|
50
|
+
/** A declared slot default after `setSlotDefaultOverrides`. */
|
|
51
|
+
export declare function resolveSlotDefaultRef(slotDefault: string): string;
|
|
40
52
|
export declare function resolveSlotDefaultMaterial(slotDefault: string, shading?: RenderShading, roughness?: number): THREE.Material;
|
|
41
53
|
export declare function createDefaultMaterial(color?: string, roughness?: number, shading?: RenderShading, side?: THREE.Side): THREE.Material;
|
|
42
54
|
export declare function createSurfaceRoleMaterial(role: SurfaceRole, preset: ColorPreset, side?: THREE.Side, sceneThemeId?: string): THREE.Material;
|
|
@@ -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,
|
|
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,EACjB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,uBAAuB,EAA4B,MAAM,cAAc,CAAA;AAOhF,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,UAAU,CAAA;AAChD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,CAAA;AAEjE,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAQpD,CAAA;AAID,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAQrD,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAQpD,CAAA;AAED,eAAO,MAAM,i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