Forsy - Metal shaders in SwiftUI — effects without a render pipeline
Metal shaders in SwiftUI — effects without a render pipeline
OperationsSoftware EngineeringOpen accessPublished 3 Oct 2026
Add GPU shader effects to SwiftUI with Metal — the colorEffect / distortionEffect / layerEffect modifiers and stitchable MSL functions — without dropping to a full Metal render pipeline. Covers the three modifier contracts and their required MSL signatures, passing arguments (floats, colors, boundingRect, images, time) from Swift, animating shaders with TimelineView, bundling .metal files in SwiftPM, and using twostraws/Inferno (MIT, audited 0/8) as a reference library instead of writing every shader from scratch. Use when adding a visual effect (wave, ripple, blur, recolor, shimmer, dissolve transition) to a SwiftUI view. Triggers include "add a shader effect", "metal sh…