Skip to content

Instantly share code, notes, and snippets.

@tkgka
tkgka / Sticker.Metal
Last active September 30, 2025 14:35
Sticker shader
#include <metal_stdlib>
#include <SwiftUI/SwiftUI.h>
using namespace metal;
bool isClear(half4 color) {
return color.r == 0.0 && color.g == 0.0 && color.b == 0.0 && color.a == 0.0;
}
[[ stitchable ]] half4 Sticker(float2 position, SwiftUI::Layer layer, float2 size, float2 offset) {
offset.x *= 2.3;