r/GraphicsProgramming • u/dariopagliaricci • Dec 23 '25
Metal Path Tracer for Apple Silicon (HWRT/SWRT + OIDN)
Hi all,
I’ve been working on a physically-based path tracer implemented in Metal, targeting Apple Silicon GPUs.
The renderer supports both Metal hardware ray tracing (on M3-class GPUs) and a software fallback path, with the goal of keeping a single codebase that works across M1/M2/M3. It includes HDR environment lighting with importance sampling, basic PBR materials (diffuse, conductor, dielectric), and Intel OIDN denoising with AOVs.
There’s an interactive real-time viewer as well as a headless CLI mode for offline rendering and validation / testing. High-resolution meshes and HDR environments are provided as a separate public asset pack to keep the repository size reasonable.
GitHub (v1.0.0 release):
https://github.com/dariopagliaricci/Metal-PathTracer-arm64
I’m happy to answer questions or discuss implementation details,tradeoffs, or Metal-specific constraints.
4
u/fakhirsh Dec 23 '25
This is very impressive. I assume you would be sending the ray calculations to the GPU cores. But how did you tackle the divergence? Are you batching similar rays together?
2
u/dariopagliaricci Dec 24 '25 edited Dec 24 '25
Adding a visual comparison for context.
HWRT vs SWRT (same scene, same camera, same seed, same spp):
https://raw.githubusercontent.com/dariopagliaricci/Metal-PathTracer-arm64/main/screenshots/hygieia_HWRT.jpg
https://raw.githubusercontent.com/dariopagliaricci/Metal-PathTracer-arm64/main/screenshots/hygieia_SWRT.jpg
1
u/dariopagliaricci Feb 26 '26 edited Feb 26 '26
V2.0.0. Latest Release.
https://github.com/dariopagliaricci/Metal-PathTracer-arm64/releases