Playcanvas offers webGL rendering splat models using varying SH degrees; SH = 0, 1, 2, 3.
They also utilized something called morton encoding for faster sorting, I don’t know much about using spacial sorting methods in this context other than the radix sort, but it seems to work well when you don’t have access to webGPU.
1 Like
Cedric
January 22, 2025, 8:03am
2
SH is already supported with SPZ format. PLY + SH is so big it gets impractical for the web but its support can be added anyways.
I’m curious about other sorting methods(wasm impl for example). Definitely something to experiment.
2 Likes
arcman7
January 25, 2025, 12:18am
3
I’m using a certain type of compression that gets 1 million splats with SH=3 down to about 30MB. I wouldn’t say it’s impractical, although the vram usage does get heavy. Case in point:
https://realapp.colossum.io/splat-viewer.html?file=https://colossum.s3.amazonaws.com/scratchwork/splats/png_comp_test/point_cloud.zip
I’m curious about other sorting methods(wasm impl for example). Definitely something to experiment.
Here’s how they’re currently using it:
return 45;
};
const sizes = {
9: 1,
24: 2,
45: 3
};
return sizes[numProps()] ?? 0;
}
calcMortonOrder() {
const calcMinMax = (arr) => {
let min = arr[0];
let max = arr[0];
for (let i = 1; i < arr.length; i++) {
if (arr[i] < min) min = arr[i];
if (arr[i] > max) max = arr[i];
}
return { min, max };
};
normalize(f_dc_2[i], cb.min, cb.max),
1 / (1 + Math.exp(-opacity[i]))
);
}
return { px, py, pz, sx, sy, sz, cr, cg, cb };
}
}
// sort the compressed indices into morton order
const sortSplats = (splats: Splat[], indices: CompressedIndex[]) => {
// https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/
const encodeMorton3 = (x: number, y: number, z: number) : number => {
const Part1By2 = (x: number) => {
x &= 0x000003ff;
x = (x ^ (x << 16)) & 0xff0000ff;
x = (x ^ (x << 8)) & 0x0300f00f;
x = (x ^ (x << 4)) & 0x030c30c3;
x = (x ^ (x << 2)) & 0x09249249;
return x;
};
I would be interested in implementing this and seeing what performance improvements we see