@playcanvas/supersplat-viewer 1.29.1 → 1.29.3

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.1",
3
+ "version": "1.29.3",
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.1";
83310
+ var version = "1.29.3";
83311
83311
 
83312
83312
  class Tooltip {
83313
83313
  register;
@@ -90575,6 +90575,38 @@ class Viewer {
90575
90575
  return result;
90576
90576
  };
90577
90577
  });
90578
+ const { gsplat } = app.scene;
90579
+ // Scene-level gsplat params. Set before any load resolves: streaming starts on the first
90580
+ // frame after the gsplat component is created, and lodUpdateAngle / lodBehindPenalty shape
90581
+ // which nodes that first pass pulls in.
90582
+ // these two allow LOD behind camera to drop, saves lots of splats
90583
+ gsplat.lodUpdateAngle = 90;
90584
+ gsplat.lodBehindPenalty = 5;
90585
+ gsplat.minContribution = 1;
90586
+ gsplat.alphaClip = 1 / 255;
90587
+ gsplat.antiAlias = config.aa;
90588
+ // same performance, but rotating on slow devices does not give us unsorted splats on sides
90589
+ gsplat.radialSorting = true;
90590
+ // apply before streaming starts: this bakes into the work-buffer copies as
90591
+ // persistent per-splat data, so the first loaded splats must already carry
90592
+ // it (later changes only apply on a full rebuild)
90593
+ gsplat.debug = config.colorize ? GSPLAT_DEBUG_LOD : GSPLAT_DEBUG_NONE;
90594
+ // Clamp to the coarsest LOD for the fastest possible reveal. This chains off gsplatLoad
90595
+ // alone (not the Promise.all below): the octree starts streaming on the first frame after
90596
+ // the component is created, and already-requested files are never cancelled — so waiting
90597
+ // on skybox/collision here would let a full-detail burst queue up and block the reveal
90598
+ // until it has all downloaded. The handler runs as a microtask of the asset's load event,
90599
+ // so no frame renders unclamped.
90600
+ if (!config.fullload) {
90601
+ gsplatLoad.then((entity) => {
90602
+ const gsplatComponent = entity.gsplat;
90603
+ const resource = gsplatComponent.resource;
90604
+ const lodLevels = resource?.octree?.lodLevels;
90605
+ if (lodLevels) {
90606
+ gsplatComponent.lodRangeMax = gsplatComponent.lodRangeMin = lodLevels - 1;
90607
+ }
90608
+ });
90609
+ }
90578
90610
  // wait for the model to load
90579
90611
  Promise.all([gsplatLoad, skyboxLoad, collisionLoad]).then((results) => {
90580
90612
  const gsplatComponent = results[0].gsplat;
@@ -90621,7 +90653,6 @@ class Viewer {
90621
90653
  this.navCursor = new NavCursor(app, camera, collision ?? null, events, state);
90622
90654
  }
90623
90655
  this.debugPanel = new DebugPanel(global, this.cameraManager);
90624
- const { gsplat } = app.scene;
90625
90656
  // quality budget
90626
90657
  const budgets = {
90627
90658
  mobile: {
@@ -90653,26 +90684,6 @@ class Viewer {
90653
90684
  // reveal once full quality has finished loading (used for screenshots)
90654
90685
  applyPerfSettings();
90655
90686
  }
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
- // these two allow LOD behind camera to drop, saves lots of splats
90665
- gsplat.lodUpdateAngle = 90;
90666
- gsplat.lodBehindPenalty = 5;
90667
- gsplat.minContribution = 1;
90668
- gsplat.alphaClip = 1 / 255;
90669
- gsplat.antiAlias = config.aa;
90670
- // same performance, but rotating on slow devices does not give us unsorted splats on sides
90671
- gsplat.radialSorting = true;
90672
- // apply before streaming starts: this bakes into the work-buffer copies as
90673
- // persistent per-splat data, so the first loaded splats must already carry
90674
- // it (later changes only apply on a full rebuild)
90675
- gsplat.debug = config.colorize ? GSPLAT_DEBUG_LOD : GSPLAT_DEBUG_NONE;
90676
90687
  const eventHandler = app.systems.gsplat;
90677
90688
  // Once on demand (autoRender is disabled at ready, below), render when gsplat streaming
90678
90689
  // produces new data a render would show (new LOD/world-state, pending sort). This also