~ / projects /

Gaussian Splatting

Gaussian splatting represents a scene as a cloud of 3D Gaussians and renders by projecting them onto the image plane instead of marching along rays. That change is why it is fast, rasterization instead of integration, and it is still fully differentiable, so the Gaussians can be optimized from images.

This is a simplified rasterizer built from scratch in PyTorch, deliberately without the optimizations of the reference CUDA implementation, to keep each stage of the pipeline legible.

The rasterizer

Rendering a frame comes down to four steps. Each 3D Gaussian is projected to a 2D Gaussian on the image plane. The projected set is depth-sorted, and anything behind the camera is discarded. Alpha and transmittance are evaluated per pixel, and the colors are composited front to back. Depth and silhouette maps fall out of the same pass.

Sorting is the step that carries the most weight. Alpha compositing is order-dependent, so getting depth order wrong does not degrade the image slightly; it puts the wrong surface in front.

Animated three-panel render of a pre-trained Gaussian scene: the color image, a depth map in blue-to-yellow, and a white silhouette mask on black.
Pre-trained Gaussians through the pipeline: color, depth and silhouette, all from the same pass.

Training a representation

Turning the renderer around, the Gaussian parameters become trainable and the scene is fitted from posed multi-view images. Each parameter type (position, scale, opacity and color) gets its own learning rate, since they live at different scales and a single rate leaves some barely moving while others diverge.

Animated grid of a toy cow from four viewpoints: the top row shows the Gaussian render sharpening over training, the bottom row the ground-truth views.
Training progress: renders (top) converging on the ground-truth views (bottom) as the cow resolves out of isotropic Gaussians.
Animated orbit of the converged toy cow rendered from Gaussians.
The converged representation, rendered as an orbit.

Harder cases

Two extensions push past the easy setting. Adding spherical harmonic components lets a Gaussian change color with viewing angle, which is what makes reflective surfaces read correctly instead of flat.

The second is a scene initialized from random points rather than a good starting cloud, which is where the naive version falls apart. Getting it to converge took learning rate scheduling, an SSIM term alongside the pixel loss, adaptive density control, and anisotropic rather than isotropic Gaussians, letting each one stretch along the surface it represents.

Animated grid of a scene of small round objects from four viewpoints: blurry Gaussian renders on top sharpening toward the ground-truth views on the bottom.
Training from random initialization: renders (top) against ground truth (bottom).
Animated orbit of the converged harder scene rendered from Gaussians.
Final renders on the harder scene.

Why the extras matter. From random initialization, nothing about the starting cloud is close to the answer. Per-parameter learning rates stop one parameter type from dominating the update; anisotropic covariances let Gaussians flatten onto surfaces instead of piling up as blobs; SSIM rewards structure the pixel loss misses; and adaptive density control adds Gaussians where detail is missing and prunes them where they are not needed.

Coursework for 16-825, Learning for 3D Vision.

  • Computer Vision
  • Deep Learning