A delegate object that receives messages about SceneKit’s rendering process.
- iOS 8.0+
- macOS 10.8+
- tvOS 9.0+
- watchOS 3.0+
A scene renderer delegate is a custom object that you provide. When SceneKit processes the scene for rendering each frame of animation, it notifies the delegate after significant steps in the update-and-render process. There are two primary uses for a scene renderer delegate:
Implementing per-frame game logic. Use delegate methods to update the state of your game objects and modify the scene graph in response, either at the beginning of SceneKit’s rendering process for each frame, or after SceneKit has processed actions and animations or run the physics simulation for the scene.
Performing custom rendering. Use a scene renderer delegate to draw your own content using Metal or OpenGL, either before SceneKit renders the scene’s contents (as a backdrop) or afterward (as an overlay).
This rendering is independent of the scene graph and its contents. If you instead want to perform custom rendering that is anchored at a location in the scene’s coordinate space, use the
rendererproperty of an
SCNNodeobject in the scene graph. Or if you want to customize the rendering of SceneKit’s geometries and materials, use the
SCNShadableprotocol to attach GPU shaders to SceneKit objects.
For details, see