@playcanvas/supersplat-viewer 1.29.0 → 1.29.2

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.29.0",
3
+ "version": "1.29.2",
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.js CHANGED
@@ -83307,7 +83307,7 @@ const importSettings = (settings) => {
83307
83307
  return result;
83308
83308
  };
83309
83309
 
83310
- var version = "1.29.0";
83310
+ var version = "1.29.2";
83311
83311
 
83312
83312
  class Tooltip {
83313
83313
  register;
@@ -90575,6 +90575,22 @@ class Viewer {
90575
90575
  return result;
90576
90576
  };
90577
90577
  });
90578
+ // Clamp to the coarsest LOD for the fastest possible reveal. This chains off gsplatLoad
90579
+ // alone (not the Promise.all below): the octree starts streaming on the first frame after
90580
+ // the component is created, and already-requested files are never cancelled — so waiting
90581
+ // on skybox/collision here would let a full-detail burst queue up and block the reveal
90582
+ // until it has all downloaded. The handler runs as a microtask of the asset's load event,
90583
+ // so no frame renders unclamped.
90584
+ if (!config.fullload) {
90585
+ gsplatLoad.then((entity) => {
90586
+ const gsplatComponent = entity.gsplat;
90587
+ const resource = gsplatComponent.resource;
90588
+ const lodLevels = resource?.octree?.lodLevels;
90589
+ if (lodLevels) {
90590
+ gsplatComponent.lodRangeMax = gsplatComponent.lodRangeMin = lodLevels - 1;
90591
+ }
90592
+ });
90593
+ }
90578
90594
  // wait for the model to load
90579
90595
  Promise.all([gsplatLoad, skyboxLoad, collisionLoad]).then((results) => {
90580
90596
  const gsplatComponent = results[0].gsplat;
@@ -90642,7 +90658,7 @@ class Viewer {
90642
90658
  return state.performanceMode ? quality.low : quality.high;
90643
90659
  };
90644
90660
  gsplat.splatBudget = budget() * 1000000;
90645
- gsplat.colorUpdateAngle = state.performanceMode ? 2 : 0;
90661
+ gsplat.colorUpdateAngle = state.performanceMode ? 1 : 0.2;
90646
90662
  gsplatComponent.lodRangeMin = 0;
90647
90663
  gsplatComponent.lodRangeMax = 1000;
90648
90664
  // request a frame so the param changes are processed (full work-buffer
@@ -90653,14 +90669,6 @@ class Viewer {
90653
90669
  // reveal once full quality has finished loading (used for screenshots)
90654
90670
  applyPerfSettings();
90655
90671
  }
90656
- else {
90657
- // reveal once low lod has loaded for fastest possible reveal
90658
- const resource = results[0].gsplat.resource;
90659
- const lodLevels = resource?.octree?.lodLevels;
90660
- if (lodLevels) {
90661
- gsplatComponent.lodRangeMax = gsplatComponent.lodRangeMin = lodLevels - 1;
90662
- }
90663
- }
90664
90672
  // these two allow LOD behind camera to drop, saves lots of splats
90665
90673
  gsplat.lodUpdateAngle = 90;
90666
90674
  gsplat.lodBehindPenalty = 5;