pub struct PbrMaterial { /* private fields */ }
Expand description
A physically-based rendered material with full set of textures
Implementations§
Source§impl PbrMaterial
impl PbrMaterial
Sourcepub fn of_rgba(rgba: u32) -> Self
pub fn of_rgba(rgba: u32) -> Self
Create a new BaseMaterial of an RGB color and alpha
Sourcepub fn set_emissive_rgb(&mut self, (r, g, b): (u8, u8, u8))
pub fn set_emissive_rgb(&mut self, (r, g, b): (u8, u8, u8))
Set the emission RGB
Sourcepub fn set_mr(&mut self, metallic: f32, roughness: f32)
pub fn set_mr(&mut self, metallic: f32, roughness: f32)
Set the metallicness and roughness value for the BaseMaterial
Sourcepub fn set_base_data(&mut self, base_data: &BaseData)
pub fn set_base_data(&mut self, base_data: &BaseData)
Set the base data
Sourcepub fn set_texture(&mut self, aspect: MaterialAspect, index: ShortIndex)
pub fn set_texture(&mut self, aspect: MaterialAspect, index: ShortIndex)
Set a texture (currently just base texture) to an index in the Textures of an object
Trait Implementations§
Source§impl Debug for PbrMaterial
impl Debug for PbrMaterial
Source§impl Default for PbrMaterial
impl Default for PbrMaterial
Source§fn default() -> PbrMaterial
fn default() -> PbrMaterial
Returns the “default value” for a type. Read more
Source§impl Material for PbrMaterial
impl Material for PbrMaterial
Source§fn base_data(&self) -> &BaseData
fn base_data(&self) -> &BaseData
Borrow the basic data of a material - color and base
metallic/roughness, for example
Source§fn texture(&self, aspect: MaterialAspect) -> ShortIndex
fn texture(&self, aspect: MaterialAspect) -> ShortIndex
Get the index into the Textures array for a specific aspect
Auto Trait Implementations§
impl Freeze for PbrMaterial
impl RefUnwindSafe for PbrMaterial
impl Send for PbrMaterial
impl Sync for PbrMaterial
impl Unpin for PbrMaterial
impl UnwindSafe for PbrMaterial
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