Shader:getUniform

From Wake
Jump to: navigation, search

Get a Uniform for this shader.

Function

Synopsis

uniform = Shader:getUniform(name)

Arguments

string name

The name of the uniform.

Returns

Uniform uniform

The uniform. If the uniform doesn't exist or there is an error, this will be nil.

Saving Uniforms

It is good practice to save the result of this function, as calling it is more expensive than using an existing result.

Gotchas

If the Shader object is garbage collected (falls out of scope, or you lose the reference to it), the uniform object will no longer be valid.

See Also