
SwiftUI Metal shader
Caustics
Layered internal caustic sheets inside a glass ball, kneading in place. The sphere is implicit — a disc whose z is solved from the radius — and marched front-to-back in sixteen slices, each one pulled inward in proportion to its depth so the volume reads as refracted. Two fbm fields warp each other and only the thin shells where either crosses its threshold survive, tinted by a cosine ramp over the field values.
SwiftUIReact NativeWeb
How it works
Caustics 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.
22 settings you can tune
- Speed
- Radius
- Density
- Thickness
- Refraction
- Warp
- Rim strength
- Spectrum
- Halo
- Tint
- Body
- Ambient
- Rim
- Rim tint
- Specular
- Film
- Bloom
- Exposure
- Colors
- Edge softness
- Glow
- Glow tint







