GBake bakes light probes from 3D Gaussian Splat models. Given a trained Gaussian Splat scene (as a .ply file), it places a grid of probes throughout the scene and renders a cubemap from each probe position. The output is a set of cross-layout cubemap PNG images and a JSON file mapping each probe's 3D position to its cubemap — ready to be consumed by a game engine for real-time lighting.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtGBake has two rendering backends. The default (bake_raytrace.py) uses 3D-GRT (threedgrut). Install it separately and place this repo alongside it so that the assets symlink (../3dgrut/assets) resolves correctly:
parent_dir/
├── 3dgrut/ # install 3D-GRT here
└── gbake/ # this repo
The alternative backend (bake_splat.py) uses gsplat, which is included in requirements.txt.
python bake_raytrace.py --ply_file path/to/scene.ply --n_per_axis 5 --cubemap_resolution 800| Argument | Default | Description |
|---|---|---|
--ply_file |
hotdog/hotdog_ns.ply |
Path to the input .ply file |
--n_per_axis |
5 |
Grid density per axis (5 → 125 probes) |
--cubemap_resolution / --res |
800 |
Resolution of each cubemap face in pixels |
python bake_splat.py --ply_file path/to/scene.ply --output_dir path/to/output --n_per_axis 10| Argument | Default | Description |
|---|---|---|
--ply_file |
(required) | Path to the input .ply file |
--output_dir |
(required) | Directory to write cubemaps and JSON |
--n_per_axis |
10 |
Grid density per axis |
--overlap |
0 |
Face overlap in degrees |
GBake expects a trained Gaussian Splat model exported as a .ply. The primary workflow is to train with 3D-GRT and use its exported PLY directly with bake_raytrace.py. Alternatively, train with NeRF Studio (splatfacto) and export with ns-export gaussian-splat --ply-color-mode rgb for use with bake_splat.py.
Each probe produces one cubemap image saved as a cross-layout PNG (4 faces wide × 3 faces tall):
[Top ]
[Left][Front ][Right][Back]
[Bottom]
All probe positions and cubemap paths are written to a *_probe_data.json file in the output directory:
{
"probes": [
{
"index": 0,
"position": [x, y, z],
"cubemap": "Assets/ProbeData/Cubemaps/scene_0.png"
}
]
}