pub struct Material {Show 16 fields
pub id: u64,
pub name: String,
pub shading_model: ShadingModel,
pub blend_mode: BlendMode,
pub properties: PbrProperties,
pub texture_slots: HashMap<String, TextureSlot>,
pub two_sided: bool,
pub depth_write: bool,
pub depth_test: bool,
pub stencil_mask: u8,
pub render_queue: i32,
pub shader_override: Option<String>,
pub tags: Vec<String>,
pub parent_material: Option<u64>,
pub instance_params: HashMap<String, Vec4>,
pub is_variant: bool,
}Fields§
§id: u64§name: String§shading_model: ShadingModel§blend_mode: BlendMode§properties: PbrProperties§texture_slots: HashMap<String, TextureSlot>§two_sided: bool§depth_write: bool§depth_test: bool§stencil_mask: u8§render_queue: i32§shader_override: Option<String>§parent_material: Option<u64>§instance_params: HashMap<String, Vec4>§is_variant: boolImplementations§
Source§impl Material
impl Material
pub fn new(id: u64, name: impl Into<String>) -> Self
pub fn new_unlit(id: u64, name: impl Into<String>, color: Vec4) -> Self
pub fn new_emissive( id: u64, name: impl Into<String>, emissive: Vec3, intensity: f32, ) -> Self
pub fn new_glass(id: u64, name: impl Into<String>) -> Self
pub fn set_texture(&mut self, slot: &str, id: u64)
pub fn has_texture(&self, slot: &str) -> bool
pub fn requires_alpha_pass(&self) -> bool
pub fn generate_shader_defines(&self) -> String
pub fn permutation_hash(&self) -> u64
Trait Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.