@playcanvas/supersplat-viewer 1.10.0 → 1.10.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/dist/index.js +1 -1
- package/package.json +1 -1
- package/public/index.js +28 -12
- package/public/index.js.map +1 -1
package/package.json
CHANGED
package/public/index.js
CHANGED
|
@@ -102102,7 +102102,10 @@ class Viewer {
|
|
|
102102
102102
|
updateHorizontalFov();
|
|
102103
102103
|
// handle HQ mode changes
|
|
102104
102104
|
const updateHqMode = () => {
|
|
102105
|
-
|
|
102105
|
+
// keep resolution under 4k on desktop and HD on mobile
|
|
102106
|
+
const maxRatio = (platform.mobile ? 1920 : 3024) / Math.max(screen.width, screen.height);
|
|
102107
|
+
// half pixel resolution with hq mode disabled
|
|
102108
|
+
graphicsDevice.maxPixelRatio = (state.hqMode ? 1.0 : 0.5) * Math.min(maxRatio, window.devicePixelRatio);
|
|
102106
102109
|
app.renderNextFrame = true;
|
|
102107
102110
|
};
|
|
102108
102111
|
events.on('hqMode:changed', updateHqMode);
|
|
@@ -102227,20 +102230,33 @@ class Viewer {
|
|
|
102227
102230
|
else {
|
|
102228
102231
|
const { gsplat } = app.scene;
|
|
102229
102232
|
// quality ranges
|
|
102230
|
-
const
|
|
102231
|
-
|
|
102232
|
-
|
|
102233
|
-
|
|
102233
|
+
const ranges = {
|
|
102234
|
+
mobile: {
|
|
102235
|
+
low: {
|
|
102236
|
+
range: [2, 8],
|
|
102237
|
+
splatBudget: 1
|
|
102238
|
+
},
|
|
102239
|
+
high: {
|
|
102240
|
+
range: [1, 8],
|
|
102241
|
+
splatBudget: 2
|
|
102242
|
+
}
|
|
102234
102243
|
},
|
|
102235
|
-
|
|
102236
|
-
|
|
102237
|
-
|
|
102244
|
+
desktop: {
|
|
102245
|
+
low: {
|
|
102246
|
+
range: [1, 8],
|
|
102247
|
+
splatBudget: 3
|
|
102248
|
+
},
|
|
102249
|
+
high: {
|
|
102250
|
+
range: [0, 8],
|
|
102251
|
+
splatBudget: 6
|
|
102252
|
+
}
|
|
102238
102253
|
}
|
|
102239
102254
|
};
|
|
102255
|
+
const quality = platform.mobile ? ranges.mobile : ranges.desktop;
|
|
102240
102256
|
// start in low quality mode so we can get user interacting asap
|
|
102241
102257
|
gsplat.lodRangeMin = quality.low.range[0];
|
|
102242
102258
|
gsplat.lodRangeMax = quality.low.range[1];
|
|
102243
|
-
gsplat.splatBudget = quality.low.splatBudget * 1000000;
|
|
102259
|
+
results[0].gsplat.splatBudget = quality.low.splatBudget * 1000000;
|
|
102244
102260
|
// these two allow LOD behind camera to drop, saves lots of splats
|
|
102245
102261
|
gsplat.lodUpdateAngle = 90;
|
|
102246
102262
|
gsplat.lodBehindPenalty = 5;
|
|
@@ -102261,7 +102277,7 @@ class Viewer {
|
|
|
102261
102277
|
const settings = state.hqMode ? quality.high : quality.low;
|
|
102262
102278
|
gsplat.lodRangeMin = settings.range[0];
|
|
102263
102279
|
gsplat.lodRangeMax = settings.range[1];
|
|
102264
|
-
gsplat.splatBudget = settings.splatBudget * 1000000;
|
|
102280
|
+
results[0].gsplat.splatBudget = settings.splatBudget * 1000000;
|
|
102265
102281
|
};
|
|
102266
102282
|
events.on('hqMode:changed', updateLod);
|
|
102267
102283
|
updateLod();
|
|
@@ -102895,7 +102911,7 @@ const initXr = (global) => {
|
|
|
102895
102911
|
});
|
|
102896
102912
|
};
|
|
102897
102913
|
|
|
102898
|
-
var version = "1.10.
|
|
102914
|
+
var version = "1.10.2";
|
|
102899
102915
|
|
|
102900
102916
|
const loadGsplat = async (app, config, progressCallback) => {
|
|
102901
102917
|
const { contents, contentUrl, unified, aa } = config;
|
|
@@ -102959,7 +102975,7 @@ const main = (app, camera, settingsJson, config) => {
|
|
|
102959
102975
|
const events = new EventHandler();
|
|
102960
102976
|
const state = observe(events, {
|
|
102961
102977
|
readyToRender: false,
|
|
102962
|
-
hqMode:
|
|
102978
|
+
hqMode: true,
|
|
102963
102979
|
progress: 0,
|
|
102964
102980
|
inputMode: 'desktop',
|
|
102965
102981
|
cameraMode: 'orbit',
|