Quantize tone bands.
GLSL fragment shader
The effect's own code. The uniforms and helpers above it — uTex, uFeedback, the depth proxy, the frame ring, depthAt(), timeAt() — are the same header every Ether-MOSH shader opens with, and are documented once on the registry rather than reprinted on all 143 pages.
void main(){ vec4 c = texture2D(uTex, vUv); // Levels unstepped, because a stepped param snaps under a dragging finger. // Bias shifts where the bands land, so one level count can posterise into // shadow detail or into highlight detail. c.rgb = floor(clamp(c.rgb + (uBias - 0.5) * 0.4, 0.0, 1.0)*uLevels)/uLevels; gl_FragColor = c; }