pub struct Spotlight { /* private fields */ }Expand description
Lookup-table to handle the spotlight area of a light source.
Implementations§
Source§impl Spotlight
impl Spotlight
Sourcepub fn new(f: impl FnMut(f32) -> f32) -> Self
pub fn new(f: impl FnMut(f32) -> f32) -> Self
Creates a new directional spotlight.
The input of the f function is the cosine of angle from the direction of the spotlight,
while the output (between 0.0 and 1.0) is the intensity of the light in that point.
§Notes
The function takes negative and positive values as input.
Refer to Lut::from_fn for more information.
Sourcepub fn with_cutoff(cutoff_angle: f32) -> Self
pub fn with_cutoff(cutoff_angle: f32) -> Self
Creates a new directional spotlight with drastic cutoff.
Within the cutoff angle (in radians), from the direction of the spotlight, intensity is 1. Outside, intensity is 0.