Contents

init(bufferAllocator:)

Initializes an empty asset, using the specified buffer allocator.

Declaration

init(bufferAllocator: (any MDLMeshBufferAllocator)?)

Parameters

  • bufferAllocator:

    The allocator object to use for loading or creating mesh data associated with the asset, or nil to use a default allocator.

Return Value

A new asset object.

Discussion

Use this initializer when you want to programmatically populate an asset with content (for example, for use in exporting to a file) while controlling the allocation of mesh data buffers associated with the asset. For example, to use the MetalKit framework for loading vertex data into GPU buffers for rendering using Metal, pass a MTKMeshBufferAllocator object for the bufferAllocator parameter.

See Also

Creating an Asset