pub struct Material {
pub albedo_color: Color,
pub albedo_texture: Option<TextureData>,
pub normal_texture: Option<TextureData>,
pub metallic: f32,
pub roughness: f32,
pub emissive: Color,
pub alpha_mode: AlphaMode,
pub tint: Color,
pub double_sided: bool,
}Fields§
§albedo_color: Color§albedo_texture: Option<TextureData>§normal_texture: Option<TextureData>§metallic: f32§roughness: f32§emissive: Color§alpha_mode: AlphaMode§tint: ColorColorization: multiply sampled color by this tint.
double_sided: boolImplementations§
Source§impl Material
impl Material
pub fn new(color: Color) -> Self
pub fn with_texture(self, tex: TextureData) -> Self
pub fn with_metallic_roughness(self, m: f32, r: f32) -> Self
pub fn with_alpha(self, mode: AlphaMode) -> Self
pub fn with_emissive(self, c: Color) -> Self
Sourcepub fn sample_albedo(&self, u: f32, v: f32) -> Color
pub fn sample_albedo(&self, u: f32, v: f32) -> Color
Sample the effective albedo at texture coordinates (u, v).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Material
impl<'de> Deserialize<'de> for Material
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Material
impl RefUnwindSafe for Material
impl Send for Material
impl Sync for Material
impl Unpin for Material
impl UnsafeUnpin for Material
impl UnwindSafe for Material
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