1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use crateColor;
/// Area light shaped like a rectangle — a softbox, a window, a strip.
///
/// Shaded as an area light, not as an approximation: the diffuse term is the
/// exact form factor over the quad, and the specular is a representative point
/// on the rectangle with the lobe widened by the light's angular size, so a
/// large panel gives a large soft highlight and a narrow one gives a hard
/// line. Anisotropy and iridescence apply, because it goes through the same
/// BRDF as every other light.
///
/// It emits along its local **−Z** and is single-sided, like three.js: a
/// surface behind it receives nothing. Orient it with the object's rotation.
///
/// This is what to reach for when a punctual light is doing nothing. Metal has
/// no diffuse term — it mirrors what is around it rather than responding to a
/// light — so a zero-area source contributes a near-delta specular that a
/// roughness of 0.25 all but swallows. An area light is something a rail can
/// actually reflect.