This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <metal_stdlib> | |
| #include <SwiftUI/SwiftUI.h> | |
| using namespace metal; | |
| [[ stitchable ]] half4 simpleripple(float2 pos, SwiftUI::Layer l, float4 boundingRect, float time) { | |
| float2 size = boundingRect.zw; | |
| float2 uv = pos / size; | |
| float2 center = float2(0.5,0.5); | |
| float aspectratio = size.x / size.y; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct DistortionSampleView: View { | |
| @State private var dragP : CGPoint = .init(x: -1000, y: -1000) | |
| var body: some View { | |
| ZStack { | |
| // Black Background - replace with image, gradient, whatever you like. | |
| Color.black |