-
Notifications
You must be signed in to change notification settings - Fork 210
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
Support "antialiased" splats #142
Comments
This seems like it would be a good feature to have, but I'm not sure how best to integrate it. Specifically I'd like to avoid having to specify a parameter when loading a file to indicate whether it is an "anti-aliased" or "classic" splat. Ideally that information would be encoded into the file itself -- Does the Nerfstudio code support that? As for updating my viewer, it looks like it would be super easy, in fact the authors of the mip-splatting work created a web viewer (based on mine) for that purpose, and it looks like they just made a small update to the vertex shader in
|
@mkkellogg thanks for the quick response! Alas this is not encoded in the exported PLY file, and the format itself makes it impractical. Until we have #47 where such metadata would be easy to store and retrieve, I'm afraid we're stuck with a parameter that needs to be specified manually. |
Hello, I want to fork this repo and add this code, but I don't know where to put the code:
Anyway, If we apply antialiased method for all PLY. May it broken any PLY that created from other software? (Inria 3DGS, Luma, Polycam, OpenSplat, etc) ? |
I am the author of antialiasing mode of splatfacto , the code change needed to support web viewer is small (but slightly different from mipsplatting). https://github.com/nerfstudio-project/gsplat/blob/main/gsplat/_torch_impl.py#L188 Currently it is not possible to store any metadata in PLY format. Any suggestions for us to move forward? For short term, it makes sense to have a keyboard hotkey to toggle between classic and antialiasing mode. |
For my viewer, I think it makes sense to add a parameter to the |
Sounds good to me. Let me know if you have any confusion about how to compute opacity compensation factor. I can help double check the code change you made. |
@jb-ye: if @mkkellogg is OK with it, maybe you could provide a demo file as well? The backpack model from nerfstudio-project/gsplat#140 makes for a really compelling argument for this feature, and it would make testing easier. |
@jb-ye It would definitely be helpful if you could provide a demo file. Then I can take a stab at implementing the computation for the opacity compensation factor. |
Will do so when I got time this week. @bchretien @mkkellogg |
https://drive.google.com/file/d/19e0iAsoc9F26ilM4s6g0Y6n0n9-WRjV5/view?usp=drive_link Left: classic mode rendering of antialiased asset; Right: antialiased mode |
@jb-ye Thanks! I'll try to make the update in the next couple of days and let you know when it's ready. |
@jb-ye Would you be able to share the |
@mkkellogg What do you mean by |
Well I noticed that using the standard calculation for focal length using Three.js projection matrix is producing sub-optimal results in terms of render quality (subjective for sure), so I thought I'd play around with them to see if I can get better results by matching the training camera parameters. |
Just want to double check your formula implemented. Here is the reference implementation from splatfacto/gsplat lib, where blurring kernel is 0.3 pixel and compensation is clamped instead of adding a tiny round-off eps. This is different from the one used by mip-splatting.
Here is the training camera:
Also spherical harmonics are used for rendering. |
Yep that's that math I'm using. I got something working that I think looks pretty good: I used this code in the shader:
|
Fantastic |
Thank you for your help on this! |
That is a great news ! Can't wait to test it ! |
This is now officially supported in this release: https://github.com/mkkellogg/GaussianSplats3D/releases/tag/v0.3.6 |
@mkkellogg thanks if you want to use half precision to store covariance, you would notice some quality loss for antialiasing mode. The fix is instead of saving the covariance in half precision, saving its Cholesky decomposition in half precision, and multiple it back to get the full covariance of full precision at usage time. |
@gonzalle did you observe similar issue in nerfstudio viewer? I think it might relate to spherical harmonics not used in the web viewer. |
Indeed ! |
Maybe try to reduce directional lights during capture, use more ambient lighting |
@gonzalle Would you be willing to share your model? Maybe I can do some troubleshooting on my end. |
Certainly, I just have to train again my model... |
aa_weird.zip You'll have to turn around the model to display the good face , then go further from it to see the issue. |
So I have also noticed this issue, and I don't know exactly what is happening but it does seem like it's caused by splats that are much bigger than the other splats in the scene. I added a super hacky viewer parameter called
The default value for |
Great, I will try that. Thanks a lot ! |
Hi!
First of all, thanks for the project and kudos for the code quality and the comments (e.g. in
SplatMesh.js
). I was checking your viewer after playing around with Nerfstudio. I enabled the new "antialiasing" version of their rasterizer (see motivation here and integration in Nerfstudio there), but the problem is that it requires explicit support in viewers down the line. To summarize, a compensation factor would need to be computed in the vertex shader and applied to the gaussian opacities.Would that feature be in the scope of this project? If it is, I could provide a PR. Since rasterization is done differently in this viewer, I guess the compensation would need to be applied to
vColor.a
directly?The text was updated successfully, but these errors were encountered: