Sample Code

Modern Rendering with Metal

Use advanced Metal features such as Indirect Command Buffers, Sparse Textures, and Variable Rate Rasterization to implement modern rendering algorithms.

Download

Overview

Configure the Sample Code Project

To run the app:

  • Build the project with Xcode 11.

  • Run the iOS target on an iOS device with an A11 or later and iOS 13.0.

  • Run the macOS target on a macOS device with macOS 10.15 Catalina.

See Also

GPU Programming Techniques

Forward Plus Lighting with Tile Shading

Implement a forward plus renderer with Metal’s latest features for Apple GPUs.

Deferred Lighting

Demonstrates how to implement a deferred lighting renderer that takes advantage of unique Metal features.

Reflections with Layer Selection

Demonstrates how to use layer selection to reduce the number of render passes needed for a reflective object.

LOD with Function Specialization

Demonstrates how to use specialized functions to select a level of detail based on dynamic conditions.

Dynamic Terrain with Argument Buffers

Demonstrates how to use argument buffers to render a dynamic terrain in real time with a GPU-driven pipeline.

Mixing Metal and OpenGL Rendering in a View

Draw with Metal and OpenGL in the same view using an interoperable texture.