Where To Go From Here?
Here is the final example project from this Swift 3 Metal Tutorial.
Nicely done! Take a moment to review what you’ve done in this tutorial.
- You created
BufferProvider
to cleverly reuse uniform buffers instead of creating new buffers every time.
- You added MetalTexture and loaded a
MTLTexture
with it.
- You modified the structure of Vertex so it stores corresponding texture coordinates from
MTLTexture
.
- You modified Cube so it contains 24 vertices, each with its own texture coordinates.
- You modified the shaders to receive texture coordinates of the fragments, and then you read the corresponding texel using
sample()
.
- You added a cool rotation UI effect with
UIPanGestureRecognizer
.
- You debugged the Metal frame and identified why it rendered a subpar image.
- You resized a drawable texture in
viewDidLayoutSubviews
to fix the rotation issue and improve the image’s quality.
Here are some great resources to deepen your understanding of Metal:
You also might enjoy the Beginning Metal course on our site, where we explain these same concepts in video form, but with even more detail.
Thank you for joining me for this tour through Metal. As you can see, it’s a powerful technology that’s relatively easy to implement once you understand how it works.
If you have questions, comments or Metal discoveries to share, please leave them in the comments below!