@playcanvas/supersplat-viewer 1.43.1 → 1.43.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.43.1",
3
+ "version": "1.43.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",
@@ -58,7 +58,7 @@
58
58
  "README.md"
59
59
  ],
60
60
  "peerDependencies": {
61
- "playcanvas": "^2.24.0"
61
+ "playcanvas": "^2.24.1"
62
62
  },
63
63
  "peerDependenciesMeta": {
64
64
  "playcanvas": {
@@ -73,7 +73,7 @@
73
73
  "autoprefixer": "10.6.2",
74
74
  "concurrently": "9.2.5",
75
75
  "eslint": "9.39.5",
76
- "playcanvas": "2.24.0",
76
+ "playcanvas": "2.24.1",
77
77
  "postcss": "8.5.32",
78
78
  "prettier": "3.9.10",
79
79
  "publint": "0.3.25",
package/public/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const TRACEID_GPU_TIMINGS = "GpuTimings";
2
2
 
3
- const version$1 = "2.24.0";
4
- const revision = "0d07e10";
3
+ const version$1 = "2.24.1";
4
+ const revision = "8597cab";
5
5
  function extend(target, ex) {
6
6
  for (const prop in ex) {
7
7
  const copy = ex[prop];
@@ -11948,9 +11948,20 @@ var webgpu_clear_default = `
11948
11948
  output.position = vec4(pos[vertexIndex], ubMesh.depth, 1.0);
11949
11949
  return output;
11950
11950
  }
11951
+ struct FragmentOutput {
11952
+ @location(0) color0 : vec4f,
11953
+ @location(1) color1 : vec4f,
11954
+ @location(2) color2 : vec4f,
11955
+ @location(3) color3 : vec4f,
11956
+ @location(4) color4 : vec4f,
11957
+ @location(5) color5 : vec4f,
11958
+ @location(6) color6 : vec4f,
11959
+ @location(7) color7 : vec4f
11960
+ }
11951
11961
  @fragment
11952
- fn fragmentMain() -> @location(0) vec4f {
11953
- return ubMesh.color;
11962
+ fn fragmentMain() -> FragmentOutput {
11963
+ let color = ubMesh.color;
11964
+ return FragmentOutput(color, color, color, color, color, color, color, color);
11954
11965
  }
11955
11966
  `;
11956
11967
 
@@ -41141,10 +41152,10 @@ class GSplatSogIterator {
41141
41152
  const { means, scales, sh0, shN } = meta;
41142
41153
  const v3 = meta.version === 3;
41143
41154
  const codebooks = meta.version >= 2;
41144
- const means_l_data = (p || r && v3) && data.means_l._levels[0];
41145
- const means_u_data = (p || r && v3) && data.means_u._levels[0];
41146
- const quats_data = r && !v3 && data.quats._levels[0];
41147
- const scales_data = (s || r && v3) && data.scales._levels[0];
41155
+ const means_l_data = p && data.means_l._levels[0];
41156
+ const means_u_data = p && data.means_u._levels[0];
41157
+ const quats_data = r && data.quats._levels[0];
41158
+ const scales_data = s && data.scales._levels[0];
41148
41159
  const sh0_data = c && data.sh0._levels[0];
41149
41160
  const sh_labels_data = sh && data.sh_labels._levels[0];
41150
41161
  const sh_centroids_data = sh && data.sh_centroids._levels[0];
@@ -41161,9 +41172,9 @@ class GSplatSogIterator {
41161
41172
  p.z = Math.sign(nz) * (Math.exp(Math.abs(nz)) - 1);
41162
41173
  }
41163
41174
  if (r && v3) {
41164
- const px = (means_l_data[i * 4 + 3] - 128) / 127;
41165
- const py = (means_u_data[i * 4 + 3] - 128) / 127;
41166
- const pz = (scales_data[i * 4 + 3] - 128) / 127;
41175
+ const px = (quats_data[i * 4 + 0] - 128) / 127;
41176
+ const py = (quats_data[i * 4 + 1] - 128) / 127;
41177
+ const pz = (quats_data[i * 4 + 2] - 128) / 127;
41167
41178
  const len = Math.sqrt(px * px + py * py + pz * pz);
41168
41179
  const t = len * Math.PI * 0.5;
41169
41180
  const k = len > 1e-12 ? Math.sin(t) / len : Math.PI * 0.5;
@@ -41346,7 +41357,7 @@ class GSplatSogData {
41346
41357
  const { means_l, means_u, quats, scales, sh0, sh_labels, sh_centroids } = this;
41347
41358
  means_l._levels[0] = await readImageDataAsync(means_l);
41348
41359
  means_u._levels[0] = await readImageDataAsync(means_u);
41349
- if (quats) quats._levels[0] = await readImageDataAsync(quats);
41360
+ quats._levels[0] = await readImageDataAsync(quats);
41350
41361
  scales._levels[0] = await readImageDataAsync(scales);
41351
41362
  sh0._levels[0] = await readImageDataAsync(sh0);
41352
41363
  if (shBands > 0) {
@@ -41613,16 +41624,13 @@ class GSplatSogResource extends GSplatResourceBase {
41613
41624
  super(device, gsplatData, options);
41614
41625
  const { meta, means_l } = gsplatData;
41615
41626
  const isV2 = meta.version >= 2;
41616
- const isV3 = meta.version === 3;
41617
41627
  const hasSH = gsplatData.shBands > 0;
41618
41628
  if (means_l) {
41619
41629
  this.streams.textureDimensions.set(means_l.width, means_l.height);
41620
41630
  }
41621
41631
  this.streams.textures.set("means_l", gsplatData.means_l);
41622
41632
  this.streams.textures.set("means_u", gsplatData.means_u);
41623
- if (!isV3) {
41624
- this.streams.textures.set("quats", gsplatData.quats);
41625
- }
41633
+ this.streams.textures.set("quats", gsplatData.quats);
41626
41634
  this.streams.textures.set("scales", gsplatData.scales);
41627
41635
  this.streams.textures.set("sh0", gsplatData.sh0);
41628
41636
  if (hasSH) {
@@ -41638,7 +41646,7 @@ class GSplatSogResource extends GSplatResourceBase {
41638
41646
  const streams = [
41639
41647
  { name: "means_l", format: PIXELFORMAT_RGBA8 },
41640
41648
  { name: "means_u", format: PIXELFORMAT_RGBA8 },
41641
- ...isV3 ? [] : [{ name: "quats", format: PIXELFORMAT_RGBA8 }],
41649
+ { name: "quats", format: PIXELFORMAT_RGBA8 },
41642
41650
  { name: "scales", format: PIXELFORMAT_RGBA8 },
41643
41651
  { name: "sh0", format: PIXELFORMAT_RGBA8 }
41644
41652
  ];
@@ -70917,11 +70925,7 @@ vec3 getCenter() {
70917
70925
  }
70918
70926
  #if SOG_VERSION >= 3
70919
70927
  vec4 getRotation() {
70920
- vec3 b = floor(vec3(
70921
- texelFetch(means_l, splat.uv, 0).w,
70922
- texelFetch(means_u, splat.uv, 0).w,
70923
- texelFetch(scales, splat.uv, 0).w
70924
- ) * 255.0 + 0.5);
70928
+ vec3 b = floor(texelFetch(quats, splat.uv, 0).xyz * 255.0 + 0.5);
70925
70929
  vec3 p = (b - 128.0) / 127.0;
70926
70930
  float len = length(p);
70927
70931
  float t = len * 1.5707963267948966;
@@ -72225,11 +72229,7 @@ fn getCenter() -> vec3f {
72225
72229
  }
72226
72230
  #if SOG_VERSION >= 3
72227
72231
  fn getRotation() -> vec4f {
72228
- let b = floor(vec3f(
72229
- textureLoad(means_l, splat.uv, 0).w,
72230
- textureLoad(means_u, splat.uv, 0).w,
72231
- textureLoad(scales, splat.uv, 0).w
72232
- ) * 255.0 + 0.5);
72232
+ let b = floor(textureLoad(quats, splat.uv, 0).xyz * 255.0 + 0.5);
72233
72233
  let p = (b - 128.0) / 127.0;
72234
72234
  let len = length(p);
72235
72235
  let t = len * 1.5707963267948966;
@@ -76977,7 +76977,7 @@ class SogBundleParser {
76977
76977
  data.numSplats = meta.count;
76978
76978
  data.means_l = textures[meta.means.files[0]].resource;
76979
76979
  data.means_u = textures[meta.means.files[1]].resource;
76980
- data.quats = meta.quats ? textures[meta.quats.files[0]].resource : null;
76980
+ data.quats = textures[meta.quats.files[0]].resource;
76981
76981
  data.scales = textures[meta.scales.files[0]].resource;
76982
76982
  data.sh0 = textures[meta.sh0.files[0]].resource;
76983
76983
  data.sh_centroids = textures[meta.shN?.files[0]]?.resource;
@@ -77170,7 +77170,7 @@ class SogParser {
77170
77170
  data.numSplats = meta.count;
77171
77171
  data.means_l = textures.means[0].resource;
77172
77172
  data.means_u = textures.means[1].resource;
77173
- data.quats = textures.quats[0]?.resource ?? null;
77173
+ data.quats = textures.quats[0].resource;
77174
77174
  data.scales = textures.scales[0].resource;
77175
77175
  data.sh0 = textures.sh0[0].resource;
77176
77176
  data.sh_centroids = textures.shN?.[0]?.resource;
@@ -95968,11 +95968,10 @@ class DirectSplatSource {
95968
95968
  device.computeDispatch([compute], 'sse-splat-decode-sh');
95969
95969
  this.decodedSH.set(resource, { texture, compute });
95970
95970
  }
95971
- // the packed layout applies to sog v2 files, the only ones the repack reads. The engine gives
95972
- // sog v3 files a codebook too, but no quats texture: their rotation is in the alpha channels
95971
+ // the packed layout applies to sog v2 files, the only ones the repack reads. Sog v3 files have
95972
+ // the same textures, but a different rotation and opacity encoding and 24-bit sh labels
95973
95973
  packedActive() {
95974
- const textures = this.resource?.streams.textures;
95975
- return !!textures && textures.has('sogCodebook') && textures.has('quats');
95974
+ return this.resource?.gsplatData?.meta?.version === 2;
95976
95975
  }
95977
95976
  hasSH() {
95978
95977
  const textures = this.resource?.streams.textures;
@@ -99268,7 +99267,7 @@ const importSettings = (settings) => {
99268
99267
  return result;
99269
99268
  };
99270
99269
 
99271
- var version = "1.43.1";
99270
+ var version = "1.43.2";
99272
99271
 
99273
99272
  class Tooltip {
99274
99273
  register;