Skip to content

About

Gaussian Splatting visualization for Unity

Topics

Resources

Stars

3.5k stars

Watchers

58 watching

Forks

Latest commit

 

History

377 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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! Here's my visualizer / renderer of 3DGS for Unity.

Screenshot

Everything in this repository is based on that original 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.

⚠️ Status as of 2026 November: I'm not planning any significant further development.

⚠️ 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 reportedly 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 (BiRP, 2022.3), projects/GaussianExample-URP (URP, 6000.0) or projects/GaussianExample-HDRP (HDRP, 6000.0) as a Unity project, and open GSTestScene scene in there. These should also work in Unity versions 6000.3, 6000.6 and 7000.0; perhaps some others too.

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.

Put a gaussian splat .ply or .spz file under Assets/StreamingAssets (for example, Assets/StreamingAssets/bicycle.ply). Have a GameObject with GaussianSplatRenderer component, and drag the file onto the PLY / SPZ field. StreamingAssets is convenient because files under that will automatically get included into player builds; the GaussianSplatRenderer source file path can be relative to streaming assets, current working directory, absolute filesystem path, or a URL.

Add a GaussianSplatRenderingOptions component to any GameObject to change global rendering options (transparency method, temporal filtering, debug render mode and SH-only display). Sorted Blended is the default. Stochastic uses noisy alpha testing and depth writes without sorting; and can use several temporal filtering methods. Without an options component, defaults are used.

Currently two file formats are supported:

  • PLY format from the original 3DGS paper (in the official paper models, the correct files are under point_cloud/iteration_*/point_cloud.ply). It needs to be binary PLY file, with all splat related properties being regular floats.
  • Scaniverse SPZ format; versions 1-4, with SH degrees 0-3. Antialiased files load with a warning; SPZ extensions are not supported.

Optionally there can be a [basename].json file next to the PLY/SPZ file (e.g. garden.json for garden.ply), describing cameras, in format from the original paper. The inspector's Cameras selector then moves the main camera relative to the splat object.

Additional documentation:

That's it!

Write-ups

My own blog posts about all this:

Performance numbers:

"bicycle" scene from the paper, with 6.1M splats and first camera, rendering at 1200x797 resolution:

  • Windows (NVIDIA RTX 3080 Ti):
    • Official SBIR viewer: 7.4ms (135FPS). 4.8GB VRAM usage.
    • Unity, DX12 or Vulkan: 6.3ms (158FPS) - 4.5ms rendering, 0.9ms sorting, 0.5ms splat view calc.
  • Mac (Apple M4 Max):
    • Unity, Metal: 12.8ms (78FPS).

At runtime, memory usage is 28 bytes per splat without SH, or 36/48/60 bytes for SH degrees 1/2/3 respectively. Besides this source data, rendering needs 44 bytes of GPU memory per splat in sorted blended mode, or 28 bytes in stochastic mode.

License and External Code Used

The code I wrote for this is under MIT license. The project also uses several 3rd party libraries:

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.

About

Gaussian Splatting visualization for Unity

Topics

Resources

Stars

3.5k stars

Watchers

58 watching

Forks

Releases

Contributors

Languages