Fresnel

Studio lighting for your webcam. Drag virtual lights around your face and watch the scene relight in real time.

Platform
macOS, Apple Silicon
Stack
SwiftUI, CoreML, Metal
Fresnel window showing a relit webcam feed with two draggable lights and a preset panel

About

Fresnel is a small macOS app I built that relights your webcam feed with virtual lights. It estimates how far every pixel is from the camera, so a light you drag around behaves like a real lamp: your face, shoulders and the wall behind you all respond to it. Everything runs on-device, in real time.

Tech

  1. CPU
    Camera frameAVFoundation
  2. Neural Engine
    Depth estimationDepth Anything V2, small fp16 via CoreML
  3. Metal (GPU)
    RelightingCustom shader to relight
  4. macOS
    Virtual CameraKernel Extension to use it anywhere

The idea is based on a WebGPU demo by Konrad Reczko. I rebuilt it as a native app so the depth model can run on the Neural Engine and the shading on the GPU, which keeps it fast enough to leave running during a call.

  • Swift
  • SwiftUI
  • CoreML
  • Metal
  • Depth Anything V2