Model I/O

Specify precise locations within the textures associated with graphics processing.

Overview

Use vertex data to specify the area within source pixel data that a render command will draw. You also use vertex data to specify the precise location within your rendering targets on which a draw call renders. Often times, the bit you're drawing is just a piece of a larger sheet, for example, a single image that lies within an atlas of images that line up next to each other in the texture; you use vertex data to outline those specific areas.

Topics

Converting Between Model I/O and Metal Vertex Formats

MTKMetalVertexFormatFromModelIO

Returns a converted Metal vertex format.

MTKModelIOVertexFormatFromMetal

Returns a converted Model I/O vertex format.

Converting Between Model I/O and Metal Vertex Descriptors

MTKMetalVertexDescriptorFromModelIO

Returns a partially converted Metal vertex descriptor.

MTKMetalVertexDescriptorFromModelIOWithError

Returns a partially converted Metal vertex descriptor, reporting any error that occurs.

MTKModelIOVertexDescriptorFromMetal

Returns a partially converted Model I/O vertex descriptor.

MTKModelIOVertexDescriptorFromMetalWithError

Returns a partially converted Model I/O vertex descriptor, reporting any error that occurs.

Working with Model I/O Assets in Metal

Handle Model I/O assets using a Metal-specific interface. MetalKit's highly optimized functions and objects allow for efficient data transfer between Model I/O meshes and Metal buffers.

MTKMesh

A container for the vertex data of a Model I/O mesh, suitable for use in a Metal app.

MTKMeshBuffer

A buffer that backs the vertex data of a Model I/O mesh, suitable for use in a Metal app.

MTKMeshBufferAllocator

An interface for allocating a MetalKit buffer that backs the vertex data of a Model I/O mesh, suitable for use in a Metal app.

MTKSubmesh

A container for the index data of a Model I/O submesh, suitable for use in a Metal app.

Error Handling

MTKModelError

Constants used to declare Model Errors.

See Also

Rendering

Creating and Sampling Textures

Load image data into a texture and apply it to a quadrangle.

Render Pipelines

Specify how graphics primitives should be rendered.

Render Passes

Update a set of render targets.

MTLRenderCommandEncoder

The object to use for encoding commands for a render pass.

MTLParallelRenderCommandEncoder

An object that splits up a single render pass so that it can be simultaneously encoded from multiple threads.

Presentation Objects

Use user interface elements to display your Metal content.