Instance Method

vertexAttributeDataForAttributeNamed:

Returns the vertex data for the specified attribute.

Declaration

- (MDLVertexAttributeData *)vertexAttributeDataForAttributeNamed:(NSString *)name;

Parameters

name

The attribute name for which to retrieve data. See Vertex Attributes for standard attribute names.

Return Value

The vertex data for the specified attribute, or nil if the mesh does not contain vertex data for the specified attribute.

Discussion

Calling this data is equivalent to using the mesh’s vertexDescriptor object to find the index of the MDLMeshBuffer object corresponding to the specified vertex attribute in the mesh’s vertexBuffers array, then using the vertex buffer’s map method to gain read-only access to the vertex buffer’s data.

See Also

Working with Vertex Data

boundingBox

The minimum region entirely enclosing the mesh’s vertex positions, expressed in the model coordinate system of the mesh.

submeshes

The array of submeshes to be used in rendering the mesh.

vertexBuffers

The array of buffers that provide vertex data for the mesh.

vertexCount

The number of vertices in the mesh.

vertexDescriptor

A description of the format and layout of the mesh’s vertex buffers.

- addAttributeWithName:format:

Adds a vertex attribute to the mesh and creates a new, empty corresponding vertex buffer.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software