SF syn.fun
Submit via PR ↗ GitHub
← functions FUNCTION GLSL

hash12

Cheap 2D-to-1D hash for when you need fast variation without real noise.

#noise#utility

This is the sort of primitive you keep rewriting unless the community library already has it.

float hash12(vec2 p) {
    vec3 p3 = fract(vec3(p.xyx) * 0.1031);
    p3 += dot(p3, p3.yzx + 33.33);
    return fract((p3.x + p3.y) * p3.z);
}
submitted by
@UFFFD
author
community classic
source
Submitted directly
license
Verify before shipping commercially
Related · #utility