pub enum Light {
Directional {
direction: Vector3<f32>,
color: Vector3<f32>,
intensity: f32,
},
Point {
position: Vector3<f32>,
color: Vector3<f32>,
intensity: f32,
},
Spot {
position: Vector3<f32>,
direction: Vector3<f32>,
color: Vector3<f32>,
intensity: f32,
inner_cone_angle: f32,
outer_cone_angle: f32,
},
}Expand description
Represents a light.
Variants§
Directional
Directional lights are light sources that act as though they are
infinitely far away and emit light in the direction. Because it is at
an infinite distance, the light is not attenuated. Its intensity is
defined in lumens per metre squared, or lux (lm/m2).
Fields
Point
Point lights emit light in all directions from their position in space;
The brightness of the light attenuates in a physically correct manner as
distance increases from the light’s position (i.e. brightness goes like
the inverse square of the distance). Point light intensity is defined in
candela, which is lumens per square radian (lm/sr).
Fields
Spot
Spot lights emit light in a cone in direction. The angle and falloff
of the cone is defined using two numbers, the inner_cone_angle and
outer_cone_angle. As with point lights, the brightness also attenuates
in a physically correct manner as distance increases from the light’s
position (i.e. brightness goes like the inverse square of the distance).
Spot light intensity refers to the brightness inside the
inner_cone_angle (and at the location of the light) and is defined in
candela, which is lumens per square radian (lm/sr). Engines that don’t
support two angles for spotlights should use outer_cone_angle as the
spotlight angle (leaving inner_cone_angle to implicitly be 0).