API

Class GaussianPointSplattingRenderer

Owns the WebGPU compute pipeline and GPU buffers for Gaussian Point Splatting (the stochastic, sort-free point-splatting technique). Engine-focused: it knows nothing about the scene graph beyond the camera matrices and viewport size handed to it.

Per-frame pipeline (dispatched before the render pass): preprocess (1 thread/Gaussian: transform, cull, cache screen state, emit a point weight) scan (Blelloch prefix sum of the weights into a CDF + GPU-written indirect dispatch args) partition (bucketed point-to-Gaussian table that narrows the splat search) splat (indirect, 1 thread/point: find its Gaussian in the CDF, atomicMin its sample) resolve (accumulate the packed image buffer into the full-float buffer, reset it) hi-Z build (max-reduce this frame's depth into next frame's occlusion pyramid)

Index
compensation: boolean = false

Whether the source material enables antialiasing opacity compensation (classic COMPENSATION).

debugActive: number = 0

1 when any per-part debug knob is active (drives the preprocess debug branch); 0 otherwise.

isOrthographic: boolean = false

Whether the active camera is orthographic (selects the ortho Jacobian in computeCov2D).

kernelSize: number = 0.3

Low-pass antialiasing dilation, in the classic material's kernelSize units.

maxAccumFrames: number = 255

Cap on each output pixel's accumulated sample count (clamped to 1..65535). Past the cap later samples blend in at 1/(cap+1), so the image keeps refreshing instead of freezing.

minPixelSize: number = 0

Classic material's minPixelSize: splats whose projected diameter is below this many output pixels are skipped (0 = off).

occlusionCulling: boolean = false

Hi-Z occlusion culling: skip Gaussians fully behind the previous frame's nearest samples. Off by default because those stochastic samples may be semi-transparent, so culling biases the converged image. The depth pyramid is allocated only while enabled.

pointScale: number = 1.0

Sample-density multiplier on the (importance-calibrated) point count. Keep at 1 for exact coverage = opacity*gaussian; other values trade noise for cost but bias the alpha.

rightHandedSystem: boolean = false

Whether view-space forward is negative (right-handed scenes).

  • Runs the per-frame GPS compute pipeline for the given viewport, leaving the result in accumBuffer. Allocates/resizes buffers on demand.

    Parameters

    • width: number

      internal render (low) width in pixels; must be ceil(outWidth / upsampleN)

    • height: number

      internal render (low) height in pixels; must be ceil(outHeight / upsampleN)

    • outWidth: number = width

      output (full) width the accumulation is reconstructed at

    • outHeight: number = height

      output (full) height

    • upsampleN: number = 1

      integer upscale factor; 1 = no upsampling

    • jitterX: number = 0

      this frame's sub-cell offset x in [0, N)

    • jitterY: number = 0

      this frame's sub-cell offset y in [0, N)

    Returns boolean

    true if the pipeline dispatched, false if it was not ready / had nothing to draw

  • Sets the camera state used to project Gaussians on the next render.

    Parameters

    • view: Matrix

      world-to-view matrix

    • viewProjection: Matrix

      world-to-clip matrix

    • near: number

      near plane distance

    • far: number

      far plane distance

    • focalX: number

      horizontal focal length in pixels

    • focalY: number

      vertical focal length in pixels

    • camX: number

      camera world position x

    • camY: number

      camera world position y

    • camZ: number

      camera world position z

    • viewZMin: number

      the model's minimum view-space depth this frame (depth-key normalization range)

    • viewZMax: number

      the model's maximum view-space depth this frame

    Returns void

  • Sets the full projection for covariance, per-pixel depth and oblique clipping.

    Parameters

    • projection: Matrix

      camera projection matrix

    • inverseProjection: Matrix

      inverse of the projection matrix

    • reverseDepth: boolean = false

      whether larger NDC depth values are nearer

    Returns void

  • Sets the projection matrix's z-row (column-major m10, m11, m14, m15), used by resolve to map the view-z depth key back to ndc.z for fragDepth (it encodes the reverse-Z / half-Z convention).

    Parameters

    • m10: number

      projection.m[10]

    • m11: number

      projection.m[11]

    • m14: number

      projection.m[14]

    • m15: number

      projection.m[15]

    Returns void

  • True when the storage buffers required by the given workload fit in the device limits. Callers must fall back to another renderer when it is false, otherwise buffer creation raises a validation error.

    Parameters

    • gaussianCount: number

      number of Gaussians to render

    • shDegree: number

      spherical-harmonics degree of the data (0-4)

    • outWidth: number

      output (full) width in pixels

    • outHeight: number

      output (full) height in pixels

    Returns boolean

    whether the workload can be allocated on this device

  • Uploads decoded splat data into per-Gaussian GPU buffers, replacing any previous data.

    Parameters

    • means: Float32Array

      packed positions, 4 floats per Gaussian (x, y, z, unused)

    • cov3d: Uint32Array

      packed 3D covariance, 4 u32 per Gaussian (3 f16 pairs of Sigma/factor + f32 factor)

    • colorOpacity: Uint32Array

      packed RGBA8 base color + opacity, 1 u32 per Gaussian

    • sh: Nullable<Uint32Array<ArrayBufferLike>>

      8-bit-quantized SH coefficients packed 4 bytes/u32 (GPS_SH_WORDS per Gaussian), or null

    • shDegree: number

      spherical-harmonics degree (0 = view-independent color)

    • count: number

      number of Gaussians

    Returns void