pub struct MaterialParams {
pub name: String,
pub reflectance_pct: f64,
pub ior: f64,
pub transmittance_pct: f64,
pub thickness_mm: f64,
pub diffusion_pct: f64,
}Expand description
Material description using manufacturer datasheet values.
These are the values you find on a material datasheet. A lighting designer can fill these in without understanding Monte Carlo internals.
Fields§
§name: StringHuman-readable name, e.g. “PMMA opal 3mm”.
reflectance_pct: f64Reflexionsgrad [%], 0-100.
How much light is reflected at the surface. For opaque materials: total reflectance (diffuse + specular combined). For transparent materials: Fresnel reflectance is computed from IOR, this field is ignored (set to 0).
ior: f64Brechungsindex (index of refraction).
How much light bends when entering the material. PMMA: 1.49, glass: 1.52, polycarbonate: 1.585. Set to 0.0 for opaque materials (metal, paint).
transmittance_pct: f64Lichtdurchlässigkeit [%], 0-100 at the given thickness.
How much light passes through (measured at normal incidence). 0 = fully opaque, 92 = clear PMMA 3mm, 50 = heavy opal PMMA 3mm.
thickness_mm: f64Dicke [mm].
Material thickness. Affects volume scattering path length and Beer-Lambert absorption. Ignored for opaque materials.
diffusion_pct: f64Streuungsgrad [%], 0-100.
Degree of light diffusion/scattering.
- 0 = perfectly clear (or mirror-specular for opaque)
- 25 = satin/frosted
- 60 = light opal
- 95 = heavy opal (near-Lambertian exit distribution)
- 100 = fully diffuse (matte paint for opaque)
Maps directly to haze values in datasheets (e.g. Evonik Plexiglas).
Implementations§
Source§impl MaterialParams
impl MaterialParams
Sourcepub fn to_material(&self) -> Material
pub fn to_material(&self) -> Material
Convert user-facing parameters to internal physics Material.
Trait Implementations§
Source§impl Clone for MaterialParams
impl Clone for MaterialParams
Source§fn clone(&self) -> MaterialParams
fn clone(&self) -> MaterialParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for MaterialParams
impl RefUnwindSafe for MaterialParams
impl Send for MaterialParams
impl Sync for MaterialParams
impl Unpin for MaterialParams
impl UnsafeUnpin for MaterialParams
impl UnwindSafe for MaterialParams
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
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>
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>
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<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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.