Skip to content
Reveal · TechniqueBeginner

Dissolve

Make a surface burn away or materialize in irregular blotches by comparing noise with a moving threshold.

UVTimeSurface2D / sprite

Cards

One live example to tweak, learn and copy.

How it works

A dissolve hides a surface one patch at a time instead of fading all of it at once. Every pixel gets a fixed random value from a noise function, and a single number, the threshold, sweeps from 0 to 1. Pixels whose noise is below the threshold are gone; the rest stay. Because noise varies smoothly across the surface, the gone pixels gather into blotches that grow, meet and finally swallow everything.

Why it is cheap and why it reads well

The whole effect is one noise lookup and one comparison per pixel, and the threshold is the only thing that changes over time. Animating it is the job of whatever owns the object: a script tweens the threshold when an enemy dies, a timeline drives it in a cutscene, or time feeds it directly for a looping demo. The noise never moves, so the blotches grow in place, which the eye reads as one material being consumed rather than a pattern sliding over it.

The comparison also gives an edge for free. The pixels whose noise is only a little above the threshold are the ones that go next, so a smoothstep over that small range finds a band hugging every hole. Coloring that band is what turns a plain cut-out into burning paper, melting ice or a teleport glow.

Hiding pixels

How the gone pixels disappear depends on the stage. On a 3D surface the shader returns an alpha of 0 or 1 and the material uses alpha clip, which discards the fragment instead of blending it, so the surface keeps writing depth and needs no sorting. On a sprite the 2D renderer already blends with alpha, so the shader can return a soft alpha and fade the edge as well as cut it.

Choosing the noise

The size of the blotches is the noise’s scale. Value noise, built from the hash at the grid corners, is the cheapest and is enough here because the edge hides its blocky grid; gradient noise or a few octaves of fBm give more ragged, natural edges for a little more math. A noise texture works as well, and a hand-painted one lets an artist decide where the hole opens first.

Further reading