Cold Start
- ..
- .metadata17 B
- README.md1.4 KB
- bindings.yaml568 B
- shader.wgsl10.3 KB
README.md
tid_cloud_march
The raymarcher for the TIDES squall. One invocation per pixel of a
TIDES-owned target: rebuild the pixel's ray from the camera basis, clip it to
the cloud volume's world AABB, clamp it at the scene surface, and integrate
front to back through the density volume tid_cloud_fill wrote.
It exists as a separate shader from preseed.emission_raymarch because three
things this part needs are decided inside a marcher and cannot be reached from
its caller: the engine's depth is REVERSED (1.0 near, 0.0 far and at empty
sky) and has to be unprojected as such or empty sky reads as an occluder; the
target must be the live backbuffer size and owned by one part, so nothing
resamples the march and nothing else writes into it; and the step has to grow
with distance to reach 30 km across an 18 km deck without spending a thousand
uniform steps.
The ray start carries an interleaved-gradient-noise jitter. That turns the
residual step quantisation from a coherent band into a per-pixel dither with
a well-separated neighbourhood, which tid_cloud_composite resolves with a
3x3 reconstruction.
Output is premultiplied — vec4(scatter, 1 - transmittance) — which is the
form the composite blends over the scene.
The uniform layout is documented at the top of shader.wgsl, and
preseed/tides/sky.module is the only thing that packs it. Both sides of that
contract are edited together.