You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: extensions/2.0/Khronos/KHR_gaussian_splatting/README.md
+72-1Lines changed: 72 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,10 +70,71 @@ The `mode` of the `primitive` must be `POINTS`.
70
70
71
71
## Lighting
72
72
73
-
At the time of writing, the most common method for lighting 3D Gaussian splats is via spherical harmonics. This extension defines attributes to store spherical harmonic coefficients for each splat. The zeroth-order spherical harmonic coefficients are always required. Higher order coefficients are optional.
73
+
At the time of writing, the most common method for lighting 3D Gaussian splats is via the real spherical harmonics. This extension defines attributes to store spherical harmonic coefficients for each splat. The zeroth-order spherical harmonic coefficients are always required. Higher order coefficients are optional. Each color channel has a separate coefficient, so for each degree $ℓ$, there are $(2ℓ + 1)$ coefficients, each containing RGB values.
74
74
75
75
These rules may be relaxed by future extensions that define alternative lighting methods or have specific requirements for handling compression, such as when a compression method stores the diffuse color components as linear color values instead of the zeroth-order coefficients.
76
76
77
+
### Calculating color from Spherical Harmonics
78
+
79
+
The diffuse color of the splat can be computed by multiplying the RGB coefficients of the zeroth-order spherical harmonic by the constant real spherical harmonic value of $0.282095$. This constant is derived from the formula for the real spherical harmonic of degree 0, order 0:
To keep the spherical harmonics within the [0, 1] range, the forward pass of the training process applies a _0.5_ bias to the DC component of the spherical harmonics. The rendering process must also apply this bias when reconstructing the color values from the spherical harmonics. This allows the training to occur around 0, ensuring numeric stability for the spherical harmonics, but also allows the coefficients to remain within a valid range for easy rendering.
86
+
87
+
Ergo, to calculate the diffuse RGB color from the DC component, the formula is:
88
+
89
+
```math
90
+
Color_{diffuse} = SH_{0,0} * 0.282095 + 0.5
91
+
```
92
+
93
+
Where $SH_{0,0}$ represents the RGB coefficients of the zeroth-order real spherical harmonic.
94
+
95
+
Subsequent degrees of spherical harmonics can be used to compute more complex lighting effects, such as ambient occlusion and specular highlights, by evaluating the spherical harmonics at the appropriate angles based on the surface normal and light direction. Functions for the higher order real spherical harmonics are defined as follows:
TODO: Explain the relationship of r to the unit sphere and normalizing the (x, y, z) coordinates.
133
+
134
+
Other extensions may define alternative lighting methods, have specific requirements for handling compression, or define different spherical harmonics handling.
135
+
136
+
See [Appendix A: Rendering with the base Ellipse Kernel and Spherical Harmonics](#appendix-a-rendering-with-the-base-ellipse-kernel-and-spherical-harmonics) for more details on how to properly implement the lighting used by this extension.
137
+
77
138
## Schema Example
78
139
79
140
Example shown below including optional attributes and properties. This extension only affects any `primitive` nodes containting 3D Gaussian splat data.
@@ -148,6 +209,8 @@ Together, the scale and rotation can be used to reconstruct the full covariance
148
209
149
210
More details on how to interpret these attributes for rendering can be found in the [3D Gaussian Splatting for Real-Time Radiance Field Rendering](https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/) paper.
150
211
212
+
See [Appendix A: Rendering with the base Ellipse Kernel and Spherical Harmonics](#appendix-a-rendering-with-the-base-ellipse-kernel-and-spherical-harmonics) for more details on how to properly implement the ellipse kernel used by this extension.
213
+
151
214
### Color Space
152
215
153
216
The `colorSpace` property is a required property that specifies the color space of the 3D Gaussian Splat when spherical harmonics are being used for the lighting. The color space is typically determined by the training process for the splats. This color space value only applies to the 3D Gaussian splatting data and does not affect any other color data in the glTF.
@@ -303,6 +366,14 @@ The extension must also be listed in `extensionsUsed` at the top level of the gl
303
366
]
304
367
```
305
368
369
+
## Appendix A: Rendering with the base Ellipse Kernel and Spherical Harmonics
370
+
371
+
*This section is non-normative.*
372
+
373
+
The ellipse kernel defined in `KHR_gaussian_splatting` is based on the kernel and implementation described in the original research paper, [3D Gaussian Splatting for Real-Time Radiance Field Rendering](https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/). This kernel is defined by projecting a 3D ellipsoid onto a 2D plane using a perspective projection. The ellipsoid is defined by its mean (position), covariance matrix (derived from scale and rotation), and opacity.
374
+
375
+
TODO FINISH THIS THING
376
+
306
377
## Known Implementations
307
378
308
379
This is currently implemented within [3D Tiles and CesiumJS as an experimental feature](https://cesium.com/learn/cesiumjs/ref-doc/Cesium3DTileset.html?classFilter=3D).
0 commit comments