-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Splat positions rendering differently after compression #356
Comments
Love this scan btw 😍 |
Thank you! I hope to build more of an interactive experience around it using playcanvas! Let me know if you have any bandwidth to help, I am an extreme novice in this kind of programming (just barely getting acquainted with the playcanvas editor platform). |
This is really weird. I looked into the compressed splat a bit but couldn't find a clue. Maybe it is related to some precision loss/rounding. Have you tried rescaling the scene a bit and compressing it? Will it create the same artifacts? |
Yes, I tried rescaling from supersplat and exporting the compressed ply both at 1/10th and 10x scale. At 1/10th there was much worse artifacting near the top (all geometry appeared weirdly thin), and at 10x it was the same. |
Also maybe interesting - if I cut just that part of the model and save it separately it does not seem to exhibit the problem. It seems like it arises in situ with the rest of the splats too. Maybe to do with the way the compression chunks the scene? I do also notice some issues in other less prominent areas, like trees. |
Hi @vincentwoo , I think I know what the issue might be, but will need some time to investigate. The compression works by:
There are a few possibilities that might explain the issue you're seeing:
Sorry I hope some of that makes sense. Basically the compress stage needs some love. Thanks! |
No, that makes perfect sense. Basically for the morton order issue you would try a different hilbert curve through the ordering space, with the aim of minimizing the bounds for each cube defined by 256 splats? Sounds like a fun puzzle, if you point me at the code for that bit I'd love to take a look. |
Awesome! Here's the sorter https://github.com/playcanvas/supersplat/blob/main/src/splat-serialize.ts#L569 |
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;
}; hahaha, should be a good time |
Playing with it a bit:
Splitting (padding) those chunks makes sense to alleviate this but I think it would require an engine change too, no? You'd need variable length chunks or a way to communicate that the chunk has dead space. I think that one might be a bit beyond me. |
I wrote a node CLI tool for creating compressed.ply yesterday and noticed a bug which might explain this. The very last chunk in the scene is almost always part-full (since chunks are 256 in size) and I realised that the remaining out-of-bounds gaussians in the last chunk will keep the values from the preceding chunk. The out-of-bounds gaussians do not get rendered or used at runtime, but their presence in the last chunk will impact the calculated bounds, which may result in lower-than-necessary precision for the remaining gaussians. I think it's a long shot, but I will fix this bug today and retest. |
Interesting. I just now tried to try writing out the compressed ply leaving off the last chunk, but still saw my oddly placed gaussians there. |
Yep didn't fix anything. The largest buckets in the scene are bigger than I thought:
So I'm going to try recursively performing morton order on buckets larger than |
I wonder if it would be helpful to like color the splats by the chunk they came in with? There must be something strange going on with that particular bucket |
Yeah, looks like the tips are sort of in-plane with some very far away splats that just happen to be on the morton curve coming in, stretching the XZ quantization for that chunk: I suppose this is one downside of having a splat that is too free of aerial floaters - the morton curve may have to jump over a lot of empty space |
But I think especially the green splats are all very close together and still off. Maybe you can create something like a percentile ~80 bounding box and look for splats that are magnitudes outside that box to eliminate them (compress them separately). Edit: Or implement some logarithmic position encoding starting from the median position of a bounding box. |
BTW we could be padding chunks with alpha 0 gaussians in these situations. |
I tried throwing a hilbert curve at it after banging my head on typescript for a half hour but it turns out pretty much exactly the same fwiw. |
I have a splat that, when compressed by supersplat, mostly looks great except for (as far as I can tell) one specific area of interest, wherein the means of the splats themselves seem to have moved. Here's a GIF comparison:
Here I'm toggling between the compressed/uncompressed plys in a scene in SuperSplat with both loaded. The tips of the towers seem to "detach" in the compressed ply.
Here are the files if you want to try to repro/inspect more closely:
https://sutro-tower.netlify.app/scene.ply
https://sutro-tower.netlify.app/scene.compressed.ply
and you can check out the viewer I rigged up at https://sutro-tower.netlify.app itself.
(I erroneously reported previously that this issue only happened in the viewer, please ignore that version of the issue)
The text was updated successfully, but these errors were encountered: