aras-p/UnityGaussianSplatting
Fork: 264 Star: 2277 (更新于 2024-12-18 03:39:15)
license: MIT
Language: C# .
Toy Gaussian Splatting visualization in Unity
最后发布版本: v0.9.1 ( 2024-09-23 19:55:58)
Gaussian Splatting playground in Unity
SIGGRAPH 2023 had a paper "3D Gaussian Splatting for Real-Time Radiance Field Rendering" by Kerbl, Kopanas, Leimkühler, Drettakis that is really cool! Check out their website, source code repository, data sets and so on. I've decided to try to implement the realtime visualization part (i.e. the one that takes already-produced gaussian splat "model" file) in Unity.
Everything in this repository is based on that "OG" gaussian splatting paper. Towards end of 2023, there's a ton of new gaussian splatting research coming out; none of that is in this project.
:warning: Status as of 2023 December: I'm not planning any significant further developments.
:warning: The only platforms where this is known to work are the ones that use D3D12, Metal or Vulkan graphics APIs. PC (Windows on D3D12 or Vulkan), Mac (Metal), Linux (Vulkan) should work. Anything else I have not actually tested; it might work or it might not.
- Some virtual reality devices work (reportedly HTC Vive, Varjo Aero, Quest 3 and Quest Pro). Some others might not work, e.g. Apple Vision Pro. See #17
- Anything using OpenGL or OpenGL ES: #26
- WebGPU might work someday, but seems that today it does not quite have all the required graphics features yet: #65
- Mobile may or might not work. Some iOS devices definitely do not work (#72), some Androids do not work either (#112)
Usage
Download or clone this repository, open projects/GaussianExample
as a Unity project (I use Unity 2022.3, other versions might also work),
and open GSTestScene
scene in there.
Note that the project requires DX12 or Vulkan on Windows, i.e. DX11 will not work. This is not tested at all on mobile/web, and probably does not work there.
Next up, create some GaussianSplat assets: open Tools -> Gaussian Splats -> Create GaussianSplatAsset
menu within Unity.
In the dialog, point Input PLY File
to your Gaussian Splat file (note that it has to be a gaussian splat PLY file, not some
other PLY file. E.g. in the official paper models, the correct files are under point_cloud/iteration_*/point_cloud.ply
).
Optionally there can be cameras.json
next to it or somewhere in parent folders.
Pick desired compression options and output folder, and press "Create Asset" button. The compression even at "very low" quality setting is decently usable, e.g.
this capture at Very Low preset is under 8MB of total size (click to see the video):
If everything was fine, there should be a GaussianSplat asset that has several data files next to it.
Since the gaussian splat models are quite large, I have not included any in this Github repo. The original paper github page has a a link to 14GB zip of their models.
In the game object that has a GaussianSplatRenderer
script, point the Asset field to one of your created assets.
There are various controls on the script to debug/visualize the data, as well as a slider to move game camera into one of asset's camera
locations.
The rendering takes game object transformation matrix into account; the official gaussian splat models seem to be all rotated by about -160 degrees around X axis, and mirrored around Z axis, so in the sample scene the object has such a transform set up.
Additional documentation:
That's it!
Write-ups
My own blog posts about all this:
- Gaussian Splatting is pretty cool! (2023 Sep 5)
- Making Gaussian Splats smaller (2023 Sep 13)
- Making Gaussian Splats more smaller (2023 Sep 27)
- Gaussian Explosion (2023 Dec 8)
Performance numbers:
"bicycle" scene from the paper, with 6.1M splats and first camera in there, rendering at 1200x797 resolution, at "Medium" asset quality level (282MB asset file):
- Windows (NVIDIA RTX 3080 Ti):
- Official SBIR viewer: 7.4ms (135FPS). 4.8GB VRAM usage.
- Unity, DX12 or Vulkan: 6.8ms (147FPS) - 4.5ms rendering, 1.1ms sorting, 0.8ms splat view calc. 1.3GB VRAM usage.
- Mac (Apple M1 Max):
- Unity, Metal: 21.5ms (46FPS).
Besides the gaussian splat asset that is loaded into GPU memory, currently this also needs about 48 bytes of GPU memory per splat (for sorting, caching view dependent data etc.).
License and External Code Used
The code I wrote for this is under MIT license. The project also uses several 3rd party libraries:
- zanders3/json, MIT license, (c) 2018 Alex Parker.
- "DeviceRadixSort" GPU sorting code contributed by Thomas Smith (#82).
- Virtual Reality fixes contributed by @ninjamode based on Unity-VR-Gaussian-Splatting.
However, keep in mind that the license of the original paper implementation says that the official training software for the Gaussian Splats is for educational / academic / non-commercial purpose; commercial usage requires getting license from INRIA. That is: even if this viewer / integration into Unity is just "MIT license", you need to separately consider how did you get your Gaussian Splat PLY files.
最近版本更新:(数据更新于 2024-10-07 23:19:13)
2024-09-23 19:55:58 v0.9.1
2024-02-19 16:36:01 v0.9.0
2023-11-09 16:43:46 v0.8.0
2023-10-15 02:22:44 v0.7.0
2023-10-07 03:25:48 v0.6.0
2023-10-05 02:07:29 v0.5.0
2023-10-02 03:54:51 v0.4.0
2023-09-28 02:28:48 v0.3.0
2023-09-27 21:21:46 v0.2.0
2023-09-27 21:09:57 v0.1.0
主题(topics):
gaussian-splatting, unity
aras-p/UnityGaussianSplatting同语言 C#最近更新仓库
2024-12-20 06:41:40 microsoft/PowerToys
2024-12-07 22:15:43 Pik-4/HsMod
2024-12-01 20:18:03 BililiveRecorder/BililiveRecorder
2024-11-26 14:48:43 Azure/azure-sdk-for-net
2024-11-19 11:38:46 jellyfin/jellyfin
2024-11-15 10:33:01 DigitalRuby/IPBan