Skip to content

Commit fd596c2

Browse files
updates and formatting
1 parent e3a8132 commit fd596c2

File tree

1 file changed

+30
-2
lines changed
  • extensions/2.0/Khronos/KHR_gaussian_splatting

1 file changed

+30
-2
lines changed

extensions/2.0/Khronos/KHR_gaussian_splatting/README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ Standard PLY splat formats have opacity and color separate, however they are com
5757

5858
This implementation only contains the zeroth spherical harmonic for diffuse color. Spherical Harmonic channels 1 through 15, which map the splat specular, are currently unused by the extension.
5959

60+
Utilizing the standard position and color attributes allows us to easily fall back in situations where `extensions.KHR_gaussian_splatting` isn't available. Or simply for alternative rendering.
61+
6062
### Extension attributes
6163

6264
`extensions.KHR_gaussian_splatting` may contain the following values:
@@ -77,7 +79,7 @@ This implementation only contains the zeroth spherical harmonic for diffuse colo
7779

7880
### Transforming Gaussian Splat Data for glTF
7981

80-
The data output from the Gaussian splat training process that is stored in the typical PLY must be transformed before storing in glTF.
82+
The data output from the Gaussian splat training process that is stored in the typical PLY must be transformed before storing in glTF. These transformations make the data suitable for direct usage in glTF.
8183

8284
#### Diffuse Color
8385

@@ -151,10 +153,26 @@ Sample:
151153

152154
_This section is non-normative_
153155

154-
In this example, we follow a reference implementation for rendering Gaussian Splats.
156+
Rendering is broadly two phases: Pre-rasterization sorting and rasterization.
157+
158+
### Splat Sorting
159+
160+
Given that splatting uses many layered Gaussians blended to create complex effects, their ordering is view dependent and must be sorted based on their distance from the current camera position. The details are largely dependent on the platform targeted.
161+
162+
Two example approaches:
163+
164+
- Sorting the vertex buffers directly before submitting to the GPU
165+
- Generating textures from splat data and updating the indexes into the texture each frame
166+
167+
### Rasterizing
155168

156169
In the vertex shader, we first must compute covariance in 3D and then 2D space. In optimizing implementations, 3D covariance can be computed ahead of time.
157170

171+
Our covariance matrix can be represented as:
172+
$$\Sigma = RSS^TR^T$$
173+
174+
Where `S` is our scaling matrix and `R` is our rotation matrix
175+
158176
```glsl
159177
//https://github.com/graphdeco-inria/diff-gaussian-rasterization/blob/59f5f77e3ddbac3ed9db93ec2cfe99ed6c5d121d/cuda_rasterizer/forward.cu#L118
160178
void calculateCovariance3D(vec4 rotation, vec3 scale, out float[6] covariance3D)
@@ -184,7 +202,17 @@ void calculateCovariance3D(vec4 rotation, vec3 scale, out float[6] covariance3D)
184202
Sigma[1][1], Sigma[1][2], Sigma[2][2]
185203
);
186204
}
205+
```
206+
207+
3D Gaussians are then projected into 2D space for rendering. Algorithm Zwicker et al. [2001a]
187208

209+
$$\Sigma' = JW\Sigma W^TJ^T$$
210+
211+
`W` is the view transformation
212+
`J` is the Jacobian of the affine approximation of the projective transformation
213+
$\Sigma$ is the 3D covariance matrix derived above
214+
215+
```glsl
188216
//https://github.com/graphdeco-inria/diff-gaussian-rasterization/blob/59f5f77e3ddbac3ed9db93ec2cfe99ed6c5d121d/cuda_rasterizer/forward.cu#L74
189217
vec3 calculateCovariance2D(vec3 worldPosition, float cameraFocal_X, float cameraFocal_Y, float tan_fovX, float tan_fovY, float[6] covariance3D, mat4 viewMatrix)
190218
{

0 commit comments

Comments
 (0)