Trait Material

Source
pub trait Material: Send + Sync {
    // Required method
    fn scatter(&self, r_in: &Ray, rec: &HitRecord) -> Option<(Color, Ray)>;
}
Expand description

Material trait: determines whether scattering occurs and the scattered ray and attenuation color.

Required Methods§

Source

fn scatter(&self, r_in: &Ray, rec: &HitRecord) -> Option<(Color, Ray)>

Returns Some((attenuation, scattered_ray)) if the ray scatters, or None if it is absorbed.

Implementors§