diff options
| author | skal <pascal.massimino@gmail.com> | 2026-03-08 23:38:11 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-03-08 23:38:11 +0100 |
| commit | ad0f386e1b5cd9148ad278c7f016734af00cd0bc (patch) | |
| tree | bdbcaaf5cd2c568a90f2c480fb82be60173fc5e9 /src/shaders/math | |
| parent | c43addd93191db1ed3e79af7e065004f7c52bf48 (diff) | |
ntsc effect for real
Diffstat (limited to 'src/shaders/math')
| -rw-r--r-- | src/shaders/math/noise.wgsl | 7 |
1 files changed, 7 insertions, 0 deletions
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 { |
