Instance Property


The values of each attribute associated with the node's attached shader.


@property(nonatomic, copy) NSDictionary<NSString *,SKAttributeValue *> *attributeValues;


All nodes have their own copy of an attribute value and therefore the attribute values can be different per-node across the same SKShader. If instead you need all nodes to share the same value, use SKUniform. Uniforms can change values every frame, but uniforms cannot vary per-node like attributes can.

See Also

Adding a Custom Shader to a Sprite

Applying Shaders to a Sprite

Write custom GLSL code that modifies the look of your sprite.


A text file that defines code that does custom per-pixel drawing or colorization.

- setValue:forAttributeNamed:

Sets an attribute value for an attached shader.

- valueForAttributeNamed:

Sets the value of a shader attribute.