Home Reference Source Repository
import SCNSceneRendererDelegate from 'jscenekit/js/SceneKit/SCNSceneRendererDelegate.js'
public interface | source

SCNSceneRendererDelegate

Methods your app can implement to participate in SceneKit’s animation loop or perform additional rendering.

See:

Method Summary

Public Methods
public

SceneKit calls this method exactly once per frame, so long as the SCNView object (or other SCNSceneRenderer object) displaying the scene is not paused.

public

Implement this method to perform custom drawing after SceneKit has rendered a scene—for example, to draw overlay content on top of SceneKit content.

public

SceneKit calls this method exactly once per frame, so long as the SCNView object (or other SCNSceneRenderer object) displaying the scene is not paused.

public

rendererUpdateAtTime(renderer: SCNSceneRenderer, time: number): void

SceneKit calls this method exactly once per frame, so long as the SCNView object (or other SCNSceneRenderer object) displaying the scene is not paused.

public

Implement this method to perform custom drawing before SceneKit renders a scene—for example, to draw backdrop content underneath SceneKit content.

Public Methods

public rendererDidApplyAnimationsAtTime(renderer: SCNSceneRenderer, time: number): void source

SceneKit calls this method exactly once per frame, so long as the SCNView object (or other SCNSceneRenderer object) displaying the scene is not paused. Implement this method to add game logic to the rendering loop. Any changes you make to the scene graph during this method are immediately reflected in the displayed scene. That is, SceneKit immediately updates the hierarchy of presentation nodes it uses to render the scene (instead of using the SCNTransaction class to “batch” your changes).

Params:

NameTypeAttributeDescription
renderer SCNSceneRenderer
time number

The current system time, in seconds. Use this parameter for any time-based elements of your game logic.

Return:

void

See:

public rendererDidRenderSceneAtTime(renderer: SCNSceneRenderer, scene: SCNScene, time: number): void source

Implement this method to perform custom drawing after SceneKit has rendered a scene—for example, to draw overlay content on top of SceneKit content. You should only execute Metal or OpenGL drawing commands (and any setup required to perform them) in this method—the results of modifying SceneKit objects in this method are undefined.To render using Metal, use the renderer parameter to retrieve the scene renderer’s currentRenderCommandEncoder object and encode your own drawing commands. If you need to reference other Metal state, see the properties listed in SCNSceneRenderer.To render using OpenGL, simply call the relevant OpenGL drawing commands—SceneKit automatically makes its OpenGL context the current context before calling this method. If you need to reference the OpenGL context being rendered into, examine the context property of the renderer parameter.You must draw using the appropriate graphics technology for the view currently being rendered. Use the renderingAPI property of the renderer object to determine whether Metal or OpenGL is in use.

Params:

NameTypeAttributeDescription
renderer SCNSceneRenderer
scene SCNScene

The scene object that was rendered.

time number

The current system time, in seconds. If your custom rendering involves animation, use this parameter to compute your own animation state.

Return:

void

See:

public rendererDidSimulatePhysicsAtTime(renderer: SCNSceneRenderer, time: number): void source

SceneKit calls this method exactly once per frame, so long as the SCNView object (or other SCNSceneRenderer object) displaying the scene is not paused. Implement this method to add game logic to the rendering loop. Any changes you make to the scene graph during this method are immediately reflected in the displayed scene. That is, SceneKit immediately updates the hierarchy of presentation nodes it uses to render the scene (instead of using the SCNTransaction class to “batch” your changes). This method is the last opportunity SceneKit provides for you to change the scene graph before rendering.

Params:

NameTypeAttributeDescription
renderer SCNSceneRenderer
time number

The current system time, in seconds. Use this parameter for any time-based elements of your game logic.

Return:

void

See:

public rendererUpdateAtTime(renderer: SCNSceneRenderer, time: number): void source

SceneKit calls this method exactly once per frame, so long as the SCNView object (or other SCNSceneRenderer object) displaying the scene is not paused. Implement this method to add game logic to the rendering loop. Any changes you make to the scene graph during this method are immediately reflected in the displayed scene. That is, SceneKit immediately updates the hierarchy of presentation nodes it uses to render the scene (instead of using the SCNTransaction class to “batch” your changes).

Params:

NameTypeAttributeDescription
renderer SCNSceneRenderer
time number

The current system time, in seconds. Use this parameter for any time-based elements of your game logic.

Return:

void

See:

public rendererWillRenderSceneAtTime(renderer: SCNSceneRenderer, scene: SCNScene, time: number): void source

Implement this method to perform custom drawing before SceneKit renders a scene—for example, to draw backdrop content underneath SceneKit content. You should only execute Metal or OpenGL drawing commands (and any setup required to perform them) in this method—the results of modifying SceneKit objects during this method are undefined.To render using Metal, use the renderer parameter to retrieve the scene renderer’s currentRenderCommandEncoder object and encode your own drawing commands. If you need to reference other Metal state, see the properties listed in SCNSceneRenderer.To render using OpenGL, simply call the relevant OpenGL drawing commands—SceneKit automatically makes its OpenGL context the current context before calling this method. If you need to reference the OpenGL context being rendered into, examine the context property of the renderer parameter.You must draw using the appropriate graphics technology for the view currently being rendered. Use the renderingAPI property of the renderer object to determine whether Metal or OpenGL is in use.

Params:

NameTypeAttributeDescription
renderer SCNSceneRenderer
scene SCNScene

The SCNScene object to be rendered.

time number

The current system time, in seconds. If your custom rendering involves animation, use this parameter to compute your own animation state.

Return:

void

See: