DriftCapture · interface

GaussianSet

Where a Gaussian lands on screen: the projection @driftengine/splats' shader performs, in JavaScript, and the order a frame draws them in.

Explained in DriftCapture.

interface GaussianSet
import type { GaussianSet } from '@driftengine/capture';

In depth

The same model, in the capture's own frame. A perspective divide is not linear, so a three-dimensional Gaussian does not project to a two-dimensional one; the standard treatment, which that shader uses and this repeats, linearises about the splat's centre — Σ' = J·R·Σ·Rᵀ·Jᵀ — and adds a low-pass of 0.3 to the screen variances so that a splat smaller than a pixel still covers one. The one difference is handedness: the shader works in the renderer's view space, where z runs away from the camera negatively, and a capture's cameras look down positive z. The arithmetic is the same and the frame is the caller's.

It exists to be differentiated. projectGradient.ts is this chain run backwards, and gradients.test.ts holds the two together by a central difference of one against the other.

Properties

NameTypeDescription
countnumber
positionsreadonlyFloat64ArrayThree per Gaussian, in the capture's world.
scalesreadonlyFloat64ArrayThree per Gaussian: a standard deviation along each of its own axes, in metres.
rotationsreadonlyFloat64ArrayFour per Gaussian, xyzw, as the engine's quaternions are.
colorsreadonlyFloat64ArrayThree per Gaussian, linear, which is a spherical harmonic's constant term.
sh1readonlyoptionalFloat64ArrayNine per Gaussian for the degree-1 band, or absent for a cloud with no view dependence.
opacitiesreadonlyFloat64ArrayOne per Gaussian, 0 to 1.