A Boolean value that indicates whether the results of rendering the child nodes should be cached.
SDKs
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
Framework
- Sprite
Kit
Declaration
var shouldRasterize: Bool { get set }
Discussion
If the value of this property is true
, the effect node caches the filtered image for use in future frames. If the value is false
, then SpriteKit discards the rendered image and redraws it from scratch the next time the node is rendered. The default value is false
. Caching the rendered image uses more memory and may take more time to render. However, if the effect node’s descendants rarely change, caching can improve performance.
When caching is enabled, changes to the effect node’s children trigger updates to the cached image in the next frame of animation. However, changing the filter’s properties does not.