pub struct Material {
pub albedo: [f32; 3],
pub kind: MaterialType,
}Expand description
A surface material with albedo colour and scattering type.
Fields§
§albedo: [f32; 3]Base colour of the material (RGB in [0,1]).
kind: MaterialTypeScattering behaviour.
Implementations§
Source§impl Material
impl Material
Sourcepub fn lambertian(albedo: [f32; 3]) -> Self
pub fn lambertian(albedo: [f32; 3]) -> Self
Create a Lambertian (diffuse) material.
Sourcepub fn dielectric(ior: f32) -> Self
pub fn dielectric(ior: f32) -> Self
Create a dielectric (glass) material.
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
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 more