Obsidian, a Metal shader for SwiftUI
SwiftUI Metal shader

Obsidian

A glass ball refracts the studio wall behind it once per colour channel — three indices of refraction, one fringe — then sphere-traces up to forty-four steps through itself to a stone whose radius is bent by two octaves of fbm. The stone is lit entirely by what it reflects: the wall, a needle-tight key and a violet fresnel. Two specular lobes and a limb glow sit on the glass in front of it. Every colour in the image, down to the wall grade and the lamps, is an editable swatch.

SwiftUIReact NativeWeb

How it works

Obsidian is a real [[stitchable]] Metal shader, not a video or an image. It runs as a SwiftUI .colorEffect, so it paints any view you attach it to. You shape it with sliders in a live preview, then export the .metal file and the SwiftUI code that uses it, or the React Native and Web version. No MSL to write.

32 settings you can tune

  • Speed
  • Radius
  • Center
  • Stone
  • Relief
  • Grain
  • Sheen
  • Tint
  • Rim
  • Glass
  • Bounce
  • Wall
  • Wall tint
  • Lamp A
  • Lamp B
  • Specular
  • Softbox
  • Lobe
  • Limb
  • Key
  • Key mid
  • Key wide
  • Horizon
  • Horizon tint
  • Ambient
  • Stone spec
  • Bloom
  • Exposure
  • Colors
  • Edge softness
  • Glow
  • Glow tint

More SwiftUI shaders