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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
use *;
/// Describes the kind of light source being represented.
///
/// ## Direction convention
///
/// Every direction a [`Light`] carries is measured **toward the light
/// source**, with one deliberate exception:
///
/// - [`LightType::Directional`]: `direction` points from the surface
/// toward the light (sourceward), so a surface is lit when
/// `dot(normal, direction) > 0`.
/// - [`LightType::Point`]: the direction is derived from
/// `position - surface_point` at shading time and is also sourceward;
/// the light stores no direction of its own.
/// - [`LightType::Spot`]: `direction` points **outward along the cone
/// axis**, away from the lamp, i.e. the way the light travels. The
/// surface→light vector used for shading is its negation. This is the
/// opposite sense from the other two kinds, so a spot light's cone axis
/// and a spot light's shading direction are *not* the same vector.
/// Describes the shading model applied to a [`Material`] during lighting and
/// ray-tracing evaluation.