Basics

A Decade of Metal: The Early Years (2014–2019)

Introduction In 2014, when Apple introduced the Metal graphics API, the landscape of computer graphics APIs was dominated by long-established standards like OpenGL. Seismic shifts were afoot, however, with the announcement of DirectX 12 a few months prior and the initiative that would produce Vulkan starting to take shape. These parallel efforts signaled a significant …

A Decade of Metal: The Early Years (2014–2019) Read More »

WebGPU for Metal Developers, Part One

Doing high-performance 3D rendering on the Web has always been a tricky proposition. WebGL, in its quest for programmer familiarity and cross-platform ubiquity, adopted the API of OpenGL ES. As such it has never been capable of exploiting the full power of the underlying GPU, even as desktop APIs like DirectX 12, Metal, and Vulkan …

WebGPU for Metal Developers, Part One Read More »

What’s New in Metal (2019)

With WWDC 2019 over, it’s a good time to reflect on everything that was announced and start seeing how we can put it into practice. The purpose of this article is to round up the changes to the Metal framework and tools and provide pointers to where you can learn more. This was a banner …

What’s New in Metal (2019) Read More »

Vertex Data and Vertex Descriptors

The purpose of this article is to describe and explore a foundational concept in Metal: vertex descriptors. Vertex descriptors are the glue between your application code (written in Objective-C or Swift) and your shader functions (written in the Metal Shading Language). They describe the shape of data consumed by your shaders. When I was writing …

Vertex Data and Vertex Descriptors Read More »

Writing a Modern Metal App from Scratch: Part 1

Getting Started This article is a quick introduction to how to use the Metal, MetalKit, and Model I/O frameworks in Swift. If you know your way around UIKit or Cocoa development, you should be able to follow along for the most part. Some things like shaders and matrices will be foreign to you, but you …

Writing a Modern Metal App from Scratch: Part 1 Read More »

First Look at MetalKit

MetalKit is a forthcoming framework on iOS 9 and OS X El Capitan that greatly eases certain tasks such as presenting Metal content in a UIView or NSView, texture loading, and working with model data. This post is an overview of the features offered by MetalKit. Many of our articles so far have focused on …

First Look at MetalKit Read More »

Video: An Introduction to 3D Graphics with Metal in Swift

In November 2014, I was privileged to deliver a talk to San Francisco’s Swift Language User Group, hosted by Realm. They’ve now uploaded the video, with subtitles and synchronized slide deck to their site. You can view the video here.

Mipmapping and the Blit Command Encoder

In this article we will learn about mipmapping, an important technique for rendering textured objects at a distance. We will find out why mipmapping is important, how it complements regular texture filtering, and how to use the blit command encoder to generate mipmaps efficiently on the GPU.

Textures and Samplers in Metal

Textures are a central topic in rendering. Although they have many uses, one of their primary purposes is to provide a greater level of detail to surfaces than can be achieved with vertex colors alone. In this post, we’ll talk about texture mapping, which helps us bring virtual characters to life. We’ll also introduce samplers, …

Textures and Samplers in Metal Read More »

Up and Running with Metal, Part 3: Lighting and Rendering in 3D

In this post, we’ll finally start rendering in 3D. In order to get there, we’ll talk about how to load 3D model data from disk, how to tell Metal to draw from a vertex buffer using indices, and how to manipulate objects in real time. This post assumes that you know a little linear algebra. …

Up and Running with Metal, Part 3: Lighting and Rendering in 3D Read More »