pub trait Material: Send + Sync {
    // Required methods
    fn next_ray(&self, ray: Ray, hit: Hit, rng: &mut TlsWyRand) -> Option<Ray>;
    fn get_color(&self, uv: Point2) -> (Color, Color);
}
Expand description

Characterize optical properties of a surface.

Required Methods§

source

fn next_ray(&self, ray: Ray, hit: Hit, rng: &mut TlsWyRand) -> Option<Ray>

Generate the next ray to be traced.

If the path is to be terminated, None is returned.

source

fn get_color(&self, uv: Point2) -> (Color, Color)

Return the color at the given UV coordinates.

The first item is the reflected color, the second item is the emitted color.

Implementors§