Effects

Relief

The brightness of the picture below becomes height, lit by a lamp: emboss, a shaded picture or polished metal.

  • effect
  • seamless tile
Open in the editor →

Shine a torch across a coin and relief you could barely see head-on leaps out. This effect does the same to the picture below: it reads brightness as height and lights the resulting surface with a lamp. It is cartographic hill shading, the Emboss filter of image editors and bump mapping in games.

How it works

At every point the effect estimates the slope of the surface, the height gradient ∇h. Instead of neighbouring pixels it takes eight samples on each of two rings, one at the “Bevel width” and one at half of it, so the bevel is equally wide in a preview and in an 8K export. The slope gives the normal n, the direction perpendicular to the surface; “Depth” makes the slopes steeper and “Deboss” swaps hills and hollows.

Brightness follows Lambert's law: the cosine of the angle between the normal and the direction to the lamp, L, which is set by “Light direction” (azimuth) and “Light height” (angle above the horizon). “Emboss” subtracts the brightness of a flat patch, so an even background turns mid-grey and only the edges remain. “Light and shade” multiplies the picture's own colours by the lighting and adds a Blinn–Phong highlight. “Metal” reflects an imaginary studio with a bright horizon in the surface and tints it with the picture: slopes facing the light flare up, those turned away sink into shadow.

n = normalize(−k·∂h/∂x, −k·∂h/∂y, 1) brightness = n · L (Lambert's law) emboss = ½ + 0.85·(n·L − sin e), e = “Light height”

A bit of history

Johann Lambert stated the cosine law for matte surfaces in his Photometria (1760). Cartographers long ago agreed to light maps from the north-west, that is, from the upper left: we expect light from above, and lit from below, mountains read as valleys. Vilayanur Ramachandran demonstrated the illusion in 1988 with simple shaded discs. In computer graphics James Blinn invented bump mapping in 1978 — perturbing only the normals, not the geometry — and that is exactly what this effect does.

What to tweak

  • “Light direction” at 135° is the familiar cartographic light from the upper left. Set it to −45° and the bumps turn into dents — the very illusion.
  • A “Light height” of 10–20° is raking light, as on the coin: edge contrast jumps.
  • A small “Bevel width” engraves fine lines; a large one makes soft cushions.
  • If the picture has dark lines on a light ground, switch on “Deboss” and the lines become raised ridges.
  • It suits Reaction–diffusion (tooled leather, coral), Cellular noise (cobbles, scales) and Maze best; “metal” over Guilloché and spirograph gives an engraved banknote or watch dial.

Parameters

Mode
emboss · light and shade · metal
Depth
How steeply the bright areas rise
Bevel width
Distance over which the slope is measured — wider is softer and rounder
Light direction
Where the lamp shines from, in degrees: 90 — from above, 180 — from the left
Light height
A low light gives long shadows and a crisp relief
Deboss
Dark becomes raised, light becomes sunken