VertexShader

Trait VertexShader 

Source
pub trait VertexShader<In, Uni> {
    type Output;

    // Required method
    fn shade_vertex(&self, vertex: In, uniform: Uni) -> Self::Output;
}
Expand description

Trait for vertex shaders, used to transform vertices and perform other per-vertex computations.

§Type parameters

  • In: Type of the input vertex.
  • Uni: Type of custom “uniform” (non-vertex-specific) data, such as transform matrices, passed to the shader.

Required Associated Types§

Source

type Output

The type of the output vertex.

Required Methods§

Source

fn shade_vertex(&self, vertex: In, uniform: Uni) -> Self::Output

Transforms vertex and does performs other per-vertex computations needed, outputting a new vertex of type Self::Output. Custom data that is not vertex-specific can be passed in the uniform parameter.

§Panics

shade_vertex should never panic.

Implementors§

Source§

impl<F, In, Out, Uni> VertexShader<In, Uni> for F
where F: Fn(In, Uni) -> Out,

Source§

type Output = Out

Source§

impl<In, Vs, Fs, Uni> VertexShader<In, Uni> for Shader<Vs, Fs>
where Vs: VertexShader<In, Uni>,

Source§

type Output = <Vs as VertexShader<In, Uni>>::Output