Contents

addUniform(_:)

Adds a uniform to the shader.

Declaration

func addUniform(_ uniform: SKUniform)

Parameters

  • uniform:

    The new uniform object to add. The uniform object’s name must not already be in use by another uniform attached to the shader.

Discussion

The uniform variable is automatically accessible inside your shader; do not add a declaration for it in your shader’s source code. The uniform must be accessed in the fragment shader.

See Also

Providing Uniform Data to a Shader