Every splat is one item of the vertex element. This page lists its
properties in the order the 2D Gaussian Splatting code writes them, and how a renderer
turns each into part of a disc. The names and order come from
construct_list_of_attributes and save_ply in that code’s
scene/gaussian_model.py; the layout is the one of the
3D layout with a scale property fewer.
The vertex record
All properties are float (IEEE 754 single precision, 4 bytes). The
offsets are for spherical harmonics of degree 3; for degree d there are
3 × ((d + 1)² − 1) f_rest properties: 0, 9, 24 or 45.
| Offset | Property | Stored value | Used as |
|---|---|---|---|
| +0 | x, y, z | Centre | As stored |
| +12 | nx, ny, nz | Normal | Not used; always written as 0 |
| +24 | f_dc_0 to f_dc_2 | Degree 0 spherical harmonics, red, green, blue | Base colour: 0.5 + SH_C0 × value |
| +36 | f_rest_0 to f_rest_44 | Degree 1 to 3 spherical harmonics | Added to the colour for the viewing direction |
| +216 | opacity | Opacity before the sigmoid (a logit) | 1 / (1 + e−value) |
| +220 | scale_0, scale_1 | Natural logarithm of each radius | evalue |
| +228 | rot_0 to rot_3 | Rotation quaternion w, x, y, z, not normalised | Divided by its length |
As in the 3D layout, the file stores the values the optimiser works on. The code
names the functions in setup_functions: torch.exp for the
scales, torch.sigmoid for the opacity and
torch.nn.functional.normalize for the rotation.
Position
x, y and z are the centre of the disc, in the
coordinate system of the camera poses the scene was trained from, as in the 3D
layout.
Base colour: f_dc
f_dc_0 to f_dc_2 are the degree 0 spherical harmonics
coefficients of red, green and blue, and the colour starts from
0.5 + SH_C0 × f_dc with SH_C0 =
0.28209479177387814, exactly as in the 3D layout.
Spherical harmonics: f_rest
The f_rest properties hold the coefficients above degree 0, channel by
channel (all of red, then green, then blue), in the same order and with the same
counts as in the 3D layout: 9, 24 or 45 for degree 1, 2 or 3. The loader checks that
the count is 3 × ((d + 1)² − 1). The basis functions are listed on the
3D page; they do not depend on the
shape of the splat.
Opacity
opacity is a logit, and the opacity is its sigmoid
1 / (1 + e−v), from 0 to 1, as in the 3D layout.
Scale
scale_0 and scale_1 are the natural logarithms of the
disc’s standard deviations along its first two axes: the radius along axis i
is escale_i. There is no scale_2: the
code creates the array with two columns (it repeats the initial scale twice), and
writes the array as it is. When it builds the splat’s transform it appends a third
scale of 1, so the third axis, the disc’s normal, has no scale of its own.
Rotation
rot_0 to rot_3 are a quaternion with the real part first,
w, x, y, z, not stored at unit length: a
reader divides them by their length. The first two columns of the rotation matrix are
the directions of the disc’s two axes, which the two scales stretch, and the third
column is the disc’s normal. The matrix is the same as in the
3D layout.
A complete header
ply
format binary_little_endian 1.0
element vertex 300000
property float x
property float y
property float z
property float nx
property float ny
property float nz
property float f_dc_0
property float f_dc_1
property float f_dc_2
property float f_rest_0
…
property float f_rest_44
property float opacity
property float scale_0
property float scale_1
property float rot_0
property float rot_1
property float rot_2
property float rot_3
end_header
f_rest_1 to f_rest_43 left out here. The binary data
follows, 244 bytes a splat. The only difference from the 3D header is the missing
scale_2.