Introduction
2D Gaussian Splatting replaces the 3D ellipsoids of 3D Gaussian Splatting with flat, oriented discs, so that the scene has a well-defined surface and a mesh can be extracted from it. The training code is a modified copy of the 3D code, and it saves a scene as a PLY file in the same way: one vertex a splat, with the same property names.
The one difference is in the scales. A disc has two radii and no thickness, so the
code’s scale array has two columns and the file has scale_0 and
scale_1 and no scale_2. A reader that expects the 3D layout
refuses such a file, or reads the next property as the missing scale.
Structure
The file is a PLY file with a text header and binary
data, written by save_ply with the plyfile library. The
header declares one element, vertex, whose properties are all
float. With spherical harmonics of degree 3 there are 61 properties,
244 bytes a splat.
0Headerply,format binary_little_endian 1.0,element vertexn, the property lines,end_headertext…Splats one vertex each244 bytes each at degree 3+0x y z position12 bytes+12nx ny nz normal, written as zero12 bytes+24f_dc_0 to f_dc_2 base colour coefficients12 bytes+36f_rest_0 to f_rest_44 higher spherical harmonics180 bytes+216opacity before the sigmoid4 bytes+220scale_0, scale_1 log radii of the disc8 bytes+228rot_0 to rot_3 quaternion w, x, y, z16 bytes
The nx ny nz properties are zeros here too: the disc’s normal is not
stored but follows from the rotation.
How it differs from the 3D layout
Property names, order, types, the sigmoid on the opacity, the exponential on the
scales and the normalisation of the rotation are the same as in the 3D layout. Only
the number of scales differs, and with it the size of a splat (244 bytes instead of
248 at degree 3). To tell the two apart a reader counts the scale_
properties: two means this layout, three the 3D one. The file explorer does exactly
that, and draws each splat as a flat disc.
The code appends a third scale of 1 when it builds the splat’s transform, so the third axis of the rotation is the disc’s normal and carries no scale of its own.
In this reference
- Splat properties – every vertex property of the 2D layout, and how each becomes part of a disc
Variants
Other kinds of file that use the extension .ply:
- Polygon File Format – meshes, point clouds and scanner grids with a header that declares every property
- 3D Gaussian Splatting PLY – the training code’s layout: one float vertex a splat, 248 bytes at degree 3
- 2D Gaussian Splatting PLY – the same layout with two scales: flat discs, 244 bytes at degree 3
- PlayCanvas compressed PLY – chunks of 256 splats with ranges, and four packed words a splat
Links
Software
- SuperSplat – PlayCanvas’s free open source splat editor (web)
Developers
- 2d-gaussian-splatting – the training and mesh extraction code, which writes the layout (Python, C++, CUDA)
- plyfile – reads and writes PLY with NumPy (Python)
Reference
- gaussian_model.py –
construct_list_of_attributes,save_plyandload_ply, where the scale array has two columns - 2D Gaussian Splatting for Geometrically Accurate Radiance Fields – the paper’s page