pub struct Material {Show 19 fields
pub name: String,
pub color: [f32; 3],
pub albedo: Option<Texture>,
pub transparency: f32,
pub normal: Option<Texture>,
pub normal_strength: f32,
pub roughness: Option<Texture>,
pub roughness_strength: f32,
pub metallic: Option<Texture>,
pub metallic_strength: f32,
pub emissive: Option<Texture>,
pub emissive_strength: f32,
pub shader: Shader,
pub display: Display<WindowSurface>,
pub program: Program,
pub time: f32,
pub matrix: [[f32; 4]; 4],
pub render_transparent: bool,
pub uuid: Uuid,
/* private fields */
}
Fields§
§name: String
§color: [f32; 3]
§albedo: Option<Texture>
§transparency: f32
§normal: Option<Texture>
§normal_strength: f32
§roughness: Option<Texture>
§roughness_strength: f32
§metallic: Option<Texture>
§metallic_strength: f32
§emissive: Option<Texture>
§emissive_strength: f32
§shader: Shader
§display: Display<WindowSurface>
§program: Program
§time: f32
§matrix: [[f32; 4]; 4]
§render_transparent: bool
§uuid: Uuid
Implementations§
Source§impl Material
impl Material
pub fn default(shader: Shader, display: &Display<WindowSurface>) -> Self
pub fn from_serializer( serializer: MaterialSerializer, display: &Display<WindowSurface>, ) -> Self
pub fn to_serializer(&self) -> MaterialSerializer
pub fn new( shader: Shader, display: Display<WindowSurface>, color: Option<[f32; 3]>, albedo: Option<Texture>, normal: Option<Texture>, normal_strength: Option<f32>, roughness: Option<Texture>, roughness_strength: Option<f32>, metallic: Option<Texture>, metallic_strength: Option<f32>, emissive: Option<Texture>, emissive_strength: Option<f32>, ) -> Self
pub fn set_name(&mut self, name: &str)
pub fn set_transparency(&mut self, transparent: bool)
pub fn set_emissive(&mut self, emissive: Texture)
pub fn set_emissive_strength(&mut self, emissive_strength: f32)
pub fn set_color(&mut self, color: [f32; 3])
pub fn set_shader(&mut self, shader: Shader)
pub fn set_albedo(&mut self, albedo: Texture)
pub fn set_normal(&mut self, normal: Texture)
pub fn set_transparency_strength(&mut self, transparency: f32)
pub fn set_normal_strength(&mut self, normal_strength: f32)
pub fn set_roughness(&mut self, roughness: Texture)
pub fn set_roughness_strength(&mut self, roughness_strength: f32)
pub fn set_metallic(&mut self, metallic: Texture)
pub fn set_metallic_strength(&mut self, metallic_strength: f32)
pub fn set_texture_from_file(&mut self, path: &str, texture_type: TextureType)
pub fn set_texture_from_resource( &mut self, data: &[u8], texture_type: TextureType, )
pub fn set_texture(&mut self, texture: Texture, texture_type: TextureType)
pub fn lit_pbr(display: Display<WindowSurface>, transparency: bool) -> Self
pub fn unlit(display: Display<WindowSurface>, transparency: bool) -> Self
pub fn get_uniforms<'a>( &'a self, lights: &Vec<Light>, ambient_light: Option<Light>, camera: Option<Camera>, _bone_transforms: &'a UniformBuffer<BoneTransforms>, _has_skeleton: bool, skybox: &'a Texture, ) -> impl Uniforms + 'a
pub fn update(&mut self)
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 !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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.