castsShadow
A Boolean value that determines whether SceneKit renders the node’s contents into shadow maps.
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 castsShadow 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 castsShadow property to false.
For more details on shadow rendering, see SCNLight.