Welcome to MetalTutorials, a step-by-step guide designed to assist you in creating your own Metal Renderer. The main objectives of these tutorials are:
- minimal code
- minimal additions in each tutorial
This approach helps the reader understand the changes as we progress in building the engine.
Metal : https://developer.apple.com/metal/
Clone this repository and open the project in Xcode. Each tutorial is structured to build upon the last, starting with the fundamentals and gradually introducing more sophisticated rendering techniques.
Open the file MTMetalTuorialsApp.swift
you will find :
@main
struct MetalTutorialsApp: App {
var body: some Scene {
WindowGroup {
// substitute here to choose the tutorial
MT1ContentView()
}
}
}
Each tutorial has its own ContentView, named MT[tutorial-number]ContentView. To test a specific tutorial, simply replace the number (e.g., MT1ContentView -> MT2ContentView).
Every tutorial is self-contained, allowing you to make modifications without affecting other tutorials.
- Tutorial 1 - Hello
Begin your Metal journey by rendering a simple triangle. This tutorial lays the foundation, introducing the basic setup required to render your first Metal frame.
- Tutorial 2 - Sample Object
Advance to loading and rendering a 3D object (.obj) with a basic point light, building upon the skills acquired in Tutorial 1.
- Tutorial 3 - Deferred Rendering
Learn about deferred rendering techniques. Introduced also camera movement with SwiftUI.
- Tutorial 4 - Shadow Mapping
Explore shadow rendering using shadow maps.
- Tutorial 5 - Tiled Rendering
Metal Tiled Rendering. Avoid to store GBuffer textures.
- Tutorial 6 - GPU Rendering
GPU based rendering pipeline. Indirect Command buffers, Argument Buffers, GPU Heap for textures and USDZ loading.
Contributions to MetalTutorials are welcome! Whether it's submitting bug reports, feature requests, or code contributions, your input is valuable.
Commit messages follow the gitmoji convention.
For any questions or feedback regarding MetalTutorials, feel free to open an issue in this repository or contact me directly.
I'm always open to networking opportunities and collaborations. Feel free to reach out to me! 🍻