Starfield, a Metal shader for SwiftUI
SwiftUI Metal shader

Starfield

Multi-layer twinkling stars drifting downward with parallax. Pure colorEffect — no source image required.

SwiftUIReact NativeWeb

How it works

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

10 settings you can tune

  • Speed
  • Twinkle speed
  • Twinkle amount
  • Layers
  • Front layer scale
  • Per-layer step
  • Density
  • Star size
  • Star color
  • Background

More SwiftUI shaders