Creative Coding

Shader toys are debugging tools too

2 min read

A shader toy is a small visual instrument.

The screen turns invisible values into color, motion, edges, and fields. That makes coordinate errors, bad normalization, unstable thresholds, and clipped values easier to see than they are in logs.

vec2 uv = fragCoord.xy / iResolution.xy;
float d = length(uv - 0.5);
vec3 color = vec3(smoothstep(0.3, 0.31, d));
fragColor = vec4(color, 1.0);

Move one number and the shape gives immediate feedback.

Graphics bugs often reveal themselves visually:

  • circle becomes ellipse: aspect-ratio problem
  • motion reverses: axis is flipped
  • texture swims: unstable coordinates
  • pattern changes with resolution: normalization problem

The same technique works for heat maps, vector fields, confidence maps, masks, simulations, embeddings, and classification boundaries. The question is not only what value occurred. It is what shape the values made.

The word toy is useful when the cost of being wrong is low. A browser sketch can answer one question about interpolation, noise, easing, ray marching, or feedback and then be discarded.

WebGPU makes those experiments easier to place beside prose, controls, and source. A tiny visual program becomes a learning object and a debugger at the same time.

Cheap noticing is good engineering. If state is visible, a bug has less room to hide.

Jeremy London

About Jeremy London

Engineering leader and builder in Denver. I write about AI platforms, agents, security, reliability, homelab infrastructure, and the parts of engineering work that have to survive production.