---
id: "temporal-spatial-neural-splat-denoising"
title: "Lightweight WGSL Temporal-Spatial Neural Denoiser for Stochastic Splatting"
aliases: [stochastic splat neural denoiser, WGSL temporal-spatial denoiser, recurrent splat denoiser]
domain: "post"
stage: "post"
realtime: "realtime"
platforms: [webgpu, webgl2, desktop-gpu, mobile-gpu]
year_introduced: 2017
inputs: [hdr-image, depth, camera-poses]
outputs: [hdr-image]
style: "photoreal"
dynamic: "dynamic"
cost: "medium"
authority: "Chaitanya et al., 2017"
url: "https://texelatlas.vercel.app/t/temporal-spatial-neural-splat-denoising/"
sources_verified_at: "2026-11-30"
---
# Lightweight WGSL Temporal-Spatial Neural Denoiser for Stochastic Splatting (Chaitanya et al., 2017)

> Reconstructs temporally stable frames from noisy stochastic 3D Gaussian splats using a compact recurrent neural filter compiled directly into WGSL/GLSL shaders with packed vec4 feature targets and camera-reprojected history.

## Reach for it when

- stochastic sort-free gaussian splats look noisy and stippled in motion
- reconstruct clean smooth splat images from low-sample stochastic coverage
- need a lightweight neural filter tailored to 3dgs depth and motion guides
- reduce flicker and crawling grain on real-time stochastic splat renders
- combine temporal reprojection with compact spatial filtering for splat pipelines

## How it works

Sort-free stochastic Gaussian splatting trades global sorting for high-frequency sub-pixel alpha stipple, while real-time browser renderers cannot afford multi-megabyte desktop denoisers like OIDN every frame. Drawing on recurrent Monte Carlo denoising autoencoders, a lightweight temporal-spatial neural denoiser executes a tiny convolutional/pointwise network directly inside standard **WGSL or GLSL fragment passes**.

Each frame's noisy 4× MSAA stochastic color and depth buffer is paired with the previous frame's **camera-reprojected history** (computed from current and previous view-projection matrices and depth). Instead of shipping an external ML runtime, trained weights are baked straight into shader constants as groups of `mat4x4` pointwise convolutions and small spatial taps operating on packed `rgba16float` render targets—four hidden channels per attachment.

A multi-scale spatial block aggregates neighborhood context to dissolve stipple while respecting depth edges, and a final residual head blends the spatial prediction with reprojected temporal history, rejecting stale history across disocclusions. Because the network has only a few tens of channels and runs purely in native shader passes, it achieves real-time frame rates in WebGPU and WebGL2, including stereo XR.

## When to use it

Choose it when pairing sort-free stochastic Gaussian splatting with real-time interactive or XR camera motion in the browser and you need immediate noise suppression without heavy external ML runtimes.

Prefer [temporal-anti-aliasing](temporal-anti-aliasing) when GPU budget is too tight for multi-pass neural inference and mild motion ghosting is acceptable. Prefer [svgf](svgf) when you have full path-traced G-buffers (normals, albedo, mesh IDs) and want an analytic spatiotemporal filter. Prefer [open-image-denoise](open-image-denoise) for offline or converged single-frame denoising.

## Cost

medium — Runs as a fixed sequence of fullscreen WGSL/GLSL fragment passes over packed rgba16float targets; lightweight enough for real-time desktop and WebGPU rendering, though fill-rate sensitive at 4K or high-resolution XR.
Measured GPU Weight: 261.5× baseline (extreme) — 8.6033 ms median / 8.648 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 280.44× baseline (extreme) — 4.459 ms median (1.93× faster on L4).
Ampere A100 scaling: 188.92× baseline (extreme) — 5.441 ms median (1.58× faster on A100).

## Failure modes

- Disocclusion trails or brief stipple bursts when the camera moves rapidly and reprojected history is invalidated
- Over-smoothing of sub-pixel high-frequency foliage or fine text that resembles stochastic alpha noise
- Domain shift artifacts if applied to stylized or out-of-distribution splat opacity statistics not seen during training
- Floating-point half-precision truncation can introduce faint color banding in dark gradients without rounding bias compensation

