Instance Method

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

func removeUniformNamed(String)

Removes a uniform from the shader.

var uniforms: [SKUniform]

The list of uniforms associated with the shader.

func uniformNamed(String) -> SKUniform?

Returns the uniform object corresponding to a particular uniform variable.