import SCNNodeRendererDelegate from 'jscenekit/js/SceneKit/SCNNodeRendererDelegate.js'
SCNNodeRendererDelegate
Methods you can implement to use your own custom Metal or OpenGL drawing code to render content for a node.
Method Summary
Public Methods | ||
public |
renderNode(node: SCNNode, renderer: SCNRenderer, _arguments: Map<string, Object>): void Implement this method to perform custom rendering for a node. |
Public Methods
public renderNode(node: SCNNode, renderer: SCNRenderer, _arguments: Map<string, Object>): void source
Implement this method to perform custom rendering for a node. 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:
Name | Type | Attribute | Description |
node | SCNNode | The node to render. |
|
renderer | SCNRenderer | The SceneKit object (such as an SCNView instance) responsible for rendering the scene. |
|
_arguments | Map<string, Object> |
Return:
void |