uniform

vgl. uniform

new uniform(type, name) → {vgl.uniform}

Description:
  • Create a new instance of class uniform.

Source:
Parameters:
Name Type Description
type number

The GL type, such as FLOAT or INT.

name string

The name of the uniform.

Returns:

OpenGL uniform encapsulation

Type
vgl.uniform

Methods

callGL(renderState, location)

Description:
  • Call GL and pass updated values to the current shader.

Source:
Parameters:
Name Type Description
renderState vgl.renderState

The current render state with the current context.

location number

The context location.

name() → {string}

Description:
  • Get name of the uniform.

Source:
Returns:
Type
string

set(value)

Description:
  • Set value of the uniform.

Source:
Parameters:
Name Type Description
value Array | number

update(renderState, program)

Description:
  • Virtual method to update the uniform.

    Should be implemented by the derived class.

Source:
Parameters:
Name Type Description
renderState vgl.renderState
program vgl.shaderProgram