This repository is a Unity implementation of Relightable 3D Gaussian: Real-time Point Cloud Relighting with BRDF Decomposition and Ray Tracing (ECCV 2024), built on top of UnityGaussianSplatting.
-
Train a relightable 3DGS asset using the upstream repository. On a 3090 Ti, this step usually takes several hours.
- Supplemental scripts for data preparation and conversion are available in
train_utils. - You can use either real-world photos or images captured from a fully synthetic scene.
- Run
COLMAPandremove_bg.pyto prepare the training data. - See
train_utils/img_to_r3dg_cmd.mdfor an example workflow. In practice, taking 100+ images from a wide range of well-lit viewpoints usually works best. - Here’s a [link][https://drive.google.com/file/d/1Ha3MQ8T2Abda9H3Jh8WYkmU9YBi5bOsq/view?usp=sharing] to four relightable gaussians I trained on Synthetic4Relight dataset.
- Supplemental scripts for data preparation and conversion are available in
-
A relightable 3DGS stores the following additional PBR-related attributes:
- Base color
- Roughness
- Incident SH
- Visibility SH
-
In Unity, import the relightable Gaussian file via
Tools -> Gaussian Splats -> Create GaussianSplatAssets.- Enable
export relight data.
- Enable
In the original implementation, visibility is computed on the fly using real-time ray tracing. In this Unity port, I bake the visibility term offline for simpler integration and better runtime performance. The baking script is available in
train_utils, although the current implementation still has known issues.
- In the Inspector, you can assign an arbitrary environment map to preview the relighting result. I also added a few heuristics to make the renderer more stable in low-light scenes.
A Gaussian chair under a pink-sky HDRI. At the moment, the HDRI affects only the Gaussian splats.
- To inspect different lighting components, edit the
GS_DEBUG_LIGHT_MODEmacro inpackage/Shaders/SplatUtilities.compute.
This image shows the baked incident SH visualized on the Gaussian splats. Because it is baked per Gaussian, it does not change under different lighting conditions.
- You can also generate a proxy mesh for the Gaussian splats, which is mainly useful for shadow casting. This is done through stride-based downsampling. In practice, a budget of around 30k primitives usually provides a reasonable approximation.
- This project uses a baked visibility term instead of the ray-traced visibility used in the original implementation, so approximation errors are expected.
- Incident SH is baked per Gaussian, so the result is not fully physically accurate.





