← all demos · chapter 03

Dissolve — the noise-threshold trick

Compare a noise value (smooth randomness) per pixel against a sliding threshold; hide pixels below it; paint a hot rim just above it. Slide the threshold 0→1 and the shape burns away. This is the "hello world" of shader confidence — here it runs per-pixel in plain JavaScript so you can read every step.

The circle endlessly burns away and re-forms. In a real shader, the two ifs are the same two lines — the GPU just runs them on millions of pixels at once.

Try tweaking: rim width 0.06 → 0.2 (wide molten edge) · rim colour to white-hot "#FFFFFF" · the noise frequencies (0.35/0.3) → 1.5 for a fizzy, TV-static dissolve · t * 0.6 → t * 3 for a snappy teleport.

In Godot: the 3-line shader version — download dissolve.gdshader and its scene dissolve.gd from the Godot project. In Unity: Shader Graph — noise texture → Step vs a slider → Alpha Clip; four nodes, then animate the slider from code. In Unreal: the identical graph in the Material editor with a Timeline driving the scalar. Chapter 03.