@playcanvas/supersplat-viewer 1.43.3 → 1.44.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 +96 -2
- package/dist/index.js +12 -7
- package/dist/index.js.map +1 -1
- package/dist/viewer.css +169 -119
- package/dist/viewer.d.ts +9 -1
- package/dist/viewer.js +449 -172
- package/dist/viewer.js.map +1 -1
- package/docs/api.md +44 -12
- package/package.json +8 -8
- package/public/index.css +169 -119
- package/public/index.html +31 -27
- package/public/index.js +555 -228
- package/public/index.js.map +1 -1
package/public/index.html
CHANGED
|
@@ -64,10 +64,18 @@
|
|
|
64
64
|
// ?content= override replaces the url it describes.
|
|
65
65
|
const contentFilename = url.searchParams.has('content') ? null : (bootstrap.contentFilename ?? null);
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
// Flags: a url param wins, then the bootstrap's flags (the embedder's defaults for this
|
|
68
|
+
// document), then createViewer's own default. A switch param such as `?noanim` can only
|
|
69
|
+
// turn its flag on; `hpr` and `aa` take a value, so they can turn it either way
|
|
70
|
+
const flags = bootstrap.flags ?? {};
|
|
71
|
+
const param = (name) => url.searchParams.get(name);
|
|
72
|
+
const has = (name) => url.searchParams.has(name);
|
|
73
|
+
const enabled = (name) => ['', '1', 'true', 'enable'].includes(param(name));
|
|
74
|
+
const flag = (name) => (has(name) ? true : flags[name]);
|
|
68
75
|
|
|
69
|
-
const
|
|
70
|
-
|
|
76
|
+
const renderer = has('webgl') ? 'webgl' : (flags.renderer ?? 'webgpu');
|
|
77
|
+
|
|
78
|
+
const budget = has('budget') ? Number(param('budget')) : flags.budget;
|
|
71
79
|
|
|
72
80
|
// The engine's octree and lcc2 parsers fetch lod-meta.json and .lcc2 files themselves
|
|
73
81
|
// and ignore a prefetched response, so starting one here would download the metadata
|
|
@@ -94,35 +102,31 @@
|
|
|
94
102
|
zstdDecoderUrl,
|
|
95
103
|
poster: posterUrl && createImage(posterUrl),
|
|
96
104
|
contents: prefetchContent ? fetch(contentUrl) : undefined,
|
|
97
|
-
ui:
|
|
98
|
-
reticle:
|
|
99
|
-
noanim:
|
|
100
|
-
nofx:
|
|
101
|
-
hpr:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
ministats: url.searchParams.has('ministats'),
|
|
105
|
-
colorize: url.searchParams.has('colorize'),
|
|
105
|
+
ui: has('noui') ? false : flags.ui,
|
|
106
|
+
reticle: flag('reticle'),
|
|
107
|
+
noanim: flag('noanim'),
|
|
108
|
+
nofx: flag('nofx'),
|
|
109
|
+
hpr: has('hpr') ? enabled('hpr') : flags.hpr,
|
|
110
|
+
ministats: flag('ministats'),
|
|
111
|
+
colorize: flag('colorize'),
|
|
106
112
|
renderer,
|
|
107
|
-
aa:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
stochastic: url.searchParams.has('stochastic')
|
|
111
|
-
? url.searchParams.get('stochastic') === 'mobile'
|
|
113
|
+
aa: has('aa') ? enabled('aa') : flags.aa,
|
|
114
|
+
stochastic: has('stochastic')
|
|
115
|
+
? param('stochastic') === 'mobile'
|
|
112
116
|
? 'mobile'
|
|
113
|
-
:
|
|
117
|
+
: param('stochastic') === 'off'
|
|
114
118
|
? 'off'
|
|
115
119
|
: true
|
|
116
|
-
:
|
|
117
|
-
splatSource:
|
|
118
|
-
variant:
|
|
120
|
+
: flags.stochastic,
|
|
121
|
+
splatSource: param('splatSource') ?? flags.splatSource,
|
|
122
|
+
variant: param('variant') ?? flags.variant,
|
|
119
123
|
budget,
|
|
120
|
-
framesInFlight:
|
|
121
|
-
heatmap:
|
|
122
|
-
fullload:
|
|
123
|
-
vr:
|
|
124
|
-
debug:
|
|
125
|
-
lang:
|
|
124
|
+
framesInFlight: has('fif') ? Number(param('fif')) : flags.framesInFlight,
|
|
125
|
+
heatmap: flag('heatmap'),
|
|
126
|
+
fullload: flag('fullload'),
|
|
127
|
+
vr: flag('vr'),
|
|
128
|
+
debug: flag('debug'),
|
|
129
|
+
lang: param('lang') ?? flags.lang,
|
|
126
130
|
// the standalone document is the one place the window.* hooks belong
|
|
127
131
|
exposeGlobals: true
|
|
128
132
|
};
|