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.