uv mapping in Metal

Case study

// Called in SwiftUI using .colorEffect()
[[ stitchable ]] float2 wave(
	float2 position, float time, float2 rect) {
		float2 uv = position / rect; // 👈🏼
		pos.y += sin(time * 5 + position.y / 20) * 5;
		return position;
	}
)
WidthXUV
10000
100500.5
200500.25