Tech article

The Art of Dithering and Retro Shading for the Web

No preview is available. Read the original article for the full story.

Hacker News | Oct 13, 2026 | michael-sumner

Automated excerpt

For this project, we'll create a custom post-processing effect. Grayscale color quantization implemented in our custom effect1vec3 dither(vec2 uv, float lum) {2 vec3 color = vec3(lum);34 int x = int(uv. x * resolution. x) % 8;5 int y = int(uv. y * resolution. y) % 8;6 float threshold = bayerMatrix8x8[y * 8 + x];78 color. rgb += threshold;9 color. r = floor(color. r * (colorNum - 1. 0) + 0. 5) / (colorNum - 1. 0);10 color. g = floor(color. g * (colorNum - 1. 0) + 0. 5) / (colorNum - 1. 0);11 color. b = floor(color.

Selected automatically from source text; not independently written or fact-checked. Read the original for full context.

Read the original article

Read next

AI briefing: recent picks

More stories to explore