@playcanvas/supersplat-viewer 1.18.3 → 1.18.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcanvas/supersplat-viewer",
3
- "version": "1.18.3",
3
+ "version": "1.18.5",
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
@@ -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
- results[0].gsplat.splatBudget = settings * 1000000;
76284
+ gsplat.splatBudget = getBudget() * 1000000;
76275
76285
  gsplat.lodRangeMin = 0;
76276
76286
  gsplat.lodRangeMax = 1000;
76277
76287
  };
@@ -78215,7 +78225,7 @@ const initXr = (global) => {
78215
78225
  });
78216
78226
  };
78217
78227
 
78218
- var version = "1.18.3";
78228
+ var version = "1.18.5";
78219
78229
 
78220
78230
  const loadGsplat = async (app, config, progressCallback) => {
78221
78231
  const { contents, contentUrl, unified, aa } = config;