SKUniform
A container for uniform shader data.
Declaration
class SKUniformMentioned 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
init(name:)init(name:float:)init(name:float:)init(name:float:)init(name:float:)init(name:float:)init(name:float:)init(name:float:)init(name:texture:)
Reading Information About a Uniform
Reading and Writing an Uniform Object’s Value
floatValuefloatVector2ValuefloatVector3ValuefloatVector4ValuefloatMatrix2ValuefloatMatrix3ValuefloatMatrix4ValuetextureValue
Constants
Initializers
init(name:matrixFloat2x2:)init(name:matrixFloat3x3:)init(name:matrixFloat4x4:)init(name:vectorFloat2:)init(name:vectorFloat3:)init(name:vectorFloat4:)init(coder:)init(name:floatMatrix2:)init(name:floatMatrix2:)init(name:floatMatrix3:)init(name:floatMatrix3:)init(name:floatMatrix4:)init(name:floatMatrix4:)init(name:floatVector2:)init(name:floatVector2:)init(name:floatVector3:)init(name:floatVector3:)init(name:floatVector4:)init(name:floatVector4:)