Skip to content

Instantly share code, notes, and snippets.

@radiofun
radiofun / simplewavenoise.metal
Last active March 5, 2026 21:33
Simple Wave with Noise
#include <metal_stdlib>
#include <SwiftUI/SwiftUI.h>
using namespace metal;
float hash21(float2 p) {
float3 p3 = fract(float3(p.xyx) * 0.1031);
p3 += dot(p3, p3.yzx + 33.33);
return fract((p3.x + p3.y) * p3.z);
}