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

27 replies on “The Book”

When I know, you’ll know. The price of the book will be competitive with other technical books on the market, with the e-book selling for a little less than the paperback.

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.

That was overly ambitious. We’re looking at third week of October for the ePub release. Thanks for checking in!

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.

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.

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)

Hi there!

SUPER excited to see this book published!

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

Thanks!

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.

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.

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!

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.

Very exciting to hear! Is there a timeline for the next book? Just bought the first one, I should probably finish that first…

Unfortunately, the new book project is shelved indefinitely. But I have recently revisited all of the book sample code (available on Github), and it’s fully updated for iOS 13, including the iOS Simulator.

Leave a Reply

Your email address will not be published. Required fields are marked *

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