Instance Property

shader

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

Declaration

@property(nonatomic, retain) SKShader *shader;

Discussion

The default value is nil, which means the default behavior for sprite rendering is performed. SpriteKit implements many sprite features using a default shader, such as:

If you supply a custom value for shader, your custom shader overrides the default shader which neutralizes the default features. It is the responsibility of your custom shader to implement any of the features your sprites require.

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.

attributeValues

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

- setValue:forAttributeNamed:

Sets an attribute value for an attached shader.

- valueForAttributeNamed:

Sets the value of a shader attribute.