@playcanvas/supersplat-viewer 1.18.4 → 1.18.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcanvas/supersplat-viewer",
3
- "version": "1.18.4",
3
+ "version": "1.18.6",
4
4
  "author": "PlayCanvas <support@playcanvas.com>",
5
5
  "homepage": "https://github.com/playcanvas/supersplat-viewer#readme",
6
6
  "description": "Viewer for https://superspl.at",
package/public/index.html CHANGED
@@ -38,6 +38,7 @@
38
38
  gpusort: url.searchParams.has('gpusort'),
39
39
  aa: url.searchParams.has('aa'),
40
40
  heatmap: url.searchParams.has('heatmap'),
41
+ fullload: url.searchParams.has('fullload'),
41
42
  };
42
43
 
43
44
  window.sse = {
package/public/index.js CHANGED
@@ -73841,7 +73841,7 @@ class WalkController {
73841
73841
  /**
73842
73842
  * Field of view in degrees for walk mode.
73843
73843
  */
73844
- fov = 96;
73844
+ fov = 90;
73845
73845
  /**
73846
73846
  * Total capsule height in meters (default: human proportion)
73847
73847
  */
@@ -76221,8 +76221,8 @@ class Viewer {
76221
76221
  }
76222
76222
  else {
76223
76223
  const { gsplat } = app.scene;
76224
- // quality ranges
76225
- const ranges = {
76224
+ // quality budget
76225
+ const budgets = {
76226
76226
  mobile: {
76227
76227
  low: 1,
76228
76228
  high: 2
@@ -76232,11 +76232,22 @@ class Viewer {
76232
76232
  high: 4
76233
76233
  }
76234
76234
  };
76235
- const quality = platform.mobile ? ranges.mobile : ranges.desktop;
76236
- // start by streaming in low lod
76237
- const lodLevels = results[0].gsplat.resource?.octree?.lodLevels;
76238
- if (lodLevels) {
76239
- gsplat.lodRangeMax = gsplat.lodRangeMin = lodLevels - 1;
76235
+ const getBudget = () => {
76236
+ const quality = platform.mobile ? budgets.mobile : budgets.desktop;
76237
+ return state.retinaDisplay ? quality.high : quality.low;
76238
+ };
76239
+ if (config.fullload) {
76240
+ // reveal once full quality has finished loading (used for screenshots)
76241
+ gsplat.splatBudget = getBudget() * 1000000;
76242
+ gsplat.lodRangeMin = 0;
76243
+ gsplat.lodRangeMax = 1000;
76244
+ }
76245
+ else {
76246
+ // reveal once low lod has loaded for fastest possible reveal
76247
+ const lodLevels = results[0].gsplat.resource?.octree?.lodLevels;
76248
+ if (lodLevels) {
76249
+ gsplat.lodRangeMax = gsplat.lodRangeMin = lodLevels - 1;
76250
+ }
76240
76251
  }
76241
76252
  // these two allow LOD behind camera to drop, saves lots of splats
76242
76253
  gsplat.lodUpdateAngle = 90;
@@ -76270,8 +76281,7 @@ class Viewer {
76270
76281
  state.readyToRender = true;
76271
76282
  // handle quality mode changes
76272
76283
  const updateLod = () => {
76273
- const settings = state.retinaDisplay ? quality.high : quality.low;
76274
- gsplat.splatBudget = settings * 1000000;
76284
+ gsplat.splatBudget = getBudget() * 1000000;
76275
76285
  gsplat.lodRangeMin = 0;
76276
76286
  gsplat.lodRangeMax = 1000;
76277
76287
  };
@@ -76600,20 +76610,6 @@ class VoxelCollider {
76600
76610
  const leafData = view.slice(metadata.nodeCount, metadata.nodeCount + metadata.leafDataCount);
76601
76611
  return new VoxelCollider(metadata, nodes, leafData);
76602
76612
  }
76603
- /**
76604
- * Query whether a world-space point lies inside a solid voxel.
76605
- *
76606
- * @param x - World X coordinate.
76607
- * @param y - World Y coordinate.
76608
- * @param z - World Z coordinate.
76609
- * @returns True if the point is inside a solid voxel.
76610
- */
76611
- queryPoint(x, y, z) {
76612
- const ix = Math.floor((x - this.gridMinX) / this.voxelResolution);
76613
- const iy = Math.floor((y - this.gridMinY) / this.voxelResolution);
76614
- const iz = Math.floor((z - this.gridMinZ) / this.voxelResolution);
76615
- return this.isVoxelSolid(ix, iy, iz);
76616
- }
76617
76613
  /**
76618
76614
  * Compute a stable surface normal at a world-space position using flatness-probability
76619
76615
  * sampling. Tests 9 candidate directions: 3 axis-aligned and 6 diagonal (45-degree in
@@ -77171,7 +77167,7 @@ class VoxelCollider {
77171
77167
  const distNegZ = cz - vMinZ;
77172
77168
  const distPosZ = vMaxZ - cz;
77173
77169
  const escapeX = distNegX < distPosX ? -(distNegX + radius) : (distPosX + radius);
77174
- const escapeY = distNegY <= distPosY ? -(distNegY + radius) : (distPosY + radius);
77170
+ const escapeY = distNegY < distPosY ? -(distNegY + radius) : (distPosY + radius);
77175
77171
  const escapeZ = distNegZ < distPosZ ? -(distNegZ + radius) : (distPosZ + radius);
77176
77172
  const absX = Math.abs(escapeX);
77177
77173
  const absY = Math.abs(escapeY);
@@ -77179,14 +77175,14 @@ class VoxelCollider {
77179
77175
  px = 0;
77180
77176
  py = 0;
77181
77177
  pz = 0;
77182
- if (absY <= absX && absY <= absZ) {
77183
- py = escapeY;
77184
- penetration = absY;
77185
- }
77186
- else if (absX <= absZ) {
77178
+ if (absX <= absY && absX <= absZ) {
77187
77179
  px = escapeX;
77188
77180
  penetration = absX;
77189
77181
  }
77182
+ else if (absY <= absZ) {
77183
+ py = escapeY;
77184
+ penetration = absY;
77185
+ }
77190
77186
  else {
77191
77187
  pz = escapeZ;
77192
77188
  penetration = absZ;
@@ -77202,24 +77198,6 @@ class VoxelCollider {
77202
77198
  }
77203
77199
  }
77204
77200
  }
77205
- // Column-based Y fallback: the per-voxel sphere test loses Y information
77206
- // when the capsule segment passes through a voxel (segY lands inside the
77207
- // AABB, zeroing dy). Recover it by finding the topmost solid voxel in the
77208
- // capsule-center column and computing a direct capsule-bottom push.
77209
- if (found && Math.abs(bestPushY) <= PENETRATION_EPSILON) {
77210
- const icx = Math.floor((cx - gridMinX) / voxelResolution);
77211
- const icz = Math.floor((cz - gridMinZ) / voxelResolution);
77212
- const capsuleBottom = segTopY + radius;
77213
- for (let iy = iyMin; iy <= iyMax; iy++) {
77214
- if (this.isVoxelSolid(icx, iy, icz)) {
77215
- const surfaceY = gridMinY + iy * voxelResolution;
77216
- if (capsuleBottom > surfaceY + PENETRATION_EPSILON) {
77217
- bestPushY = surfaceY - capsuleBottom;
77218
- }
77219
- break;
77220
- }
77221
- }
77222
- }
77223
77201
  if (found) {
77224
77202
  this._push.x = bestPushX;
77225
77203
  this._push.y = bestPushY;
@@ -78215,7 +78193,7 @@ const initXr = (global) => {
78215
78193
  });
78216
78194
  };
78217
78195
 
78218
- var version = "1.18.4";
78196
+ var version = "1.18.6";
78219
78197
 
78220
78198
  const loadGsplat = async (app, config, progressCallback) => {
78221
78199
  const { contents, contentUrl, unified, aa } = config;