pub struct LambertMaterial {
pub name: String,
pub color: Color,
pub color_texture: Option<TextureId>,
pub emissive: Vec3,
pub alpha_mode: AlphaMode,
pub double_sided: bool,
}Expand description
Diffuse-only material for fast lit surfaces.
Fields§
§name: StringHuman-readable material name.
color: ColorDiffuse color in linear RGBA.
color_texture: Option<TextureId>Optional diffuse color texture.
emissive: Vec3Emissive RGB color in linear space.
alpha_mode: AlphaModeAlpha behavior.
double_sided: boolWhether the material is rendered double-sided.
Implementations§
Source§impl LambertMaterial
impl LambertMaterial
Sourcepub fn new() -> LambertMaterial
pub fn new() -> LambertMaterial
Creates a default opaque white Lambert material.
Sourcepub const fn color(self, color: Color) -> LambertMaterial
pub const fn color(self, color: Color) -> LambertMaterial
Returns this material with a diffuse color.
Trait Implementations§
Source§impl Clone for LambertMaterial
impl Clone for LambertMaterial
Source§fn clone(&self) -> LambertMaterial
fn clone(&self) -> LambertMaterial
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 LambertMaterial
impl Debug for LambertMaterial
Source§impl Default for LambertMaterial
impl Default for LambertMaterial
Source§fn default() -> LambertMaterial
fn default() -> LambertMaterial
Returns the “default value” for a type. Read more
Source§impl Material for LambertMaterial
impl Material for LambertMaterial
Source§fn pipeline_key(&self) -> PipelineKey
fn pipeline_key(&self) -> PipelineKey
Returns the renderer pipeline selector for this material state.
Source§fn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
Returns whether the material should be rendered in a transparent path.
Source§fn double_sided(&self) -> bool
fn double_sided(&self) -> bool
Returns whether back-face culling should be disabled.
Source§fn alpha_cutoff(&self) -> Option<f32>
fn alpha_cutoff(&self) -> Option<f32>
Returns the alpha-test cutoff for masked materials.
Source§impl PartialEq for LambertMaterial
impl PartialEq for LambertMaterial
impl StructuralPartialEq for LambertMaterial
Auto Trait Implementations§
impl Freeze for LambertMaterial
impl RefUnwindSafe for LambertMaterial
impl Send for LambertMaterial
impl Sync for LambertMaterial
impl Unpin for LambertMaterial
impl UnsafeUnpin for LambertMaterial
impl UnwindSafe for LambertMaterial
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