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

Example

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())
};

See

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>

    Remarks

    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.