Raymarching Shaders with SwiftUI
summary
SwiftUI code compiles fragment shaders (with a single rectangle vertex) that run per pixel to produce 3D via signed distance functions and ray marching; shapes combine with union/subtraction blends, a 2D Swift bird is extruded to 3D (using an extrude(0) trick) and ray-marched with shadow checks, normals and coloring, all live-coded in a Swift shader beta. The examples render successfully on-screen, code is promised uploaded, and the approach avoids vertex boilerplate.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 2:50What are shaders
- 4:58Fragment shaders
- 6:46Signed distance fields
- 8:30Ray marching
- 10:58Live coding shaders
- 11:44Red background shader
- 12:27Gradient effect steps
- 13:15Drawing a circle using signed distance
- 13:35Swift logo shader
- 16:302D to 3D ray marching
- 18:48Summary








