magic-pixels
    Preparing search index...

    Function setUniform

    • Set a single uniform on a program by name. Convenience for code working with raw WebGL; the renderer uses a cached variant of the same logic.

      Parameters

      • gl: WebGL2RenderingContext

        the rendering context

      • program: WebGLProgram

        a linked program

      • name: string

        uniform name

      • value: Uniform

        the value (numbers, arrays, Vector, Matrix, Mat2/3/4, Color; a Texture is not supported here since it needs a texture unit assigned by the renderer)

      Returns boolean

      true if the uniform exists in the program and was set