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

Converting Between Model I/O and Metal Vertex Descriptors

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.

class MTKMesh

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

class MTKMeshBuffer

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

class 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.

class MTKSubmesh

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

Error Handling

struct 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.

Calculating Primitive Visibility Using Depth Testing

Determine which pixels are visible in a scene by using a depth texture.

Generating Multiple Output Vertex Streams from One Input Stream

Render efficiently to multiple layers or viewports.

Render Pipelines

Specify how graphics primitives should be rendered.

class MTLRenderPassDescriptor

A group of render targets that hold the results of a render pass.

protocol MTLRenderCommandEncoder

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

protocol MTLParallelRenderCommandEncoder

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