A Boolean value that determines whether SceneKit renders the node’s contents into shadow maps.
SDKs
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Scene
Kit
Declaration
var castsShadow: Bool { get set }
Discussion
SceneKit renders shadows by rendering a shadow map image containing silhouettes of the scene’s contents, and then projecting that image onto the scene. SceneKit performs this process once for each SCNLight
object in the scene whose casts
property is true
. Because shadow map rendering re-renders portions of the scene, it incurs a performance cost. To minimize this performance cost, exclude nodes from shadow map rendering by setting the node’s casts
property to false
.
For more details on shadow rendering, see SCNLight
.