pub struct Material {Show 21 fields
pub rgb: F3,
pub anisotropic: F,
pub emission: F3,
pub metallic: F,
pub roughness: F,
pub subsurface: F,
pub specular_tint: F,
pub sheen: F,
pub sheen_tint: F,
pub clearcoat: F,
pub clearcoat_gloss: F,
pub clearcoat_roughness: F,
pub spec_trans: F,
pub ior: F,
pub opacity: F,
pub alpha_mode: AlphaMode,
pub alpha_cutoff: F,
pub ax: F,
pub ay: F,
pub medium: Medium,
pub procedural: Option<FnPtr>,
}
Expand description
The material struct holds all BSDF properties as well as the Medium.
Fields§
§rgb: F3
§anisotropic: F
§emission: F3
§metallic: F
§roughness: F
§subsurface: F
§specular_tint: F
§sheen: F
§sheen_tint: F
§clearcoat: F
§clearcoat_gloss: F
§clearcoat_roughness: F
Do not use clearcoat_roughness directly, it is for internal use only. Use clearcoat_gloss.
spec_trans: F
§ior: F
§opacity: F
§alpha_mode: AlphaMode
§alpha_cutoff: F
§ax: F
§ay: F
§medium: Medium
§procedural: Option<FnPtr>
Implementations§
Source§impl Material
impl Material
pub fn new() -> Self
Sourcepub fn finalize(&mut self)
pub fn finalize(&mut self)
Material post-processing, called by the tracer after calling Scene::closest_hit()
Sourcepub fn mix(&self, other: &Material, v: F) -> Material
pub fn mix(&self, other: &Material, v: F) -> Material
Mixes this material with another material
pub fn get_rgb(&mut self) -> F3
pub fn set_rgb(&mut self, new_val: F3)
pub fn get_emission(&mut self) -> F3
pub fn set_emission(&mut self, new_val: F3)
pub fn get_anisotropic(&mut self) -> F
pub fn set_anisotropic(&mut self, new_val: F)
pub fn get_metallic(&mut self) -> F
pub fn set_metallic(&mut self, new_val: F)
pub fn get_roughness(&mut self) -> F
pub fn set_roughness(&mut self, new_val: F)
pub fn get_subsurface(&mut self) -> F
pub fn set_subsurface(&mut self, new_val: F)
pub fn get_specular_tint(&mut self) -> F
pub fn set_specular_tint(&mut self, new_val: F)
pub fn get_sheen(&mut self) -> F
pub fn set_sheen(&mut self, new_val: F)
pub fn get_sheen_tint(&mut self) -> F
pub fn set_sheen_tint(&mut self, new_val: F)
pub fn get_clearcoat(&mut self) -> F
pub fn set_clearcoat(&mut self, new_val: F)
pub fn get_clearcoat_gloss(&mut self) -> F
pub fn set_clearcoat_gloss(&mut self, new_val: F)
pub fn get_spec_trans(&mut self) -> F
pub fn set_spec_trans(&mut self, new_val: F)
pub fn get_ior(&mut self) -> F
pub fn set_ior(&mut self, new_val: F)
pub fn get_procedural(&mut self) -> FnPtr
pub fn set_procedural(&mut self, new_val: FnPtr)
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<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<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Variant for T
impl<T> Variant for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert this
Variant
trait object to &mut dyn Any
.Source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Convert this
Variant
trait object to Box<dyn Any>
.