## Dataflow

- Inputs: hdr-image, depth, camera-poses
- Outputs: hdr-image
- Platforms: webgpu, webgl2, desktop-gpu, mobile-gpu

## Presets

### Temporal-Spatial Neural Splat Denoiser — stochastic sort-free alpha-stipple splats (left) vs recurrent neural-filtered cloud (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_STIPPLE": 0.85,
  "P_SPLAT_SIZE": 0.65,
  "P_RECURRENT": 0.88,
  "P_SPLIT": 0.48
}
```

```glsl
const float P_STIPPLE = 0.85; // P Stochastic Stipple [0.2, 1.0, 0.05]
const float P_SPLAT_SIZE = 0.65; // P Gaussian Radius [0.35, 1.2, 0.05]
const float P_RECURRENT = 0.88; // P Recurrent Blend [0.2, 0.96, 0.04]
const float P_SPLIT = 0.48; // P Stipple / Denoised [0.0, 1.0, 0.02]

float hash21(vec2 p) {
  p = fract(p * vec2(127.1, 311.7));
  p += dot(p, p + 34.5);
  return fract(p.x * p.y);
}

vec2 rot2(vec2 p, float a) {
  float c = cos(a);
  float s = sin(a);
  return vec2(c * p.x - s * p.y, s * p.x + c * p.y);
}

// Render 28 orbiting 3D Gaussian splats using sort-free stochastic alpha testing (left) vs clean analytic/denoised (right)
void evalSplatCloud(vec2 uv, vec2 fragPx, float t, float radScale, float stippleMode, float seedOff, out vec3 outCol, out float outDepth) {
  vec3 bg = mix(vec3(0.05, 0.07, 0.12), vec3(0.12, 0.16, 0.24), smoothstep(-0.5, 0.5, uv.y));
  outCol = bg;
  outDepth = 10.0;

  vec3 accum = vec3(0.0);
  float trans = 1.0;
  float bestZ = 10.0;
  vec3 winnerCol = bg;

  for (int i = 0; i < 28; i++) {
    float fi = float(i);
    float u = fi / 28.0;
    float ang = u * 6.2831853 * 2.0 + t * 0.55;
    float phi = (u - 0.5) * 2.4;
    // Sculptural double-helix / botanical coral splat cluster in 3D
    vec3 sp = vec3(
      0.42 * cos(ang) * cos(phi * 0.6),
      0.34 * sin(phi),
      0.42 * sin(ang) * cos(phi * 0.6)
    );
    sp.xz = rot2(sp.xz, t * 0.35);

    float zCam = 1.95 - sp.z;
    vec2 proj = sp.xy / max(zCam * 0.62, 0.3);
    vec2 d = uv - proj;
    // Anisotropic splat orientation
    vec2 dl = rot2(d, ang * 0.7 + fi);
    vec2 rAxis = vec2(0.095, 0.055) * radScale / max(zCam * 0.55, 0.35);
    float g = exp(-0.5 * dot(dl / rAxis, dl / rAxis));
    float alpha = clamp(g * 0.82, 0.0, 0.96);

    vec3 splatCol = 0.52 + 0.45 * cos(vec3(0.0, 2.05, 4.10) + u * 5.2 + sp.y * 2.4);
    splatCol *= 0.75 + 0.45 * smoothstep(-0.4, 0.4, sp.y + 0.2 * sp.z);

    if (stippleMode > 0.5) {
      // Sort-free stochastic splatting: accept fragment if random threshold < alpha, keep closest Z!
      float rnd = hash21(floor(fragPx) + vec2(fi * 17.3 + seedOff * 31.7, fi * 9.1 - seedOff * 13.3));
      if (rnd < alpha && zCam < bestZ) {
        bestZ = zCam;
        winnerCol = splatCol;
      }
    } else {
      // Soft volumetric reference weighting for recurrent spatial-temporal denoiser
      float wDepth = exp(-max(zCam - 1.2, 0.0) * 0.65);
      accum += splatCol * alpha * wDepth * trans;
      trans *= (1.0 - alpha * 0.55);
      if (alpha > 0.25 && zCam < bestZ) bestZ = zCam;
    }
  }

  if (stippleMode > 0.5) {
    outCol = winnerCol;
    outDepth = bestZ;
  } else {
    outCol = accum + bg * trans;
    outDepth = bestZ;
  }
}

