Dither the present pass #77

Closed
opened 2026-10-20 08:49:24 +00:00 by sermuns · 0 comments
Owner

The HDR target is Rgba16Float on WebGPU but Rgba8Unorm on every GL and
WebGL2 backend, because EXT_color_buffer_float is what decides it. The present
pass then maps that through ACES and an exact sRGB encode.

Night is a smooth, dim gradient -- the sky, the fog falloff, the flashlight cone --
and 8 bits bands it visibly. The web build is the case that shows it, but any GL
desktop driver takes the same path.

Add interleaved-gradient noise of about half an LSB to the tonemapped color in
POST_BODY (liuverse-render/src/shaders.rs), before color_mapping. One hash
and one add, no pass, and it also cleans up the last banding from the ACES curve
on the 16-bit path.

Related: #78 and #84 both live in the same pass.

The HDR target is `Rgba16Float` on WebGPU but `Rgba8Unorm` on every GL and WebGL2 backend, because `EXT_color_buffer_float` is what decides it. The present pass then maps that through ACES and an exact sRGB encode. Night is a smooth, dim gradient -- the sky, the fog falloff, the flashlight cone -- and 8 bits bands it visibly. The web build is the case that shows it, but any GL desktop driver takes the same path. Add interleaved-gradient noise of about half an LSB to the tonemapped color in `POST_BODY` (`liuverse-render/src/shaders.rs`), before `color_mapping`. One hash and one add, no pass, and it also cleans up the last banding from the ACES curve on the 16-bit path. Related: #78 and #84 both live in the same pass.
sermuns added this to the Rendering milestone 2026-10-20 08:49:24 +00:00
Sign in to join this conversation.
No description provided.