Uniforms are global GLSL variables. They are passed to shader programs.

When declaring a uniform of a ShaderMaterial, it is declared by value or by object.

uniforms: {
time: {
value: 1.0
},
resolution: new Uniform(new Vector2())
};

Type Parameters

  • T = any

Constructors

Properties

Methods

Constructors

  • Create a new instance of Uniform

    Type Parameters

    • T = any

    Parameters

    • value: T

      An object containing the value to set up the uniform. It's type must be one of the Uniform Types described above.

    Returns Uniform<T>

Properties

value: T

Current value of the uniform.

Methods

  • Returns a clone of this uniform.

    Returns Uniform<T>

    If the uniform's value property is an Object | Object with a clone() method, this is used, otherwise the value is copied by assignment Array values are shared between cloned THREE.UniformUniform | Uniforms.