Contents

SKUniform

A container for uniform shader data.

Declaration

class SKUniform

Mentioned in

Overview

An SKUniform object is used to hold uniform data for a custom OpenGL or OpenGL ES shader. The uniform data is accessible from all shaders that include the uniform.To use a uniform variable in your shader, create the SKUniform object and set its initial value. Once its value is specified, the uniformType property changes to match the type of the initial value you provided and can never change afterward. To use the uniform object, add it to an SKShader object that needs to access the uniform variable. To update the uniform variable’s value, choose the appropriate property on the uniform object based on the data type it encapsulates.

Topics

Creating and Initializing Uniform Objects

Reading Information About a Uniform

Reading and Writing an Uniform Object’s Value

Constants

Initializers

Instance Properties

See Also

Shaders