3D Graphics with Metal · Texture Coordinates | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1258241-3d-graphics-with-metal/lessons/28
1 Like

When we define attribute 2 within the MDLVertexDescriptor:

let attributeUV = vertexDescriptor.attributes[2] as! MDLVertexAttribute
attributeUV.name = MDLVertexAttributeTextureCoordinate

I see that in XCode’s quick help bar, that MDLVertexAttributeTextureCoordinate is defined as:
The attribute data describes surface normal vectors.

  1. Why are UV coordinates called ‘surface normal’ vectors?
  2. Does this mean that MDLVertexAttributeTextureCoordinate could hold non-UV data within the MDL?

That would be a misprint.

MDLVertexAttributeNormal describes surface normal vectors. MDLVertexAttributeTextureCoordinate describes UVs (texture coordinates).

Thanks for the clarity!