From ad0f386e1b5cd9148ad278c7f016734af00cd0bc Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 8 Mar 2026 23:38:11 +0100 Subject: ntsc effect for real --- src/shaders/math/noise.wgsl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/shaders/math') diff --git a/src/shaders/math/noise.wgsl b/src/shaders/math/noise.wgsl index dd97e02..dff6619 100644 --- a/src/shaders/math/noise.wgsl +++ b/src/shaders/math/noise.wgsl @@ -21,6 +21,13 @@ fn hash_2f(p: vec2f) -> f32 { return fract(sin(h) * 43758.5453123); } +// variant for vec2f -> f32 hashing +fn hash_2f_alt(p: vec2f) -> f32 { + var p3 = fract(p.xyx * .1376); + p3 += dot(p3, p3.yzx + 33.33); + return fract((p3.x + p3.y) * p3.z); +} + // Hash: vec2f -> vec2f // 2D coordinate to 2D hash (from Shadertoy 4djSRW) fn hash_2f_2f(p: vec2f) -> vec2f { -- cgit v1.2.3