Ferrofluid, a Metal shader for SwiftUI
SwiftUI Metal shader

Ferrofluid

A near-black magnetic mirror. The sphere is implicit — a disc whose z is solved from the radius — and its normal is bent by the three-tap gradient of a ridged fbm field, growing the cones a magnet pulls out of ferrofluid. Four drifting lights gathered by an exponential lobe stand in for an environment, and a high-f0 Schlick fresnel keeps the body dark so colour only flashes off the spike flanks.

SwiftUIReact NativeWeb

How it works

Ferrofluid 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.

20 settings you can tune

  • Speed
  • Radius
  • Spikes
  • Sharpness
  • Relief
  • Flank
  • Body
  • Aqua
  • Violet
  • Magenta
  • Amber
  • Body tint
  • Specular
  • Highlight
  • Bloom
  • Exposure
  • Colors
  • Edge softness
  • Glow
  • Glow tint

More SwiftUI shaders