pub struct SpotLight {
pub position: Vec3,
pub radius: f32,
pub color: Vec3,
pub direction: Vec3,
pub inner_angle: f32,
pub outer_angle: f32,
pub fill: bool,
}Expand description
A point light with a cone over it.
Fields§
§position: Vec3Where it is, in render space.
radius: f32How far its influence reaches, on PointLight::radius’s terms exactly.
color: Vec3Colour premultiplied by intensity.
direction: Vec3The direction the cone points along, away from the light.
The opposite convention from DirectionalLight::direction, and
deliberately: a spot points at something and a sun comes from
somewhere, so each field is the vector a caller has. The shader is what
reconciles them, and its spot_cone says where the negation is.
Normalised on the way into the row.
inner_angle: f32Half-angle of the cone’s bright core, in radians. Full brightness inside.
outer_angle: f32Half-angle at which the cone closes, in radians. Dark outside.
Must be at least inner_angle; Light::row
widens it to that if it is not, rather than emitting a row whose two
cosines the shader would divide the wrong way round.
fill: boolWhether this is a fill light, on PointLight::fill’s terms
exactly: it lights, casts no shadow and adds no specular.