Turn 3D Gaussian Splat Files into Stunning Assets in Unity 6
![Turn 3D Gaussian Splat Files into Stunning Assets in Unity 6](/blog/assets/images/GS3.png)
This guide walks you through the process of loading splat files in Unity 6 using the Gaussian Splatting Playground Unity plugin. By the end of this tutorial, you’ll be able to load splat files, visualize them, and experiment with Gaussian Splatting parameters in Unity.
Prerequisites
-
Unity 6 Installed: Ensure Unity 6 is installed on your system.
-
Gaussian Splatting Playground Plugin: Download and integrate the plugin into your Unity project. You can usually find this plugin in the Unity Asset Store or from GitHub.
-
A Splat File: Have a
.splat
file ready for visualization. This file contains point cloud or splat data. The original paper GitHub has a Models to 14GB zip of their models.
Step 2: Converting a Splat File to Unity Asset
To use a splat file effectively in Unity, it’s best to convert it into a Unity-compatible asset.
- Open the Gaussian Splat Asset Creation Tool:
- Go to Tools > Gaussian Splats > Create GaussianSplatAsset in the Unity menu.
- Configure the Asset Conversion:
- Input PLY File: Point this field to your Gaussian Splat
.ply
file.- Note: Ensure the file is a Gaussian Splat
.ply
file. For official paper models, these files are typically located underpoint_cloud/iteration_*/point_cloud.ply
.
- Note: Ensure the file is a Gaussian Splat
- Optional Camera Configuration: If you have a
cameras.json
file, place it next to the.ply
file or in a parent directory. This can enhance how the splats are rendered.
- Input PLY File: Point this field to your Gaussian Splat
- Select Compression Options:
- Choose the desired compression level based on your needs:
- Very Low: Compresses assets significantly while retaining decent quality.
- Example: A model compressed at “Very Low” results in an asset size of under 8MB, suitable for many applications.
- Choose the desired compression level based on your needs:
- Choose Output Folder:
- Specify where the converted asset will be saved in your Unity project.
- Create the Asset:
- Press the Create Asset button. Unity will process the
.ply
file and generate a GaussianSplat asset ready for use.
- Press the Create Asset button. Unity will process the
Step 3: Loading and Rendering the Asset
- Add a Gaussian Splat Renderer:
- Create an empty GameObject in the Hierarchy and name it
GaussianSplatRenderer
. - Attach the
GaussianSplatRenderer
component from the plugin.
- Create an empty GameObject in the Hierarchy and name it
- Assign the Asset:
- Drag and drop the newly created GaussianSplat asset into the
GaussianSplatRenderer
’s Splat Asset field in the Inspector.
- Drag and drop the newly created GaussianSplat asset into the
- Customize Rendering Settings:
- Adjust parameters such as:
- Splat Size: Controls the size of splats.
- Color Blending: Defines how overlapping splats blend.
- Adjust parameters such as:
- Run the Scene:
- Press Play to visualize your Gaussian Splats in the Unity scene.
Step 4: Experiment with Rendering Options
- Gaussian Falloff:
- Tweak the falloff function for splats in the shader or Inspector to achieve desired effects.
- Debug Tools:
- Use built-in debug options to visualize bounding boxes, normals, or splat points for better understanding and optimization.
- Optimize Performance:
- LOD: Implement Level of Detail (LOD) systems for large datasets.
- GPU Instancing: Enable GPU instancing for improved performance.
Next Steps
- Try Different Data Sets: Load various splat files to explore their visual potential.
- Customize Shaders: Modify the Gaussian Splatting shaders for unique effects.
- Share Your Work: Build and deploy your project to share interactive visualizations.
Let us know how Gaussian Splatting transforms your Unity projects! 🌟
References
-
Unity Plugin for Gaussian Splatting
The official Unity Gaussian Splatting plugin repository by Aras Pranckevičius:
https://github.com/aras-p/UnityGaussianSplatting -
3D Gaussian Splatting for Real-Time Radiance Field Rendering
Explore the original implementation and research on Gaussian Splatting:
https://github.com/graphdeco-inria/gaussian-splatting