fresnel

About

Fresnel is a macOS app that uses CoreML on the Neural Engine to relight the live camera feed using virtual lights. The idea is based on a WebGPU demo by Konrad Reczko and rewritten as a native macOS app using SwiftUI and CoreML.

The app runs Depth Anything V2 (small/fp16) using CoreML, then uses a custom Metal shader to relight the image based on the depth map and virtual lights.

Lessons learned

This was my first native SwiftUI macOS app, and I learned a lot about the SwiftUI framework, CoreML, and how to use the Neural Engine for real-time processing.

Especially integrating with the virtual camera kernel extension, optimizing the CoreML model for real-time performance, and handling the relight via a Metal shader were all challenging but rewarding experiences.

Build with

Build with SwiftUI, CoreML, Metal, and Xcode.
Logo