Type Alias

SCNBufferBindingBlock

A block SceneKit calls at render time for working with buffers in a Metal shader, used by the handleBindingOfBufferNamed:frequency:usingBlock: method.

Declaration

typedef void (^SCNBufferBindingBlock)(id<SCNBufferStream> buffer, SCNNode *node, id<SCNShadable> shadable, SCNRenderer *renderer);

Discussion

The block takes the following parameters:

buffer

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

node

The node to be rendered using the shader program.

shadable

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

renderer

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

See Also

Providing Input for Metal Shaders

- handleBindingOfBufferNamed:frequency:usingBlock:

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

SCNBufferFrequency

Options for how often SceneKit should execute the binding handler you provide with the handleBindingOfBufferNamed:frequency:usingBlock: method.