pub struct LitSettings {
pub light_direction: Vec3,
pub camera_position: Vec3,
pub fog_color: Color,
pub fog_start: f32,
pub fog_end: f32,
pub ambient: f32,
}Fields§
§light_direction: Vec3World-space direction from a surface toward the directional light.
camera_position: Vec3§fog_color: Color§fog_start: f32§fog_end: f32§ambient: f32Implementations§
Source§impl LitSettings
impl LitSettings
Sourcepub fn sanitized(self) -> LitSettings
pub fn sanitized(self) -> LitSettings
Normalize the light and bound user-supplied settings once per material begin. Nonfinite settings use their defaults; a zero light direction is ambient-only.
Sourcepub fn shade_vertex(self, position: Vec3, normal: Vec3, color: Color) -> Color
pub fn shade_vertex(self, position: Vec3, normal: Vec3, color: Color) -> Color
Shade an already world-transformed position and normal, retaining alpha.
Pass settings through Self::sanitized before a batch so the light is
normalized once. Normals may be unnormalized or zero. Reversed/coincident
fog bounds become a 0.001-unit transition starting at fog_start.
Trait Implementations§
Source§impl Clone for LitSettings
impl Clone for LitSettings
Source§fn clone(&self) -> LitSettings
fn clone(&self) -> LitSettings
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LitSettings
impl Debug for LitSettings
Source§impl Default for LitSettings
impl Default for LitSettings
Source§fn default() -> LitSettings
fn default() -> LitSettings
Returns the “default value” for a type. Read more
Source§impl PartialEq for LitSettings
impl PartialEq for LitSettings
impl Copy for LitSettings
impl StructuralPartialEq for LitSettings
Auto Trait Implementations§
impl Freeze for LitSettings
impl RefUnwindSafe for LitSettings
impl Send for LitSettings
impl Sync for LitSettings
impl Unpin for LitSettings
impl UnwindSafe for LitSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more