Trait Material

Source
pub trait Material: Pack + Instance<MaterialClass> {
    // Required method
    fn brightness(&self) -> f64;

    // Provided method
    fn color_with(self, color: Vector3<f64>) -> Colored<Self> { ... }
}
Expand description

Material of an object surface.

It specifies the way how does ray bounce off the surface. It defines the color, specularity, opacity, diffusion, radiance and other properties of the object surface.

Required Methods§

Source

fn brightness(&self) -> f64

Brightness of the material.

If the material emits some light, the brightnes is equal to maximal color component in the light emitted, otherwise it is zero.

Provided Methods§

Source

fn color_with(self, color: Vector3<f64>) -> Colored<Self>

Applies color filter to the material

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§