Skip to content

Instantly share code, notes, and snippets.

@jhnsnc
Last active April 20, 2017 00:34
Show Gist options
  • Save jhnsnc/e8403af08af60313f3f671d272e8dd5d to your computer and use it in GitHub Desktop.
Save jhnsnc/e8403af08af60313f3f671d272e8dd5d to your computer and use it in GitHub Desktop.
GLSL Function Snippets
// Sineless hash - Dave Hoskins ( https://www.shadertoy.com/view/4djSRW )
// License: CC BY-SA v4.0 (this function only)
float hash11(float p)
{
const float HASHSCALE1 = .1031;
vec3 p3 = fract(vec3(p) * HASHSCALE1);
p3 += dot(p3, p3.yzx + 19.19);
return fract((p3.x + p3.y) * p3.z);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment