Selected work

WebGL study, six surface finishes under one light.

Drag to turn the rings

Polished steel

Each smaller ring is one step rougher. Large, middle and small ring: 0.08 0.24 0.40

Reflects 62% of the light seen straight on

Loading the rings

Roughness, metal and clear coat

Roughness

The rougher the surface, the wider and softer the highlight.

0.050.300.600.90

Metal

On metal the colour is in the reflection. On paint it is in the surface and the highlight stays white.

Metal 1.00Metal 0.00

Clear coat

A clear top layer adds sharp highlights at the edges of the paint.

No coatClear coat
Fragment shader, excerptPlain WebGL, no libraries
vec3 F0   = mix(vec3(.04), base, metal);            // how much it reflects straight on
vec3 F    = F0 + (1. - F0) * pow(1. - ndv, 5.);      // and more at the edges
vec3 diff = base * (1. - metal) * (.10 + .9 * ndl);  // surface colour, none on metal
vec3 refl = room(r, rough) * F;                      // the light and room, blurred by roughness
vec3 top  = room(r, .03) * (.04 + .96 * pow(1. - ndv, 5.)) * coat;
gl_FragColor = vec4(tone(diff + refl + top), 1.);