Вот мой код:
Код: Выделить всё
func saveOBJFormat() {
let allocator = MTKMeshBufferAllocator(device: device)
let asset = MDLAsset(bufferAllocator: allocator)
let vertexDescriptor = MDLVertexDescriptor()
vertexDescriptor.attributes[0] = MDLVertexAttribute(name: MDLVertexAttributePosition, format: .float3, offset: 0, bufferIndex: 0)
vertexDescriptor.attributes[1] = MDLVertexAttribute(name: MDLVertexAttributeColor, format: .float3, offset: MemoryLayout.stride, bufferIndex: 0)
vertexDescriptor.layouts[0] = MDLVertexBufferLayout(stride: MemoryLayout
.stride)
for i in 0..
Подробнее здесь: [url]https://stackoverflow.com/questions/78375833/particleuniforms-to-mdlmesh[/url]