@playcanvas/supersplat-viewer 1.42.0 → 1.42.1
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.js +1 -1
- package/dist/viewer.d.ts +2 -1
- package/dist/viewer.js +20 -3
- package/dist/viewer.js.map +1 -1
- package/package.json +1 -1
- package/public/index.js +20 -3
- package/public/index.js.map +1 -1
package/package.json
CHANGED
package/public/index.js
CHANGED
|
@@ -94178,7 +94178,7 @@ const importSettings = (settings) => {
|
|
|
94178
94178
|
return result;
|
|
94179
94179
|
};
|
|
94180
94180
|
|
|
94181
|
-
var version = "1.42.
|
|
94181
|
+
var version = "1.42.1";
|
|
94182
94182
|
|
|
94183
94183
|
class Tooltip {
|
|
94184
94184
|
register;
|
|
@@ -109244,7 +109244,11 @@ class Viewer {
|
|
|
109244
109244
|
vec.sub2(sceneBound.center, camera.position);
|
|
109245
109245
|
const dist = vec.dot(cameraEntity.forward);
|
|
109246
109246
|
const far = Math.max(dist + boundRadius, 1e-2);
|
|
109247
|
-
|
|
109247
|
+
// the near plane's floor is capped at the orbit's closest zoom: a few stray splats far
|
|
109248
|
+
// outside a scene stretch its bound, and a floor of far / 16k would then cull the
|
|
109249
|
+
// streamed nodes just in front of the camera, and flatten the stochastic renderer's
|
|
109250
|
+
// depths there
|
|
109251
|
+
const near = Math.max(dist - boundRadius, Math.min(far / (1024 * 16), 0.01));
|
|
109248
109252
|
cameraEntity.camera.farClip = far;
|
|
109249
109253
|
cameraEntity.camera.nearClip = Math.min(1.0, near);
|
|
109250
109254
|
};
|
|
@@ -109966,6 +109970,19 @@ const isPrefetchable = (contentUrl, contentFilename) => contentName(contentUrl,
|
|
|
109966
109970
|
// gsaf is an animated splat sequence, which the viewer decodes and plays itself rather than
|
|
109967
109971
|
// through an engine parser
|
|
109968
109972
|
const isGsaf = (contentUrl, contentFilename) => contentName(contentUrl, contentFilename)?.toLowerCase().endsWith('.gsaf');
|
|
109973
|
+
// TEMPORARY, until a Quest Browser release accepts a WebGPU device for WebXR again: then delete
|
|
109974
|
+
// this and its use in resolveConfig. Quest Browser 156 refuses every WebGPU device for an
|
|
109975
|
+
// immersive session, even one from an adapter requested with xrCompatible (XRGPUBinding throws
|
|
109976
|
+
// "WebGPU device must be created by an XR compatible adapter"), so VR and AR show black. The
|
|
109977
|
+
// headsets already run the sorted renderer (quality.ts keeps the stochastic one off them), so
|
|
109978
|
+
// WebGL costs them only the gpu sort. It overrides even an explicit renderer: 'webgpu', since
|
|
109979
|
+
// hosts pass one by default (superspl.at's viewer-options.ts does). A ?webgpu in the page url
|
|
109980
|
+
// opts back in, to check a new browser release for the fix. It is read here rather than in
|
|
109981
|
+
// index.html, against the rule that only the document reads url params, because hosts parse the
|
|
109982
|
+
// url themselves (superspl.at forwards its scene page's params to the viewer's document but does
|
|
109983
|
+
// not pass this one on)
|
|
109984
|
+
const questBrowser = /OculusBrowser/.test(globalThis.navigator?.userAgent ?? '') &&
|
|
109985
|
+
!new URLSearchParams(globalThis.location?.search ?? '').has('webgpu');
|
|
109969
109986
|
const loadGsplat = async (app, config, progressCallback, cancelled) => {
|
|
109970
109987
|
const { contents, contentUrl, contentFilename } = config;
|
|
109971
109988
|
const c = contents;
|
|
@@ -110154,7 +110171,7 @@ const resolveConfig = (options) => ({
|
|
|
110154
110171
|
poster: options.poster ?? (options.posterUrl ? createImage(options.posterUrl) : undefined),
|
|
110155
110172
|
contents: options.contents ??
|
|
110156
110173
|
(isPrefetchable(options.contentUrl, options.contentFilename) ? fetch(options.contentUrl) : undefined),
|
|
110157
|
-
renderer: options.renderer ?? 'webgpu',
|
|
110174
|
+
renderer: questBrowser ? 'webgl' : (options.renderer ?? 'webgpu'),
|
|
110158
110175
|
ui: options.ui ?? true,
|
|
110159
110176
|
reticle: options.reticle ?? false,
|
|
110160
110177
|
noanim: options.noanim ?? false,
|