Trait gfx_phase::Technique [] [src]

pub trait Technique<R: Resources, M: Material, V: ToDepth> {
    type Kernel: Copy + Debug + Eq + Hash;
    type Params: ShaderParam<Resources = R>;
    fn test(&self, _: &Mesh<R>, _: &M) -> Option<Self::Kernel>;
    fn compile<'a>(&'a self, _: Self::Kernel) -> TechResult<'a, R, Self::Params>;
    fn fix_params(&self, _: &M, _: &V, _: &mut Self::Params);

Technique is basically a Fn(Entity) -> Option<TechResult>. It processes a material, checks for the compatibility, adds a mesh to produce a shader program with associated data (state, parameters).

Associated Types

The most important part of the entity, which is enough to decide which program or state to use on it.

Associated shader parameters.

Required Methods

Test if this mesh/material can be drawn using the technique.

Compile a given kernel by producing a program, parameter block, a draw state, and optional instancing data.

Fix the shader parameters, using an updated material and view info. Called every time before a batch is added to the draw queue.