Type Alias


A block SceneKit calls at render time for working with buffers in a Metal shader, used by the handleBinding(ofBufferNamed:frequency:handler:) method.


typealias SCNBufferBindingBlock = (SCNBufferStream, SCNNode, SCNShadable, SCNRenderer) -> Void


The block takes the following parameters:


An object that provides write access to the buffer. Use the writeBytes(_:count:) method on this object to write data for use by the shader.


The node to be rendered using the shader program.


The material or geometry to be rendered using the shader program.


The view (or other SceneKit renderer) responsible for rendering.

See Also

Providing Input for Metal Shaders

func handleBinding(ofBufferNamed: String, frequency: SCNBufferFrequency, handler: SCNBufferBindingBlock)

Registers a block for SceneKit to call at render time for binding a Metal buffer to the shader program.

enum SCNBufferFrequency

Options for how often SceneKit should execute the binding handler you provide with the handleBinding(ofBufferNamed:frequency:handler:) method.