Playground
Exercise · all exercises
This browser can’t run the shaders. The playground needs WebGPU: a recent Chrome, Edge or Safari, or Firefox where it has WebGPU.
You can still read and edit the code here, and the Ray Kiln app runs it on a Mac.
SwiftUI effect
320 × 200 pointsIn SwiftUI, put .compositingGroup() before this effect.
A Swift package: the effect as a SwiftUI modifier, with a #Preview that Xcode draws with SwiftUI itself.
About the preview
It is drawn here as SwiftUI draws it, positions in points and colours premultiplied, and checked against SwiftUI’s own pictures. A distortion or layer effect without .compositingGroup() before it can run on each layer of the view on its own (a gradient and its text separately), not on the view as you see it here. A picture of your own stays on this page: it isn’t uploaded or kept.
Inputs
This shader reads Inputs. Its previous frame works for everyone; with Ray Kiln Plus you can also connect sound, pictures, video and the camera, here and in the app. Without, it sees silence and black.
Nothing you pick is uploaded or kept: it stays on this page until you close it. An export and a gallery loop hear the shader’s own sound and show the camera as black.