Taos Engine ▦ Taos: Building a Modern WebGPU Game Engine

HQ Cloud Pass — the merge experiment

Companion to hq_cloud_pass.ts. This sample tests one hypothesis: the HQ pass's lighting is good, the HQ pass's plumbing is what breaks — so put HQ lighting on the cheaper pass's volume and skip the plumbing.

The two starting points#

CloudPass (engine) HQCloudPass (sample)
Resolution Full-res, one pass Half-res march + full-res temporal reproject
Volume Flat slab, ~200-unit march clamp Spherical shell, horizon-distance march
Density cd_sample_density straight hq_density + domain warp + mip LOD
Phase Henyey-Greenstein dual lobe Cornette-Shanks + back lobe
Self-shadow 2 straight taps 5-tap cone + long tap
Scattering Single-scatter + ambient 3-octave Wrenninge multi-scatter, Beer-Powder
Status Ships in crafty, looks good WIP — three unresolved artifacts

The HQ pass's three open issues — axis-aligned puff rows, reproject latency, distant shimmer — are all properties of the right-hand plumbing, not the lighting:

  • Rows come from the long-range march resolving the tileable 64³ noise grid. The HQ pass added a domain warp + mip LOD to fight it; not fully solved.
  • Latency comes from the temporal reprojection leaning on history.
  • Shimmer comes from sub-pixel detail under the half-res jitter.

What this sample does#

MergedCloudPass is the engine CloudPass structurally — same four bind groups, same overlay + godray-fog plumbing, same single full-resolution render pass — pointed at clouds_hq_merged.wgsl. The shader keeps the left column (flat slab, cd_sample_density, short march clamp, white-noise dither) and grafts in the right column's lighting only:

  • dual_phase → Cornette-Shanks forward + soft HG back lobe
  • cone_light_march → sun-perpendicular 5-tap cone + long tap (replaces the 2-tap straight march)
  • multi_scatter_octaves → Wrenninge/Hillaire 3-octave energy-conserving sum
  • powder_term → Beer-Powder sun-edge darkening
  • multiScatter blends the octave term against single-scatter, so 0 reproduces the CloudPass look and 1 is full HQ.

Because there is no half-res, no reproject, and no de-tiling machinery, none of the three artifacts can appear in their original form. The single remaining lever is marchDistance (the slab clamp): short keeps the tiling hidden the way CloudPass does; long shows more deck and is where tiling rows would re-emerge. Lower the deck (MIN/MAX H sliders) to pull the whole scene into the clean short-range regime CloudPass was tuned for.

How to read the result#

Open hq_cloud_test.html and this side by side at the same sun angle. Same lighting math; the merged pass should be free of the row banding and the pan latency. The cost: no temporal supersampling, so the white-noise dither is visible without TAA — leave the TAA toggle on (it averages the dither the way CloudPass relies on a fine perceptually-flat grain).

Open questions this experiment is meant to answer#

  1. At what deck height / marchDistance does the flat-slab tiling start to read as rows again? (i.e. how much of the HQ look survives at full range.)
  2. Is the cone self-shadow march stable at full-res single-pass, or does it need the temporal average to stop fireflies on the cone taps?
  3. Does single-pass multi-scatter cost more or less than half-res + reproject in practice, for equal visual quality?