FragmentShader

Trait FragmentShader 

Source
pub trait FragmentShader<Var> {
    // Required method
    fn shade_fragment(&self, frag: Frag<Var>) -> Option<Color4>;
}
Expand description

Trait for fragment shaders, used to compute the color of each individual pixel, or fragment, rendered.

§Type parameters

  • Var: The varying of the input fragment.

Required Methods§

Source

fn shade_fragment(&self, frag: Frag<Var>) -> Option<Color4>

Computes the color of frag. Returns either Some(color), or None if the fragment should be discarded.

§Panics

shade_fragment should never panic.

Implementors§

Source§

impl<F, Var, Out> FragmentShader<Var> for F
where F: Fn(Frag<Var>) -> Out, Out: Into<Option<Color4>>,

Source§

impl<Vs, Fs, Var> FragmentShader<Var> for Shader<Vs, Fs>
where Fs: FragmentShader<Var>,