Shader.uniform

Set as an uniform.

  1. Shader uniform(string name, V v)
  2. Shader uniform(string name, M m)
  3. Shader uniform(string name, Args v)
  4. Shader uniform(string name, Args v)
    class Shader
    uniform
    (
    Args...
    )
    (
    in string name
    ,
    Args v
    )
    if (
    0 < Args.length &&
    Args.length <= 4
    &&
    __traits(isArithmetic, Args[0])
    &&
    !is(Args[0] == bool)
    )

Examples

// Set variables to glsl uniform named "v".
float a = 1.0;
float b = 2.0;
float c = 3.0;
shader.setUniform("v", a, b, c);

Meta