API Docs for:
Show:

gs.Effect Class

A class to handle Open/GLSL shader-based effect. It is important to not confuse this class with gs.GraphicEffect, which is for own custom shader-based effects. This class is for internal usage only and encapsulates the OpenGL shader program. You should not create instance of this class manually.

Constructor

gs.Effect

()

Methods

setFloatValue

(
  • name
  • value
)

Sets a float uniform value.

Parameters:

  • name String
    • The name of the uniform to set.
  • value Number
    • The float value to set as the uniform's value.

setFloatValues

(
  • name
  • value
)

Sets an array of floats.

Parameters:

  • name String
    • The name of the uniform to set.
  • value Number
    • The float values to set as the uniform's value.

setIntegerValue

(
  • name
  • value
)

Sets an integer uniform value.

Parameters:

  • name String
    • The name of the uniform to set.
  • value Number
    • The integer value to set as the uniform's value.

setIntegerValues

(
  • name
  • values
)

Sets an array of integers.

Parameters:

  • name String
    • The name of the uniform to set.
  • values Number
    • The integer values to set as the uniform's value.

setMatrixValue

(
  • name
  • value
)

Sets a mat4 uniform value.

Parameters:

  • name String
    • The name of the uniform to set.
  • value Number
    • The matrix to set as the uniform's value.

setVector2Value

(
  • name
  • v1
  • v2
)

Sets a vec2 uniform value.

Parameters:

  • name String
    • The name of the uniform to set.
  • v1 Number
    • The x-coordinate of the vec2 value to set as the uniform's value.
  • v2 Number
    • The y-coordinate of the vec2 value to set as the uniform's value.

setVector2Value

(
  • name
  • values
)

Sets an uniform array of vec2 values.

Parameters:

  • name String
    • The name of the uniform to set.
  • values Number
    • An array of coordinate-pairs to set as the uniforms value.

setVector3Value

(
  • name
  • v1
  • v2
  • v3
)

Sets a vec3 uniform value.

Parameters:

  • name String
    • The name of the uniform to set.
  • v1 Number
    • The x-coordinate of the vec3 value to set as the uniform's value.
  • v2 Number
    • The y-coordinate of the vec3 value to set as the uniform's value.
  • v3 Number
    • The z-coordinate of the vec3 value to set as the uniform's value.

setVector3Value

(
  • name
  • values
)

Sets an uniform array of vec3 values.

Parameters:

  • name String
    • The name of the uniform to set.
  • values Number
    • An array of coordinate-pairs to set as the uniforms value.

setVector4Value

(
  • name
  • v1
  • v2
  • v3
  • v4
)

Sets a vec4 uniform value.

Parameters:

  • name String
    • The name of the uniform to set.
  • v1 Number
    • The x-coordinate of the vec4 value to set as the uniform's value.
  • v2 Number
    • The y-coordinate of the vec4 value to set as the uniform's value.
  • v3 Number
    • The z-coordinate of the vec4 value to set as the uniform's value.
  • v4 Number
    • The w-coordinate of the vec4 value to set as the uniform's value.

setVector4Value

(
  • name
  • values
)

Sets an uniform array of vec4 values.

Parameters:

  • name String
    • The name of the uniform to set.
  • values Number
    • An array of coordinate-pairs to set as the uniforms value.