@playcanvas/supersplat-viewer 1.39.0 → 1.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -19,6 +19,95 @@ type ViewerAssets = {
19
19
  /** Collision data url, for walk mode. A `.glb` is treated as a mesh, otherwise voxels. */
20
20
  collisionUrl?: string;
21
21
  };
22
+ /** Per-instance switches. Every one is optional and off unless stated. */
23
+ type ViewerFlags = {
24
+ /**
25
+ * Requested renderer; the engine falls back to WebGL when WebGPU is unavailable. Default
26
+ * `webgpu`.
27
+ */
28
+ renderer?: 'webgl' | 'webgpu';
29
+ /**
30
+ * Build the viewer's ui: the controls, panels, poster, loading bar, annotation hotspots
31
+ * and their navigator. Defaults to `true`. `false` is the headless level: the canvas and
32
+ * the api, with no overlay markup. Core camera input, browser integration and preference
33
+ * persistence remain active. The host renders controls against the public handle;
34
+ * `setMoveInput` supports a replacement joystick. Note that the touch joystick and the AR/VR
35
+ * fallback prompt live in that ui, so a headless host owns those affordances too.
36
+ */
37
+ ui?: boolean;
38
+ /**
39
+ * Css pixels by which the toolbar, and everything else anchored to the viewer's bottom edge,
40
+ * is lifted, so chrome a host app draws over the bottom of the viewer does not cover it. On
41
+ * touch devices (a coarse primary pointer) only; elsewhere the toolbar stays at the edge.
42
+ * Clamped to 0–200. Defaults to `0`. Experimental: it may be renamed or removed in a minor
43
+ * release.
44
+ */
45
+ experimentalTouchInsetBottom?: number;
46
+ /** Show the centre reticle in desktop fly/walk mode with gaming controls. Defaults to `false`. */
47
+ reticle?: boolean;
48
+ /** Start with the camera animation paused. */
49
+ noanim?: boolean;
50
+ /** Disable post effects. */
51
+ nofx?: boolean;
52
+ /** Override the settings' `highPrecisionRendering`. */
53
+ hpr?: boolean;
54
+ /** Show the engine's MiniStats panel. */
55
+ ministats?: boolean;
56
+ /** Render with LOD colorisation. */
57
+ colorize?: boolean;
58
+ /** Load all streaming LOD data before the first frame. */
59
+ fullload?: boolean;
60
+ /**
61
+ * Offer VR at once: where VR can start, a prompt shows over the viewer while it loads, and a
62
+ * tap on it starts a VR session as soon as the scene is placed, the rest of the scene streaming
63
+ * in during the session; a tap elsewhere dismisses it. A session needs a tap: browsers start
64
+ * none without one. The camera animation starts paused, as with `noanim`. Needs the ui.
65
+ * Defaults to `false`.
66
+ */
67
+ vr?: boolean;
68
+ /** Render with antialiasing. */
69
+ aa?: boolean;
70
+ /**
71
+ * Developer override of the Performance Mode setting: `true` forces the stochastic splat
72
+ * renderer (unsorted, depth-tested splats whose depth buffer also serves picking) in its
73
+ * per-pixel mode, `'mobile'` in its interleaved-pixel-sets mode, and `'off'` keeps the
74
+ * engine's sorted renderer; each hides the setting. Without it the user's Performance Mode
75
+ * toggle decides, and the device class picks the mode. WebGPU only; ignored on WebGL. The
76
+ * renderer draws WebGPU XR sessions too, one view per eye (Safari on Apple Vision Pro); where
77
+ * only WebGL could host a session, the viewer offers a reload into WebGL.
78
+ */
79
+ stochastic?: boolean | 'mobile' | 'off';
80
+ /**
81
+ * Developer knob for the stochastic renderer: the data path that feeds it. Default
82
+ * `direct`, the resident files read in place; `workbuffer` reads the engine's work buffer.
83
+ */
84
+ splatSource?: 'workbuffer' | 'direct';
85
+ /**
86
+ * Developer knob for the stochastic renderer: comma-separated `key:value` experiment
87
+ * switches applied over the chosen mode's, e.g. `coverage:interleaved,jitter:2`.
88
+ */
89
+ variant?: string;
90
+ /** Splat budget in millions, overriding the Quality slider's ladder (every position then gives it). */
91
+ budget?: number;
92
+ /**
93
+ * Developer knob: while the viewer renders on demand, the most rendered frames the gpu may
94
+ * have unfinished before the next continuous render (the camera moving, the stochastic
95
+ * renderer accumulating) waits for one to finish; `0` lets them queue. Defaults to `2`.
96
+ */
97
+ framesInFlight?: number;
98
+ /** Render the collision heatmap debug overlay (WebGPU only). */
99
+ heatmap?: boolean;
100
+ /** Open the developer debug panel on load; Ctrl+Shift+D toggles it either way. */
101
+ debug?: boolean;
102
+ /** Ui language. Default: detected from the browser. */
103
+ lang?: string;
104
+ /**
105
+ * Publish `window.app`, `scrubTo`, `captureFrame`, `animationDuration` and the debug panel's
106
+ * camera-state hooks. The standalone document turns this on for the thumbnail pipeline; an
107
+ * embedded instance leaves it off, since two viewers would overwrite each other's.
108
+ */
109
+ exposeGlobals?: boolean;
110
+ };
22
111
 
23
112
  /**
24
113
  * Asset urls and settings the embedder supplies to the viewer. The asset urls are the same
@@ -93,4 +182,4 @@ declare const css: string;
93
182
  declare const js: string;
94
183
 
95
184
  export { css, html, js, renderViewerHtml };
96
- export type { RenderViewerHtmlOptions, ViewerAssets, ViewerBootstrap };
185
+ export type { RenderViewerHtmlOptions, ViewerAssets, ViewerBootstrap, ViewerFlags };