pub struct RtMaterial { /* private fields */ }Expand description
Physically based ray-tracing material supporting Lambert/Oren-Nayar, GGX metal, clearcoat, dielectric glass/water with Beer-Lambert absorption, and area emission.
Implementations§
Source§impl RtMaterial
Physical BSDF constructors, Beer-Lambert transmittance, and euv-core material converters for RtMaterial.
impl RtMaterial
Physical BSDF constructors, Beer-Lambert transmittance, and euv-core material converters for RtMaterial.
Sourcepub fn oren_nayar(albedo: Vec3, sigma: f32) -> Self
pub fn oren_nayar(albedo: Vec3, sigma: f32) -> Self
Sourcepub fn dielectric(
albedo: Vec3,
ior: f32,
roughness: f32,
absorption: Vec3,
) -> Self
pub fn dielectric( albedo: Vec3, ior: f32, roughness: f32, absorption: Vec3, ) -> Self
Creates a refractive dielectric material (glass or water) with Schlick/Snell optics and Beer-Lambert absorption.
§Arguments
Vec3- Surface transmission/reflection albedo multiplier.f32- Index of refraction (> 1.0, e.g.,1.5for glass or1.333for water).f32- Surface microfacet roughness (0.0for crystal-clear glass).Vec3- Beer-Lambert volumetric absorption coefficientsigma_a >= 0(1 / meters).
§Returns
Self- DielectricRtMaterial.
Sourcepub fn clearcoat(
albedo: Vec3,
roughness: f32,
clearcoat: f32,
clearcoat_roughness: f32,
) -> Self
pub fn clearcoat( albedo: Vec3, roughness: f32, clearcoat: f32, clearcoat_roughness: f32, ) -> Self
Creates a clearcoat layered material combining a base diffuse/specular coat with a glossy dielectric varnish.
§Arguments
Vec3- Base linear RGB albedo.f32- Base layer roughness in[0.0, 1.0].f32- Clearcoat weight in[0.0, 1.0].f32- Clearcoat roughness in[0.0, 1.0].
§Returns
Self- Principled clearcoatRtMaterial.
Sourcepub fn principled(
albedo: Vec3,
metallic: f32,
roughness: f32,
ior: f32,
transmission: f32,
) -> Self
pub fn principled( albedo: Vec3, metallic: f32, roughness: f32, ior: f32, transmission: f32, ) -> Self
Creates a unified Principled BSDF material combining metallic, roughness, IOR, and transmission.
§Arguments
Vec3- Base linear RGB albedo.f32- Metallic factor in[0.0, 1.0].f32- Perceptual roughness in[0.0, 1.0].f32- Dielectric IOR.f32- Transmission weight in[0.0, 1.0].
§Returns
Self- PrincipledRtMaterial.
Sourcepub fn from_pbr_material(material: &PbrMaterial) -> Self
pub fn from_pbr_material(material: &PbrMaterial) -> Self
Sourcepub fn from_principled_material(material: &PrincipledMaterial3D) -> Self
pub fn from_principled_material(material: &PrincipledMaterial3D) -> Self
Sourcepub fn beer_lambert_transmittance(&self, distance: f32) -> Vec3
pub fn beer_lambert_transmittance(&self, distance: f32) -> Vec3
Sourcepub fn is_emissive(&self) -> bool
pub fn is_emissive(&self) -> bool
Sourcepub fn is_delta_specular(&self) -> bool
pub fn is_delta_specular(&self) -> bool
Source§impl RtMaterial
Implements impl #impl_generics #name #ty_generics #where_clause.
impl RtMaterial
Implements impl #impl_generics #name #ty_generics #where_clause.
pub fn get_kind(&self) -> RtMaterialKind
pub fn get_mut_kind(&mut self) -> &mut RtMaterialKind
pub fn set_kind(&mut self, val: RtMaterialKind) -> &mut Self
pub fn get_albedo(&self) -> Vec3
pub fn get_mut_albedo(&mut self) -> &mut Vec3
pub fn set_albedo(&mut self, val: Vec3) -> &mut Self
pub fn get_metallic(&self) -> f32
pub fn get_mut_metallic(&mut self) -> &mut f32
pub fn set_metallic(&mut self, val: f32) -> &mut Self
pub fn get_roughness(&self) -> f32
pub fn get_mut_roughness(&mut self) -> &mut f32
pub fn set_roughness(&mut self, val: f32) -> &mut Self
pub fn get_ior(&self) -> f32
pub fn get_mut_ior(&mut self) -> &mut f32
pub fn set_ior(&mut self, val: f32) -> &mut Self
pub fn get_transmission(&self) -> f32
pub fn get_mut_transmission(&mut self) -> &mut f32
pub fn set_transmission(&mut self, val: f32) -> &mut Self
pub fn get_absorption(&self) -> Vec3
pub fn get_mut_absorption(&mut self) -> &mut Vec3
pub fn set_absorption(&mut self, val: Vec3) -> &mut Self
pub fn get_clearcoat(&self) -> f32
pub fn get_mut_clearcoat(&mut self) -> &mut f32
pub fn set_clearcoat(&mut self, val: f32) -> &mut Self
pub fn get_clearcoat_roughness(&self) -> f32
pub fn get_mut_clearcoat_roughness(&mut self) -> &mut f32
pub fn set_clearcoat_roughness(&mut self, val: f32) -> &mut Self
pub fn get_emission(&self) -> Vec3
pub fn get_mut_emission(&mut self) -> &mut Vec3
pub fn set_emission(&mut self, val: Vec3) -> &mut Self
pub fn get_oren_nayar_sigma(&self) -> f32
pub fn get_mut_oren_nayar_sigma(&mut self) -> &mut f32
pub fn set_oren_nayar_sigma(&mut self, val: f32) -> &mut Self
Trait Implementations§
Source§impl Clone for RtMaterial
impl Clone for RtMaterial
impl Copy for RtMaterial
Source§impl Debug for RtMaterial
impl Debug for RtMaterial
Source§impl Default for RtMaterial
Default matte diffuse material constructor for RtMaterial.
impl Default for RtMaterial
Default matte diffuse material constructor for RtMaterial.
Source§impl PartialEq for RtMaterial
impl PartialEq for RtMaterial
impl StructuralPartialEq for RtMaterial
Auto Trait Implementations§
impl Forget for RtMaterial
impl Freeze for RtMaterial
impl Move for RtMaterial
impl RefUnwindSafe for RtMaterial
impl Send for RtMaterial
impl Sync for RtMaterial
impl Unpin for RtMaterial
impl UnsafeUnpin for RtMaterial
impl UnwindSafe for RtMaterial
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