The Book

Buy the Book Now!

Metal by Example was published as an e-book in October 2015. As of September 2016, you can name your own price.

Buy the Book Now!

Note: Unfortunately, the book is currently not available for purchase in mainland China or other countries where Gumroad is blocked.

Sample Code

The sample code for the book is available as MIT-licensed open source and is hosted on Github.

View the repository here

23 thoughts on “The Book”

    • We’re targeting mid-July for the e-book release, with the softcover to follow later. The July timeframe is entirely contingent on several factors: editing, e-book and softcover production, and how significant the changes announced at WWDC 2015 are.

  1. Cant wait to by the book
    Will any of the code be in swift ?
    I can convert it to for myself but then i might make it less efficiëntly working Since im not 100% familier with the metal api

    • The sample code for the book is in Obj-C, but the most recent article on Metal Performance Shaders has sample code in Swift. Fortunately, the concepts transfer pretty readily between the two.

  2. Hiya,

    Checking in again since May! Great to hear your book is almost ready! Like Kristof, I really would prefer that book in Swift. I know I’m only speaking for myself, but whether or not your book is in Swift is a crucial point for me.

    (hoping you’ll convert to Swift)

    Regards,
    Kelvin

    • I respect that a lot of devs are using Swift now, and if I had it all to do again, I’d do the whole project in Swift. This release will be in Obj-C. Having said that, the sample code will be available under a pretty liberal license, so if someone wants to port it to Swift, I’d be open to that collaboration.

  3. Thanks a lot, I can’t wait to read your book.

    For me it is great it is an Objective-C book.

    (I always code in Objective-C++ for the Apple platform for better cross-platform portability (and since I am a C++ nerd), so I can reuse BIG chunks of code on other platforms as well, and so Objective-C is great for me)

  4. Hi there!

    SUPER excited to see this book published!

    Just curious if there were any updates on the publication of the book? 🙂

    Thanks!

  5. I would love to see some expansion of the compute kernel section. Specifically I’m interested in operating on large arrays of complex data in parallel. Getting structs into metal without copying is somewhat of a challenge.

  6. I try to run de examples, and I got these kind of errors? any idea?

    Unknown type name ‘CAMetalLayer’; did you mean ‘CATextLayer’?
    Unknown receiver ‘CAMetalLayer’; did you mean ‘CATextLayer’?
    No type or protocol named ‘CAMetalDrawable’

    • Normally this error indicates you’re trying to run a Metal project in the iOS Simulator. Metal isn’t supported in the Simulator, so you’ll need to build with Generic Device or a physical device scheme selected.

  7. Apple will remove OpenGL from iOS and macOS, which have scared me, my app will stop working later.
    I hope that I can learn Metal quickly by reading your book, and rewrite them with Metal.
    Thanks!

  8. Hi! Do you have any tutorials or books on texturing 16-bit packed pixel formats? For example 5_5_5_1, 4_4_4_4 or 5_6_5.

Leave a Reply to jordan Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.