vec3 aces(vec3 x) {
  x = max(x, 0.0);
  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  float screenX = fragCoord.x / max(iResolution.x, 1.0);
  float split = clamp(P_SPLIT, 0.0, 1.0);
  float stipple = clamp(P_STIPPLE, 0.1, 1.0);
  float radScale = clamp(P_SPLAT_SIZE, 0.3, 1.3);
  float recW = clamp(P_RECURRENT, 0.1, 0.97);
  float fr = floor(iTime * 16.0);

  vec3 col = vec3(0.0);
  if (screenX < split) {
    // Left: Raw sort-free stochastic splatting (sub-pixel Bernoulli stipple noise)
    vec3 stCol, refCol;
    float stZ, refZ;
    evalSplatCloud(uv, fragCoord, iTime, radScale, 1.0, fr, stCol, stZ);
    evalSplatCloud(uv, fragCoord, iTime, radScale, 0.0, fr, refCol, refZ);
    col = mix(refCol, stCol, stipple);
  } else {
    // Right: Compact recurrent temporal-spatial neural-style filter (depth-aware 3x3 spatial + multi-frame reprojected history)
    vec3 cRef; float cZ;
    evalSplatCloud(uv, fragCoord, iTime, radScale, 0.0, fr, cRef, cZ);
    vec3 acc = vec3(0.0);
    float wSum = 0.0;
    for (int j = -1; j <= 1; j++) {
      for (int i = -1; i <= 1; i++) {
        vec2 qPx = fragCoord + vec2(float(i), float(j)) * 1.5;
        vec2 qUv = (qPx - 0.5 * iResolution.xy) / iResolution.y;
        vec3 qCol; float qZ;
        evalSplatCloud(qUv, qPx, iTime, radScale, 1.0, fr + float(i * 3 + j), qCol, qZ);
        float wZ = exp(-abs(cZ - qZ) * 2.2);
        float w = wZ * exp(-dot(vec2(float(i), float(j)), vec2(float(i), float(j))) * 0.45);
        acc += qCol * w;
        wSum += w;
      }
    }
    vec3 spatialEst = acc / max(wSum, 1e-4);
    // Recurrent temporal feedback stabilizes the spatial estimate without ghosting
    col = mix(spatialEst, cRef, recW);
  }

  float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));
  col = mix(col, vec3(0.95, 0.98, 1.0), sep);
  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}
```

Attribution: MIT — written for this index.

## Combines with

- [4× MSAA Sort-Free Stochastic Gaussian Splatting](https://texelatlas.vercel.app/t/sort-free-stochastic-splatting-msaa.md): Consumes noisy 4× MSAA stochastic splat color and depth targets to output smooth, temporally coherent frames.
- [AgX](https://texelatlas.vercel.app/t/agx-tonemapping.md): Applies display tone mapping after temporal-spatial neural reconstruction completes in linear HDR space.

## Combination ideas

- [Sort-free neural-denoised LOD Gaussian splats](https://texelatlas.vercel.app/ideas/stochastic-lod-neural-splats/)

## Sources

1. [primary] Chakravarty R. Alla Chaitanya, Anton S. Kaplanyan, Christoph Schied, Marco Salvi, Aaron Lefohn, Derek Nowrouzezahrai, Timo Aila (2017) Interactive reconstruction of Monte Carlo image sequences using a recurrent denoising autoencoder. ACM Transactions on Graphics. https://doi.org/10.1145/3072959.3073601 (verified via crossref on 2026-11-30)
2. [primary] WilliamLiu-1997 (2026) WilliamLiu-1997/Gaussian-Splat-Lite. https://github.com/WilliamLiu-1997/Gaussian-Splat-Lite License: Apache-2.0. (verified via github on 2026-11-30)

## Cite this entry

Texel. "Lightweight WGSL Temporal-Spatial Neural Denoiser for Stochastic Splatting." https://texelatlas.vercel.app/t/temporal-spatial-neural-splat-denoising/ (accessed 2026-12-01).
