Skip to main content

Shader

Trait Shader 

Source
pub trait Shader<Uniforms, Space: CoordinateSpace, Pixel>: Send {
    // Required method
    fn draw(
        &self,
        surface_coords: &Coordinates<Space>,
        uniforms: &Uniforms,
    ) -> Pixel;
}
Expand description

Function type that can provide an RGB color given a location in Virtual space and global rendering state

Required Methods§

Source

fn draw( &self, surface_coords: &Coordinates<Space>, uniforms: &Uniforms, ) -> Pixel

Turns a Virtual coordinate into a real pixel color

Implementors§

Source§

impl<T, U, Space: CoordinateSpace, Pixel> Shader<U, Space, Pixel> for T
where T: Send + Fn(&Coordinates<Space>, &U) -> Pixel,