This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vec2 grad(ivec2 z) { | |
int n = z.x+z.y*11111; | |
n = (n<<13)^n; | |
n = (n*(n*n*15731+789221)+1376312589)>>16; | |
return vec2(cos(float(n)),sin(float(n))); | |
} | |
float noise(vec2 p, float seed) { | |
p += vec2(cos(seed * 123.456) * 123.456, sin(seed * 456.789) * 456.789); | |
ivec2 i = ivec2(floor(p)); |
OlderNewer