---
title: shader
framework: spritekit
role: symbol
role_heading: Instance Property
path: spritekit/skspritenode/shader
---

# shader

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

## Declaration

```swift
var shader: SKShader? { get set }
```

## Mentioned in

Applying Shaders to a Sprite

## Discussion

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: Animations on alpha. SKTexture filteringMode. Light from SKLightNode. 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](spritekit/applying-shaders-to-a-sprite.md)
- [attributeValues](spritekit/skspritenode/attributevalues.md)
- [setValue(_:forAttribute:)](spritekit/skspritenode/setvalue(_:forattribute:).md)
- [value(forAttributeNamed:)](spritekit/skspritenode/value(forattributenamed:).md)
