#define WRATH_GL_FRAGMENT_SHADER //LOCATION( 1, raw string) #define PERLIN_PERIOD 4 //LOCATION( 2, raw string) //LOCATION( 1, raw string) #define CoordMultiplier 16 //LOCATION( 2, raw string) //LOCATION( 1, raw string) #define CircleRadius 2 //LOCATION( 2, raw string) /* //LOCATION( 1, noise/shaders/common.glsl) define perlin noise with same interface as others //LOCATION( 2, noise/shaders/common.glsl) */ //LOCATION( 3, noise/shaders/common.glsl) //LOCATION( 4, noise/shaders/common.glsl) //LOCATION( 5, noise/shaders/common.glsl) float pnoise(vec2, vec2); //LOCATION( 6, noise/shaders/common.glsl) float pnoise(vec2 v) //LOCATION( 7, noise/shaders/common.glsl) { //LOCATION( 8, noise/shaders/common.glsl) return pnoise(v, vec2(PERLIN_PERIOD, //LOCATION( 9, noise/shaders/common.glsl) PERLIN_PERIOD)); //LOCATION( 10, noise/shaders/common.glsl) } //LOCATION( 11, noise/shaders/common.glsl) //LOCATION( 12, noise/shaders/common.glsl) //LOCATION( 13, noise/shaders/common.glsl) float pnoise(vec3, vec3); //LOCATION( 14, noise/shaders/common.glsl) float pnoise(vec3 v) //LOCATION( 15, noise/shaders/common.glsl) { //LOCATION( 16, noise/shaders/common.glsl) return pnoise(v, vec3(PERLIN_PERIOD, //LOCATION( 17, noise/shaders/common.glsl) PERLIN_PERIOD, //LOCATION( 18, noise/shaders/common.glsl) PERLIN_PERIOD)); //LOCATION( 19, noise/shaders/common.glsl) } //LOCATION( 20, noise/shaders/common.glsl) //LOCATION( 21, noise/shaders/common.glsl) //LOCATION( 22, noise/shaders/common.glsl) float pnoise(vec4, vec4); //LOCATION( 23, noise/shaders/common.glsl) float pnoise(vec4 v) //LOCATION( 24, noise/shaders/common.glsl) { //LOCATION( 25, noise/shaders/common.glsl) return pnoise(v, vec4(PERLIN_PERIOD, //LOCATION( 26, noise/shaders/common.glsl) PERLIN_PERIOD, //LOCATION( 27, noise/shaders/common.glsl) PERLIN_PERIOD, //LOCATION( 28, noise/shaders/common.glsl) PERLIN_PERIOD)); //LOCATION( 29, noise/shaders/common.glsl) } //LOCATION( 30, noise/shaders/common.glsl) //LOCATION( 31, noise/shaders/common.glsl) /* //LOCATION( 32, noise/shaders/common.glsl) Common utility functions used. //LOCATION( 33, noise/shaders/common.glsl) */ //LOCATION( 34, noise/shaders/common.glsl) #define MAKE_MOD289(TYPE) TYPE mod289(TYPE x) { return x - floor(x * (1.0 / 289.0)) * 289.0; } //LOCATION( 35, noise/shaders/common.glsl) MAKE_MOD289(float) //LOCATION( 36, noise/shaders/common.glsl) MAKE_MOD289(vec2) //LOCATION( 37, noise/shaders/common.glsl) MAKE_MOD289(vec3) //LOCATION( 38, noise/shaders/common.glsl) MAKE_MOD289(vec4) //LOCATION( 39, noise/shaders/common.glsl) #undef MAKE_MOD289 //LOCATION( 40, noise/shaders/common.glsl) //LOCATION( 41, noise/shaders/common.glsl) //LOCATION( 42, noise/shaders/common.glsl) #define MAKE_PERMUTE(TYPE) TYPE permute(TYPE x) { return mod289(((x*34.0)+1.0)*x); } //LOCATION( 43, noise/shaders/common.glsl) MAKE_PERMUTE(float) //LOCATION( 44, noise/shaders/common.glsl) MAKE_PERMUTE(vec2) //LOCATION( 45, noise/shaders/common.glsl) MAKE_PERMUTE(vec3) //LOCATION( 46, noise/shaders/common.glsl) MAKE_PERMUTE(vec4) //LOCATION( 47, noise/shaders/common.glsl) #undef MAKE_PERMUTE //LOCATION( 48, noise/shaders/common.glsl) //LOCATION( 49, noise/shaders/common.glsl) #define MAKE_TAYLORINVSQRT(TYPE) TYPE taylorInvSqrt(TYPE r) { return 1.79284291400159 - 0.85373472095314 * r; } //LOCATION( 50, noise/shaders/common.glsl) MAKE_TAYLORINVSQRT(float) //LOCATION( 51, noise/shaders/common.glsl) MAKE_TAYLORINVSQRT(vec2) //LOCATION( 52, noise/shaders/common.glsl) MAKE_TAYLORINVSQRT(vec3) //LOCATION( 53, noise/shaders/common.glsl) MAKE_TAYLORINVSQRT(vec4) //LOCATION( 54, noise/shaders/common.glsl) #undef MAKE_TAYLORINVSQRT //LOCATION( 55, noise/shaders/common.glsl) //LOCATION( 56, noise/shaders/common.glsl) #define MAKE_FADE(TYPE) TYPE fade(TYPE t) { return t*t*t*(t*(t*6.0-15.0)+10.0); } //LOCATION( 57, noise/shaders/common.glsl) MAKE_FADE(float) //LOCATION( 58, noise/shaders/common.glsl) MAKE_FADE(vec2) //LOCATION( 59, noise/shaders/common.glsl) MAKE_FADE(vec3) //LOCATION( 60, noise/shaders/common.glsl) MAKE_FADE(vec4) //LOCATION( 61, noise/shaders/common.glsl) #undef MAKE_FADE //LOCATION( 62, noise/shaders/common.glsl) //LOCATION( 63, noise/shaders/common.glsl) float time_dependent(void); //LOCATION( 64, noise/shaders/common.glsl) // //LOCATION( 1, noise/shaders/classicnoise2D.glsl) // GLSL textureless classic 2D noise "cnoise", //LOCATION( 2, noise/shaders/classicnoise2D.glsl) // with an RSL-style periodic variant "pnoise". //LOCATION( 3, noise/shaders/classicnoise2D.glsl) // Author: Stefan Gustavson (stefan.gustavson@liu.se) //LOCATION( 4, noise/shaders/classicnoise2D.glsl) // Version: 2011-08-22 //LOCATION( 5, noise/shaders/classicnoise2D.glsl) // //LOCATION( 6, noise/shaders/classicnoise2D.glsl) // Many thanks to Ian McEwan of Ashima Arts for the //LOCATION( 7, noise/shaders/classicnoise2D.glsl) // ideas for permutation and gradient selection. //LOCATION( 8, noise/shaders/classicnoise2D.glsl) // //LOCATION( 9, noise/shaders/classicnoise2D.glsl) // Copyright (c) 2011 Stefan Gustavson. All rights reserved. //LOCATION( 10, noise/shaders/classicnoise2D.glsl) // Distributed under the MIT license. See LICENSE file. //LOCATION( 11, noise/shaders/classicnoise2D.glsl) // https://github.com/ashima/webgl-noise //LOCATION( 12, noise/shaders/classicnoise2D.glsl) // //LOCATION( 13, noise/shaders/classicnoise2D.glsl) //LOCATION( 14, noise/shaders/classicnoise2D.glsl) //LOCATION( 15, noise/shaders/classicnoise2D.glsl) // Classic Perlin noise //LOCATION( 16, noise/shaders/classicnoise2D.glsl) float cnoise(vec2 P) //LOCATION( 17, noise/shaders/classicnoise2D.glsl) { //LOCATION( 18, noise/shaders/classicnoise2D.glsl) vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0); //LOCATION( 19, noise/shaders/classicnoise2D.glsl) vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0); //LOCATION( 20, noise/shaders/classicnoise2D.glsl) Pi = mod289(Pi); // To avoid truncation effects in permutation //LOCATION( 21, noise/shaders/classicnoise2D.glsl) vec4 ix = Pi.xzxz; //LOCATION( 22, noise/shaders/classicnoise2D.glsl) vec4 iy = Pi.yyww; //LOCATION( 23, noise/shaders/classicnoise2D.glsl) vec4 fx = Pf.xzxz; //LOCATION( 24, noise/shaders/classicnoise2D.glsl) vec4 fy = Pf.yyww; //LOCATION( 25, noise/shaders/classicnoise2D.glsl) //LOCATION( 26, noise/shaders/classicnoise2D.glsl) vec4 i = permute(permute(ix) + iy); //LOCATION( 27, noise/shaders/classicnoise2D.glsl) //LOCATION( 28, noise/shaders/classicnoise2D.glsl) vec4 gx = fract(i * (1.0 / 41.0)) * 2.0 - 1.0 ; //LOCATION( 29, noise/shaders/classicnoise2D.glsl) vec4 gy = abs(gx) - 0.5 ; //LOCATION( 30, noise/shaders/classicnoise2D.glsl) vec4 tx = floor(gx + 0.5); //LOCATION( 31, noise/shaders/classicnoise2D.glsl) gx = gx - tx; //LOCATION( 32, noise/shaders/classicnoise2D.glsl) //LOCATION( 33, noise/shaders/classicnoise2D.glsl) vec2 g00 = vec2(gx.x,gy.x); //LOCATION( 34, noise/shaders/classicnoise2D.glsl) vec2 g10 = vec2(gx.y,gy.y); //LOCATION( 35, noise/shaders/classicnoise2D.glsl) vec2 g01 = vec2(gx.z,gy.z); //LOCATION( 36, noise/shaders/classicnoise2D.glsl) vec2 g11 = vec2(gx.w,gy.w); //LOCATION( 37, noise/shaders/classicnoise2D.glsl) //LOCATION( 38, noise/shaders/classicnoise2D.glsl) vec4 norm = taylorInvSqrt(vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); //LOCATION( 39, noise/shaders/classicnoise2D.glsl) g00 *= norm.x; //LOCATION( 40, noise/shaders/classicnoise2D.glsl) g01 *= norm.y; //LOCATION( 41, noise/shaders/classicnoise2D.glsl) g10 *= norm.z; //LOCATION( 42, noise/shaders/classicnoise2D.glsl) g11 *= norm.w; //LOCATION( 43, noise/shaders/classicnoise2D.glsl) //LOCATION( 44, noise/shaders/classicnoise2D.glsl) float n00 = dot(g00, vec2(fx.x, fy.x)); //LOCATION( 45, noise/shaders/classicnoise2D.glsl) float n10 = dot(g10, vec2(fx.y, fy.y)); //LOCATION( 46, noise/shaders/classicnoise2D.glsl) float n01 = dot(g01, vec2(fx.z, fy.z)); //LOCATION( 47, noise/shaders/classicnoise2D.glsl) float n11 = dot(g11, vec2(fx.w, fy.w)); //LOCATION( 48, noise/shaders/classicnoise2D.glsl) //LOCATION( 49, noise/shaders/classicnoise2D.glsl) vec2 fade_xy = fade(Pf.xy); //LOCATION( 50, noise/shaders/classicnoise2D.glsl) vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x); //LOCATION( 51, noise/shaders/classicnoise2D.glsl) float n_xy = mix(n_x.x, n_x.y, fade_xy.y); //LOCATION( 52, noise/shaders/classicnoise2D.glsl) return 2.3 * n_xy; //LOCATION( 53, noise/shaders/classicnoise2D.glsl) } //LOCATION( 54, noise/shaders/classicnoise2D.glsl) //LOCATION( 55, noise/shaders/classicnoise2D.glsl) // Classic Perlin noise, periodic variant //LOCATION( 56, noise/shaders/classicnoise2D.glsl) float pnoise(vec2 P, vec2 rep) //LOCATION( 57, noise/shaders/classicnoise2D.glsl) { //LOCATION( 58, noise/shaders/classicnoise2D.glsl) vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0); //LOCATION( 59, noise/shaders/classicnoise2D.glsl) vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0); //LOCATION( 60, noise/shaders/classicnoise2D.glsl) Pi = mod(Pi, rep.xyxy); // To create noise with explicit period //LOCATION( 61, noise/shaders/classicnoise2D.glsl) Pi = mod289(Pi); // To avoid truncation effects in permutation //LOCATION( 62, noise/shaders/classicnoise2D.glsl) vec4 ix = Pi.xzxz; //LOCATION( 63, noise/shaders/classicnoise2D.glsl) vec4 iy = Pi.yyww; //LOCATION( 64, noise/shaders/classicnoise2D.glsl) vec4 fx = Pf.xzxz; //LOCATION( 65, noise/shaders/classicnoise2D.glsl) vec4 fy = Pf.yyww; //LOCATION( 66, noise/shaders/classicnoise2D.glsl) //LOCATION( 67, noise/shaders/classicnoise2D.glsl) vec4 i = permute(permute(ix) + iy); //LOCATION( 68, noise/shaders/classicnoise2D.glsl) //LOCATION( 69, noise/shaders/classicnoise2D.glsl) vec4 gx = fract(i * (1.0 / 41.0)) * 2.0 - 1.0 ; //LOCATION( 70, noise/shaders/classicnoise2D.glsl) vec4 gy = abs(gx) - 0.5 ; //LOCATION( 71, noise/shaders/classicnoise2D.glsl) vec4 tx = floor(gx + 0.5); //LOCATION( 72, noise/shaders/classicnoise2D.glsl) gx = gx - tx; //LOCATION( 73, noise/shaders/classicnoise2D.glsl) //LOCATION( 74, noise/shaders/classicnoise2D.glsl) vec2 g00 = vec2(gx.x,gy.x); //LOCATION( 75, noise/shaders/classicnoise2D.glsl) vec2 g10 = vec2(gx.y,gy.y); //LOCATION( 76, noise/shaders/classicnoise2D.glsl) vec2 g01 = vec2(gx.z,gy.z); //LOCATION( 77, noise/shaders/classicnoise2D.glsl) vec2 g11 = vec2(gx.w,gy.w); //LOCATION( 78, noise/shaders/classicnoise2D.glsl) //LOCATION( 79, noise/shaders/classicnoise2D.glsl) vec4 norm = taylorInvSqrt(vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); //LOCATION( 80, noise/shaders/classicnoise2D.glsl) g00 *= norm.x; //LOCATION( 81, noise/shaders/classicnoise2D.glsl) g01 *= norm.y; //LOCATION( 82, noise/shaders/classicnoise2D.glsl) g10 *= norm.z; //LOCATION( 83, noise/shaders/classicnoise2D.glsl) g11 *= norm.w; //LOCATION( 84, noise/shaders/classicnoise2D.glsl) //LOCATION( 85, noise/shaders/classicnoise2D.glsl) float n00 = dot(g00, vec2(fx.x, fy.x)); //LOCATION( 86, noise/shaders/classicnoise2D.glsl) float n10 = dot(g10, vec2(fx.y, fy.y)); //LOCATION( 87, noise/shaders/classicnoise2D.glsl) float n01 = dot(g01, vec2(fx.z, fy.z)); //LOCATION( 88, noise/shaders/classicnoise2D.glsl) float n11 = dot(g11, vec2(fx.w, fy.w)); //LOCATION( 89, noise/shaders/classicnoise2D.glsl) //LOCATION( 90, noise/shaders/classicnoise2D.glsl) vec2 fade_xy = fade(Pf.xy); //LOCATION( 91, noise/shaders/classicnoise2D.glsl) vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x); //LOCATION( 92, noise/shaders/classicnoise2D.glsl) float n_xy = mix(n_x.x, n_x.y, fade_xy.y); //LOCATION( 93, noise/shaders/classicnoise2D.glsl) return 2.3 * n_xy; //LOCATION( 94, noise/shaders/classicnoise2D.glsl) } //LOCATION( 95, noise/shaders/classicnoise2D.glsl) // //LOCATION( 1, noise/shaders/noise2D.glsl) // Description : Array and textureless GLSL 2D simplex noise function. //LOCATION( 2, noise/shaders/noise2D.glsl) // Author : Ian McEwan, Ashima Arts. //LOCATION( 3, noise/shaders/noise2D.glsl) // Maintainer : ijm //LOCATION( 4, noise/shaders/noise2D.glsl) // Lastmod : 20110822 (ijm) //LOCATION( 5, noise/shaders/noise2D.glsl) // License : Copyright (C) 2011 Ashima Arts. All rights reserved. //LOCATION( 6, noise/shaders/noise2D.glsl) // Distributed under the MIT License. See LICENSE file. //LOCATION( 7, noise/shaders/noise2D.glsl) // https://github.com/ashima/webgl-noise //LOCATION( 8, noise/shaders/noise2D.glsl) // //LOCATION( 9, noise/shaders/noise2D.glsl) //LOCATION( 10, noise/shaders/noise2D.glsl) //LOCATION( 11, noise/shaders/noise2D.glsl) //LOCATION( 12, noise/shaders/noise2D.glsl) float snoise(vec2 v) //LOCATION( 13, noise/shaders/noise2D.glsl) { //LOCATION( 14, noise/shaders/noise2D.glsl) const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0 //LOCATION( 15, noise/shaders/noise2D.glsl) 0.366025403784439, // 0.5*(sqrt(3.0)-1.0) //LOCATION( 16, noise/shaders/noise2D.glsl) -0.577350269189626, // -1.0 + 2.0 * C.x //LOCATION( 17, noise/shaders/noise2D.glsl) 0.024390243902439); // 1.0 / 41.0 //LOCATION( 18, noise/shaders/noise2D.glsl) // First corner //LOCATION( 19, noise/shaders/noise2D.glsl) vec2 i = floor(v + dot(v, C.yy) ); //LOCATION( 20, noise/shaders/noise2D.glsl) vec2 x0 = v - i + dot(i, C.xx); //LOCATION( 21, noise/shaders/noise2D.glsl) //LOCATION( 22, noise/shaders/noise2D.glsl) // Other corners //LOCATION( 23, noise/shaders/noise2D.glsl) vec2 i1; //LOCATION( 24, noise/shaders/noise2D.glsl) //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0 //LOCATION( 25, noise/shaders/noise2D.glsl) //i1.y = 1.0 - i1.x; //LOCATION( 26, noise/shaders/noise2D.glsl) i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0); //LOCATION( 27, noise/shaders/noise2D.glsl) // x0 = x0 - 0.0 + 0.0 * C.xx ; //LOCATION( 28, noise/shaders/noise2D.glsl) // x1 = x0 - i1 + 1.0 * C.xx ; //LOCATION( 29, noise/shaders/noise2D.glsl) // x2 = x0 - 1.0 + 2.0 * C.xx ; //LOCATION( 30, noise/shaders/noise2D.glsl) vec4 x12 = x0.xyxy + C.xxzz; //LOCATION( 31, noise/shaders/noise2D.glsl) x12.xy -= i1; //LOCATION( 32, noise/shaders/noise2D.glsl) //LOCATION( 33, noise/shaders/noise2D.glsl) // Permutations //LOCATION( 34, noise/shaders/noise2D.glsl) i = mod289(i); // Avoid truncation effects in permutation //LOCATION( 35, noise/shaders/noise2D.glsl) vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 )) //LOCATION( 36, noise/shaders/noise2D.glsl) + i.x + vec3(0.0, i1.x, 1.0 )); //LOCATION( 37, noise/shaders/noise2D.glsl) //LOCATION( 38, noise/shaders/noise2D.glsl) vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0); //LOCATION( 39, noise/shaders/noise2D.glsl) m = m*m ; //LOCATION( 40, noise/shaders/noise2D.glsl) m = m*m ; //LOCATION( 41, noise/shaders/noise2D.glsl) //LOCATION( 42, noise/shaders/noise2D.glsl) // Gradients: 41 points uniformly over a line, mapped onto a diamond. //LOCATION( 43, noise/shaders/noise2D.glsl) // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287) //LOCATION( 44, noise/shaders/noise2D.glsl) //LOCATION( 45, noise/shaders/noise2D.glsl) vec3 x = 2.0 * fract(p * C.www) - 1.0; //LOCATION( 46, noise/shaders/noise2D.glsl) vec3 h = abs(x) - 0.5; //LOCATION( 47, noise/shaders/noise2D.glsl) vec3 ox = floor(x + 0.5); //LOCATION( 48, noise/shaders/noise2D.glsl) vec3 a0 = x - ox; //LOCATION( 49, noise/shaders/noise2D.glsl) //LOCATION( 50, noise/shaders/noise2D.glsl) // Normalise gradients implicitly by scaling m //LOCATION( 51, noise/shaders/noise2D.glsl) // Approximation of: m *= inversesqrt( a0*a0 + h*h ); //LOCATION( 52, noise/shaders/noise2D.glsl) m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h ); //LOCATION( 53, noise/shaders/noise2D.glsl) //LOCATION( 54, noise/shaders/noise2D.glsl) // Compute final noise value at P //LOCATION( 55, noise/shaders/noise2D.glsl) vec3 g; //LOCATION( 56, noise/shaders/noise2D.glsl) g.x = a0.x * x0.x + h.x * x0.y; //LOCATION( 57, noise/shaders/noise2D.glsl) g.yz = a0.yz * x12.xz + h.yz * x12.yw; //LOCATION( 58, noise/shaders/noise2D.glsl) return 130.0 * dot(m, g); //LOCATION( 59, noise/shaders/noise2D.glsl) } //LOCATION( 60, noise/shaders/noise2D.glsl) // //LOCATION( 1, noise/shaders/classicnoise3D.glsl) // GLSL textureless classic 3D noise "cnoise", //LOCATION( 2, noise/shaders/classicnoise3D.glsl) // with an RSL-style periodic variant "pnoise". //LOCATION( 3, noise/shaders/classicnoise3D.glsl) // Author: Stefan Gustavson (stefan.gustavson@liu.se) //LOCATION( 4, noise/shaders/classicnoise3D.glsl) // Version: 2011-10-11 //LOCATION( 5, noise/shaders/classicnoise3D.glsl) // //LOCATION( 6, noise/shaders/classicnoise3D.glsl) // Many thanks to Ian McEwan of Ashima Arts for the //LOCATION( 7, noise/shaders/classicnoise3D.glsl) // ideas for permutation and gradient selection. //LOCATION( 8, noise/shaders/classicnoise3D.glsl) // //LOCATION( 9, noise/shaders/classicnoise3D.glsl) // Copyright (c) 2011 Stefan Gustavson. All rights reserved. //LOCATION( 10, noise/shaders/classicnoise3D.glsl) // Distributed under the MIT license. See LICENSE file. //LOCATION( 11, noise/shaders/classicnoise3D.glsl) // https://github.com/ashima/webgl-noise //LOCATION( 12, noise/shaders/classicnoise3D.glsl) // //LOCATION( 13, noise/shaders/classicnoise3D.glsl) //LOCATION( 14, noise/shaders/classicnoise3D.glsl) //LOCATION( 15, noise/shaders/classicnoise3D.glsl) //LOCATION( 16, noise/shaders/classicnoise3D.glsl) // Classic Perlin noise //LOCATION( 17, noise/shaders/classicnoise3D.glsl) float cnoise(vec3 P) //LOCATION( 18, noise/shaders/classicnoise3D.glsl) { //LOCATION( 19, noise/shaders/classicnoise3D.glsl) vec3 Pi0 = floor(P); // Integer part for indexing //LOCATION( 20, noise/shaders/classicnoise3D.glsl) vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1 //LOCATION( 21, noise/shaders/classicnoise3D.glsl) Pi0 = mod289(Pi0); //LOCATION( 22, noise/shaders/classicnoise3D.glsl) Pi1 = mod289(Pi1); //LOCATION( 23, noise/shaders/classicnoise3D.glsl) vec3 Pf0 = fract(P); // Fractional part for interpolation //LOCATION( 24, noise/shaders/classicnoise3D.glsl) vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0 //LOCATION( 25, noise/shaders/classicnoise3D.glsl) vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); //LOCATION( 26, noise/shaders/classicnoise3D.glsl) vec4 iy = vec4(Pi0.yy, Pi1.yy); //LOCATION( 27, noise/shaders/classicnoise3D.glsl) vec4 iz0 = Pi0.zzzz; //LOCATION( 28, noise/shaders/classicnoise3D.glsl) vec4 iz1 = Pi1.zzzz; //LOCATION( 29, noise/shaders/classicnoise3D.glsl) //LOCATION( 30, noise/shaders/classicnoise3D.glsl) vec4 ixy = permute(permute(ix) + iy); //LOCATION( 31, noise/shaders/classicnoise3D.glsl) vec4 ixy0 = permute(ixy + iz0); //LOCATION( 32, noise/shaders/classicnoise3D.glsl) vec4 ixy1 = permute(ixy + iz1); //LOCATION( 33, noise/shaders/classicnoise3D.glsl) //LOCATION( 34, noise/shaders/classicnoise3D.glsl) vec4 gx0 = ixy0 * (1.0 / 7.0); //LOCATION( 35, noise/shaders/classicnoise3D.glsl) vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5; //LOCATION( 36, noise/shaders/classicnoise3D.glsl) gx0 = fract(gx0); //LOCATION( 37, noise/shaders/classicnoise3D.glsl) vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); //LOCATION( 38, noise/shaders/classicnoise3D.glsl) vec4 sz0 = step(gz0, vec4(0.0)); //LOCATION( 39, noise/shaders/classicnoise3D.glsl) gx0 -= sz0 * (step(0.0, gx0) - 0.5); //LOCATION( 40, noise/shaders/classicnoise3D.glsl) gy0 -= sz0 * (step(0.0, gy0) - 0.5); //LOCATION( 41, noise/shaders/classicnoise3D.glsl) //LOCATION( 42, noise/shaders/classicnoise3D.glsl) vec4 gx1 = ixy1 * (1.0 / 7.0); //LOCATION( 43, noise/shaders/classicnoise3D.glsl) vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5; //LOCATION( 44, noise/shaders/classicnoise3D.glsl) gx1 = fract(gx1); //LOCATION( 45, noise/shaders/classicnoise3D.glsl) vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); //LOCATION( 46, noise/shaders/classicnoise3D.glsl) vec4 sz1 = step(gz1, vec4(0.0)); //LOCATION( 47, noise/shaders/classicnoise3D.glsl) gx1 -= sz1 * (step(0.0, gx1) - 0.5); //LOCATION( 48, noise/shaders/classicnoise3D.glsl) gy1 -= sz1 * (step(0.0, gy1) - 0.5); //LOCATION( 49, noise/shaders/classicnoise3D.glsl) //LOCATION( 50, noise/shaders/classicnoise3D.glsl) vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); //LOCATION( 51, noise/shaders/classicnoise3D.glsl) vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); //LOCATION( 52, noise/shaders/classicnoise3D.glsl) vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); //LOCATION( 53, noise/shaders/classicnoise3D.glsl) vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); //LOCATION( 54, noise/shaders/classicnoise3D.glsl) vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); //LOCATION( 55, noise/shaders/classicnoise3D.glsl) vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); //LOCATION( 56, noise/shaders/classicnoise3D.glsl) vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); //LOCATION( 57, noise/shaders/classicnoise3D.glsl) vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); //LOCATION( 58, noise/shaders/classicnoise3D.glsl) //LOCATION( 59, noise/shaders/classicnoise3D.glsl) vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); //LOCATION( 60, noise/shaders/classicnoise3D.glsl) g000 *= norm0.x; //LOCATION( 61, noise/shaders/classicnoise3D.glsl) g010 *= norm0.y; //LOCATION( 62, noise/shaders/classicnoise3D.glsl) g100 *= norm0.z; //LOCATION( 63, noise/shaders/classicnoise3D.glsl) g110 *= norm0.w; //LOCATION( 64, noise/shaders/classicnoise3D.glsl) vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); //LOCATION( 65, noise/shaders/classicnoise3D.glsl) g001 *= norm1.x; //LOCATION( 66, noise/shaders/classicnoise3D.glsl) g011 *= norm1.y; //LOCATION( 67, noise/shaders/classicnoise3D.glsl) g101 *= norm1.z; //LOCATION( 68, noise/shaders/classicnoise3D.glsl) g111 *= norm1.w; //LOCATION( 69, noise/shaders/classicnoise3D.glsl) //LOCATION( 70, noise/shaders/classicnoise3D.glsl) float n000 = dot(g000, Pf0); //LOCATION( 71, noise/shaders/classicnoise3D.glsl) float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); //LOCATION( 72, noise/shaders/classicnoise3D.glsl) float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); //LOCATION( 73, noise/shaders/classicnoise3D.glsl) float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); //LOCATION( 74, noise/shaders/classicnoise3D.glsl) float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); //LOCATION( 75, noise/shaders/classicnoise3D.glsl) float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); //LOCATION( 76, noise/shaders/classicnoise3D.glsl) float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); //LOCATION( 77, noise/shaders/classicnoise3D.glsl) float n111 = dot(g111, Pf1); //LOCATION( 78, noise/shaders/classicnoise3D.glsl) //LOCATION( 79, noise/shaders/classicnoise3D.glsl) vec3 fade_xyz = fade(Pf0); //LOCATION( 80, noise/shaders/classicnoise3D.glsl) vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); //LOCATION( 81, noise/shaders/classicnoise3D.glsl) vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); //LOCATION( 82, noise/shaders/classicnoise3D.glsl) float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); //LOCATION( 83, noise/shaders/classicnoise3D.glsl) return 2.2 * n_xyz; //LOCATION( 84, noise/shaders/classicnoise3D.glsl) } //LOCATION( 85, noise/shaders/classicnoise3D.glsl) //LOCATION( 86, noise/shaders/classicnoise3D.glsl) // Classic Perlin noise, periodic variant //LOCATION( 87, noise/shaders/classicnoise3D.glsl) float pnoise(vec3 P, vec3 rep) //LOCATION( 88, noise/shaders/classicnoise3D.glsl) { //LOCATION( 89, noise/shaders/classicnoise3D.glsl) vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period //LOCATION( 90, noise/shaders/classicnoise3D.glsl) vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period //LOCATION( 91, noise/shaders/classicnoise3D.glsl) Pi0 = mod289(Pi0); //LOCATION( 92, noise/shaders/classicnoise3D.glsl) Pi1 = mod289(Pi1); //LOCATION( 93, noise/shaders/classicnoise3D.glsl) vec3 Pf0 = fract(P); // Fractional part for interpolation //LOCATION( 94, noise/shaders/classicnoise3D.glsl) vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0 //LOCATION( 95, noise/shaders/classicnoise3D.glsl) vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); //LOCATION( 96, noise/shaders/classicnoise3D.glsl) vec4 iy = vec4(Pi0.yy, Pi1.yy); //LOCATION( 97, noise/shaders/classicnoise3D.glsl) vec4 iz0 = Pi0.zzzz; //LOCATION( 98, noise/shaders/classicnoise3D.glsl) vec4 iz1 = Pi1.zzzz; //LOCATION( 99, noise/shaders/classicnoise3D.glsl) //LOCATION(100, noise/shaders/classicnoise3D.glsl) vec4 ixy = permute(permute(ix) + iy); //LOCATION(101, noise/shaders/classicnoise3D.glsl) vec4 ixy0 = permute(ixy + iz0); //LOCATION(102, noise/shaders/classicnoise3D.glsl) vec4 ixy1 = permute(ixy + iz1); //LOCATION(103, noise/shaders/classicnoise3D.glsl) //LOCATION(104, noise/shaders/classicnoise3D.glsl) vec4 gx0 = ixy0 * (1.0 / 7.0); //LOCATION(105, noise/shaders/classicnoise3D.glsl) vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5; //LOCATION(106, noise/shaders/classicnoise3D.glsl) gx0 = fract(gx0); //LOCATION(107, noise/shaders/classicnoise3D.glsl) vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); //LOCATION(108, noise/shaders/classicnoise3D.glsl) vec4 sz0 = step(gz0, vec4(0.0)); //LOCATION(109, noise/shaders/classicnoise3D.glsl) gx0 -= sz0 * (step(0.0, gx0) - 0.5); //LOCATION(110, noise/shaders/classicnoise3D.glsl) gy0 -= sz0 * (step(0.0, gy0) - 0.5); //LOCATION(111, noise/shaders/classicnoise3D.glsl) //LOCATION(112, noise/shaders/classicnoise3D.glsl) vec4 gx1 = ixy1 * (1.0 / 7.0); //LOCATION(113, noise/shaders/classicnoise3D.glsl) vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5; //LOCATION(114, noise/shaders/classicnoise3D.glsl) gx1 = fract(gx1); //LOCATION(115, noise/shaders/classicnoise3D.glsl) vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); //LOCATION(116, noise/shaders/classicnoise3D.glsl) vec4 sz1 = step(gz1, vec4(0.0)); //LOCATION(117, noise/shaders/classicnoise3D.glsl) gx1 -= sz1 * (step(0.0, gx1) - 0.5); //LOCATION(118, noise/shaders/classicnoise3D.glsl) gy1 -= sz1 * (step(0.0, gy1) - 0.5); //LOCATION(119, noise/shaders/classicnoise3D.glsl) //LOCATION(120, noise/shaders/classicnoise3D.glsl) vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); //LOCATION(121, noise/shaders/classicnoise3D.glsl) vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); //LOCATION(122, noise/shaders/classicnoise3D.glsl) vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); //LOCATION(123, noise/shaders/classicnoise3D.glsl) vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); //LOCATION(124, noise/shaders/classicnoise3D.glsl) vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); //LOCATION(125, noise/shaders/classicnoise3D.glsl) vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); //LOCATION(126, noise/shaders/classicnoise3D.glsl) vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); //LOCATION(127, noise/shaders/classicnoise3D.glsl) vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); //LOCATION(128, noise/shaders/classicnoise3D.glsl) //LOCATION(129, noise/shaders/classicnoise3D.glsl) vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); //LOCATION(130, noise/shaders/classicnoise3D.glsl) g000 *= norm0.x; //LOCATION(131, noise/shaders/classicnoise3D.glsl) g010 *= norm0.y; //LOCATION(132, noise/shaders/classicnoise3D.glsl) g100 *= norm0.z; //LOCATION(133, noise/shaders/classicnoise3D.glsl) g110 *= norm0.w; //LOCATION(134, noise/shaders/classicnoise3D.glsl) vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); //LOCATION(135, noise/shaders/classicnoise3D.glsl) g001 *= norm1.x; //LOCATION(136, noise/shaders/classicnoise3D.glsl) g011 *= norm1.y; //LOCATION(137, noise/shaders/classicnoise3D.glsl) g101 *= norm1.z; //LOCATION(138, noise/shaders/classicnoise3D.glsl) g111 *= norm1.w; //LOCATION(139, noise/shaders/classicnoise3D.glsl) //LOCATION(140, noise/shaders/classicnoise3D.glsl) float n000 = dot(g000, Pf0); //LOCATION(141, noise/shaders/classicnoise3D.glsl) float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); //LOCATION(142, noise/shaders/classicnoise3D.glsl) float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); //LOCATION(143, noise/shaders/classicnoise3D.glsl) float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); //LOCATION(144, noise/shaders/classicnoise3D.glsl) float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); //LOCATION(145, noise/shaders/classicnoise3D.glsl) float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); //LOCATION(146, noise/shaders/classicnoise3D.glsl) float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); //LOCATION(147, noise/shaders/classicnoise3D.glsl) float n111 = dot(g111, Pf1); //LOCATION(148, noise/shaders/classicnoise3D.glsl) //LOCATION(149, noise/shaders/classicnoise3D.glsl) vec3 fade_xyz = fade(Pf0); //LOCATION(150, noise/shaders/classicnoise3D.glsl) vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); //LOCATION(151, noise/shaders/classicnoise3D.glsl) vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); //LOCATION(152, noise/shaders/classicnoise3D.glsl) float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); //LOCATION(153, noise/shaders/classicnoise3D.glsl) return 2.2 * n_xyz; //LOCATION(154, noise/shaders/classicnoise3D.glsl) } //LOCATION(155, noise/shaders/classicnoise3D.glsl) // //LOCATION( 1, noise/shaders/noise3D.glsl) // Description : Array and textureless GLSL 2D/3D/4D simplex //LOCATION( 2, noise/shaders/noise3D.glsl) // noise functions. //LOCATION( 3, noise/shaders/noise3D.glsl) // Author : Ian McEwan, Ashima Arts. //LOCATION( 4, noise/shaders/noise3D.glsl) // Maintainer : ijm //LOCATION( 5, noise/shaders/noise3D.glsl) // Lastmod : 20110822 (ijm) //LOCATION( 6, noise/shaders/noise3D.glsl) // License : Copyright (C) 2011 Ashima Arts. All rights reserved. //LOCATION( 7, noise/shaders/noise3D.glsl) // Distributed under the MIT License. See LICENSE file. //LOCATION( 8, noise/shaders/noise3D.glsl) // https://github.com/ashima/webgl-noise //LOCATION( 9, noise/shaders/noise3D.glsl) // //LOCATION( 10, noise/shaders/noise3D.glsl) //LOCATION( 11, noise/shaders/noise3D.glsl) //LOCATION( 12, noise/shaders/noise3D.glsl) //LOCATION( 13, noise/shaders/noise3D.glsl) float snoise(vec3 v) //LOCATION( 14, noise/shaders/noise3D.glsl) { //LOCATION( 15, noise/shaders/noise3D.glsl) const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; //LOCATION( 16, noise/shaders/noise3D.glsl) const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); //LOCATION( 17, noise/shaders/noise3D.glsl) //LOCATION( 18, noise/shaders/noise3D.glsl) // First corner //LOCATION( 19, noise/shaders/noise3D.glsl) vec3 i = floor(v + dot(v, C.yyy) ); //LOCATION( 20, noise/shaders/noise3D.glsl) vec3 x0 = v - i + dot(i, C.xxx) ; //LOCATION( 21, noise/shaders/noise3D.glsl) //LOCATION( 22, noise/shaders/noise3D.glsl) // Other corners //LOCATION( 23, noise/shaders/noise3D.glsl) vec3 g = step(x0.yzx, x0.xyz); //LOCATION( 24, noise/shaders/noise3D.glsl) vec3 l = 1.0 - g; //LOCATION( 25, noise/shaders/noise3D.glsl) vec3 i1 = min( g.xyz, l.zxy ); //LOCATION( 26, noise/shaders/noise3D.glsl) vec3 i2 = max( g.xyz, l.zxy ); //LOCATION( 27, noise/shaders/noise3D.glsl) //LOCATION( 28, noise/shaders/noise3D.glsl) // x0 = x0 - 0.0 + 0.0 * C.xxx; //LOCATION( 29, noise/shaders/noise3D.glsl) // x1 = x0 - i1 + 1.0 * C.xxx; //LOCATION( 30, noise/shaders/noise3D.glsl) // x2 = x0 - i2 + 2.0 * C.xxx; //LOCATION( 31, noise/shaders/noise3D.glsl) // x3 = x0 - 1.0 + 3.0 * C.xxx; //LOCATION( 32, noise/shaders/noise3D.glsl) vec3 x1 = x0 - i1 + C.xxx; //LOCATION( 33, noise/shaders/noise3D.glsl) vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y //LOCATION( 34, noise/shaders/noise3D.glsl) vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y //LOCATION( 35, noise/shaders/noise3D.glsl) //LOCATION( 36, noise/shaders/noise3D.glsl) // Permutations //LOCATION( 37, noise/shaders/noise3D.glsl) i = mod289(i); //LOCATION( 38, noise/shaders/noise3D.glsl) vec4 p = permute( permute( permute( //LOCATION( 39, noise/shaders/noise3D.glsl) i.z + vec4(0.0, i1.z, i2.z, 1.0 )) //LOCATION( 40, noise/shaders/noise3D.glsl) + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) //LOCATION( 41, noise/shaders/noise3D.glsl) + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); //LOCATION( 42, noise/shaders/noise3D.glsl) //LOCATION( 43, noise/shaders/noise3D.glsl) // Gradients: 7x7 points over a square, mapped onto an octahedron. //LOCATION( 44, noise/shaders/noise3D.glsl) // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) //LOCATION( 45, noise/shaders/noise3D.glsl) float n_ = 0.142857142857; // 1.0/7.0 //LOCATION( 46, noise/shaders/noise3D.glsl) vec3 ns = n_ * D.wyz - D.xzx; //LOCATION( 47, noise/shaders/noise3D.glsl) //LOCATION( 48, noise/shaders/noise3D.glsl) vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7) //LOCATION( 49, noise/shaders/noise3D.glsl) //LOCATION( 50, noise/shaders/noise3D.glsl) vec4 x_ = floor(j * ns.z); //LOCATION( 51, noise/shaders/noise3D.glsl) vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) //LOCATION( 52, noise/shaders/noise3D.glsl) //LOCATION( 53, noise/shaders/noise3D.glsl) vec4 x = x_ *ns.x + ns.yyyy; //LOCATION( 54, noise/shaders/noise3D.glsl) vec4 y = y_ *ns.x + ns.yyyy; //LOCATION( 55, noise/shaders/noise3D.glsl) vec4 h = 1.0 - abs(x) - abs(y); //LOCATION( 56, noise/shaders/noise3D.glsl) //LOCATION( 57, noise/shaders/noise3D.glsl) vec4 b0 = vec4( x.xy, y.xy ); //LOCATION( 58, noise/shaders/noise3D.glsl) vec4 b1 = vec4( x.zw, y.zw ); //LOCATION( 59, noise/shaders/noise3D.glsl) //LOCATION( 60, noise/shaders/noise3D.glsl) //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0; //LOCATION( 61, noise/shaders/noise3D.glsl) //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0; //LOCATION( 62, noise/shaders/noise3D.glsl) vec4 s0 = floor(b0)*2.0 + 1.0; //LOCATION( 63, noise/shaders/noise3D.glsl) vec4 s1 = floor(b1)*2.0 + 1.0; //LOCATION( 64, noise/shaders/noise3D.glsl) vec4 sh = -step(h, vec4(0.0)); //LOCATION( 65, noise/shaders/noise3D.glsl) //LOCATION( 66, noise/shaders/noise3D.glsl) vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; //LOCATION( 67, noise/shaders/noise3D.glsl) vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; //LOCATION( 68, noise/shaders/noise3D.glsl) //LOCATION( 69, noise/shaders/noise3D.glsl) vec3 p0 = vec3(a0.xy,h.x); //LOCATION( 70, noise/shaders/noise3D.glsl) vec3 p1 = vec3(a0.zw,h.y); //LOCATION( 71, noise/shaders/noise3D.glsl) vec3 p2 = vec3(a1.xy,h.z); //LOCATION( 72, noise/shaders/noise3D.glsl) vec3 p3 = vec3(a1.zw,h.w); //LOCATION( 73, noise/shaders/noise3D.glsl) //LOCATION( 74, noise/shaders/noise3D.glsl) //Normalise gradients //LOCATION( 75, noise/shaders/noise3D.glsl) vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); //LOCATION( 76, noise/shaders/noise3D.glsl) p0 *= norm.x; //LOCATION( 77, noise/shaders/noise3D.glsl) p1 *= norm.y; //LOCATION( 78, noise/shaders/noise3D.glsl) p2 *= norm.z; //LOCATION( 79, noise/shaders/noise3D.glsl) p3 *= norm.w; //LOCATION( 80, noise/shaders/noise3D.glsl) //LOCATION( 81, noise/shaders/noise3D.glsl) // Mix final noise value //LOCATION( 82, noise/shaders/noise3D.glsl) vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); //LOCATION( 83, noise/shaders/noise3D.glsl) m = m * m; //LOCATION( 84, noise/shaders/noise3D.glsl) return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), //LOCATION( 85, noise/shaders/noise3D.glsl) dot(p2,x2), dot(p3,x3) ) ); //LOCATION( 86, noise/shaders/noise3D.glsl) } //LOCATION( 87, noise/shaders/noise3D.glsl) // //LOCATION( 1, noise/shaders/classicnoise4D.glsl) // GLSL textureless classic 4D noise "cnoise", //LOCATION( 2, noise/shaders/classicnoise4D.glsl) // with an RSL-style periodic variant "pnoise". //LOCATION( 3, noise/shaders/classicnoise4D.glsl) // Author: Stefan Gustavson (stefan.gustavson@liu.se) //LOCATION( 4, noise/shaders/classicnoise4D.glsl) // Version: 2011-08-22 //LOCATION( 5, noise/shaders/classicnoise4D.glsl) // //LOCATION( 6, noise/shaders/classicnoise4D.glsl) // Many thanks to Ian McEwan of Ashima Arts for the //LOCATION( 7, noise/shaders/classicnoise4D.glsl) // ideas for permutation and gradient selection. //LOCATION( 8, noise/shaders/classicnoise4D.glsl) // //LOCATION( 9, noise/shaders/classicnoise4D.glsl) // Copyright (c) 2011 Stefan Gustavson. All rights reserved. //LOCATION( 10, noise/shaders/classicnoise4D.glsl) // Distributed under the MIT license. See LICENSE file. //LOCATION( 11, noise/shaders/classicnoise4D.glsl) // https://github.com/ashima/webgl-noise //LOCATION( 12, noise/shaders/classicnoise4D.glsl) // //LOCATION( 13, noise/shaders/classicnoise4D.glsl) //LOCATION( 14, noise/shaders/classicnoise4D.glsl) //LOCATION( 15, noise/shaders/classicnoise4D.glsl) //LOCATION( 16, noise/shaders/classicnoise4D.glsl) // Classic Perlin noise //LOCATION( 17, noise/shaders/classicnoise4D.glsl) float cnoise(vec4 P) //LOCATION( 18, noise/shaders/classicnoise4D.glsl) { //LOCATION( 19, noise/shaders/classicnoise4D.glsl) vec4 Pi0 = floor(P); // Integer part for indexing //LOCATION( 20, noise/shaders/classicnoise4D.glsl) vec4 Pi1 = Pi0 + 1.0; // Integer part + 1 //LOCATION( 21, noise/shaders/classicnoise4D.glsl) Pi0 = mod289(Pi0); //LOCATION( 22, noise/shaders/classicnoise4D.glsl) Pi1 = mod289(Pi1); //LOCATION( 23, noise/shaders/classicnoise4D.glsl) vec4 Pf0 = fract(P); // Fractional part for interpolation //LOCATION( 24, noise/shaders/classicnoise4D.glsl) vec4 Pf1 = Pf0 - 1.0; // Fractional part - 1.0 //LOCATION( 25, noise/shaders/classicnoise4D.glsl) vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); //LOCATION( 26, noise/shaders/classicnoise4D.glsl) vec4 iy = vec4(Pi0.yy, Pi1.yy); //LOCATION( 27, noise/shaders/classicnoise4D.glsl) vec4 iz0 = vec4(Pi0.zzzz); //LOCATION( 28, noise/shaders/classicnoise4D.glsl) vec4 iz1 = vec4(Pi1.zzzz); //LOCATION( 29, noise/shaders/classicnoise4D.glsl) vec4 iw0 = vec4(Pi0.wwww); //LOCATION( 30, noise/shaders/classicnoise4D.glsl) vec4 iw1 = vec4(Pi1.wwww); //LOCATION( 31, noise/shaders/classicnoise4D.glsl) //LOCATION( 32, noise/shaders/classicnoise4D.glsl) vec4 ixy = permute(permute(ix) + iy); //LOCATION( 33, noise/shaders/classicnoise4D.glsl) vec4 ixy0 = permute(ixy + iz0); //LOCATION( 34, noise/shaders/classicnoise4D.glsl) vec4 ixy1 = permute(ixy + iz1); //LOCATION( 35, noise/shaders/classicnoise4D.glsl) vec4 ixy00 = permute(ixy0 + iw0); //LOCATION( 36, noise/shaders/classicnoise4D.glsl) vec4 ixy01 = permute(ixy0 + iw1); //LOCATION( 37, noise/shaders/classicnoise4D.glsl) vec4 ixy10 = permute(ixy1 + iw0); //LOCATION( 38, noise/shaders/classicnoise4D.glsl) vec4 ixy11 = permute(ixy1 + iw1); //LOCATION( 39, noise/shaders/classicnoise4D.glsl) //LOCATION( 40, noise/shaders/classicnoise4D.glsl) vec4 gx00 = ixy00 * (1.0 / 7.0); //LOCATION( 41, noise/shaders/classicnoise4D.glsl) vec4 gy00 = floor(gx00) * (1.0 / 7.0); //LOCATION( 42, noise/shaders/classicnoise4D.glsl) vec4 gz00 = floor(gy00) * (1.0 / 6.0); //LOCATION( 43, noise/shaders/classicnoise4D.glsl) gx00 = fract(gx00) - 0.5; //LOCATION( 44, noise/shaders/classicnoise4D.glsl) gy00 = fract(gy00) - 0.5; //LOCATION( 45, noise/shaders/classicnoise4D.glsl) gz00 = fract(gz00) - 0.5; //LOCATION( 46, noise/shaders/classicnoise4D.glsl) vec4 gw00 = vec4(0.75) - abs(gx00) - abs(gy00) - abs(gz00); //LOCATION( 47, noise/shaders/classicnoise4D.glsl) vec4 sw00 = step(gw00, vec4(0.0)); //LOCATION( 48, noise/shaders/classicnoise4D.glsl) gx00 -= sw00 * (step(0.0, gx00) - 0.5); //LOCATION( 49, noise/shaders/classicnoise4D.glsl) gy00 -= sw00 * (step(0.0, gy00) - 0.5); //LOCATION( 50, noise/shaders/classicnoise4D.glsl) //LOCATION( 51, noise/shaders/classicnoise4D.glsl) vec4 gx01 = ixy01 * (1.0 / 7.0); //LOCATION( 52, noise/shaders/classicnoise4D.glsl) vec4 gy01 = floor(gx01) * (1.0 / 7.0); //LOCATION( 53, noise/shaders/classicnoise4D.glsl) vec4 gz01 = floor(gy01) * (1.0 / 6.0); //LOCATION( 54, noise/shaders/classicnoise4D.glsl) gx01 = fract(gx01) - 0.5; //LOCATION( 55, noise/shaders/classicnoise4D.glsl) gy01 = fract(gy01) - 0.5; //LOCATION( 56, noise/shaders/classicnoise4D.glsl) gz01 = fract(gz01) - 0.5; //LOCATION( 57, noise/shaders/classicnoise4D.glsl) vec4 gw01 = vec4(0.75) - abs(gx01) - abs(gy01) - abs(gz01); //LOCATION( 58, noise/shaders/classicnoise4D.glsl) vec4 sw01 = step(gw01, vec4(0.0)); //LOCATION( 59, noise/shaders/classicnoise4D.glsl) gx01 -= sw01 * (step(0.0, gx01) - 0.5); //LOCATION( 60, noise/shaders/classicnoise4D.glsl) gy01 -= sw01 * (step(0.0, gy01) - 0.5); //LOCATION( 61, noise/shaders/classicnoise4D.glsl) //LOCATION( 62, noise/shaders/classicnoise4D.glsl) vec4 gx10 = ixy10 * (1.0 / 7.0); //LOCATION( 63, noise/shaders/classicnoise4D.glsl) vec4 gy10 = floor(gx10) * (1.0 / 7.0); //LOCATION( 64, noise/shaders/classicnoise4D.glsl) vec4 gz10 = floor(gy10) * (1.0 / 6.0); //LOCATION( 65, noise/shaders/classicnoise4D.glsl) gx10 = fract(gx10) - 0.5; //LOCATION( 66, noise/shaders/classicnoise4D.glsl) gy10 = fract(gy10) - 0.5; //LOCATION( 67, noise/shaders/classicnoise4D.glsl) gz10 = fract(gz10) - 0.5; //LOCATION( 68, noise/shaders/classicnoise4D.glsl) vec4 gw10 = vec4(0.75) - abs(gx10) - abs(gy10) - abs(gz10); //LOCATION( 69, noise/shaders/classicnoise4D.glsl) vec4 sw10 = step(gw10, vec4(0.0)); //LOCATION( 70, noise/shaders/classicnoise4D.glsl) gx10 -= sw10 * (step(0.0, gx10) - 0.5); //LOCATION( 71, noise/shaders/classicnoise4D.glsl) gy10 -= sw10 * (step(0.0, gy10) - 0.5); //LOCATION( 72, noise/shaders/classicnoise4D.glsl) //LOCATION( 73, noise/shaders/classicnoise4D.glsl) vec4 gx11 = ixy11 * (1.0 / 7.0); //LOCATION( 74, noise/shaders/classicnoise4D.glsl) vec4 gy11 = floor(gx11) * (1.0 / 7.0); //LOCATION( 75, noise/shaders/classicnoise4D.glsl) vec4 gz11 = floor(gy11) * (1.0 / 6.0); //LOCATION( 76, noise/shaders/classicnoise4D.glsl) gx11 = fract(gx11) - 0.5; //LOCATION( 77, noise/shaders/classicnoise4D.glsl) gy11 = fract(gy11) - 0.5; //LOCATION( 78, noise/shaders/classicnoise4D.glsl) gz11 = fract(gz11) - 0.5; //LOCATION( 79, noise/shaders/classicnoise4D.glsl) vec4 gw11 = vec4(0.75) - abs(gx11) - abs(gy11) - abs(gz11); //LOCATION( 80, noise/shaders/classicnoise4D.glsl) vec4 sw11 = step(gw11, vec4(0.0)); //LOCATION( 81, noise/shaders/classicnoise4D.glsl) gx11 -= sw11 * (step(0.0, gx11) - 0.5); //LOCATION( 82, noise/shaders/classicnoise4D.glsl) gy11 -= sw11 * (step(0.0, gy11) - 0.5); //LOCATION( 83, noise/shaders/classicnoise4D.glsl) //LOCATION( 84, noise/shaders/classicnoise4D.glsl) vec4 g0000 = vec4(gx00.x,gy00.x,gz00.x,gw00.x); //LOCATION( 85, noise/shaders/classicnoise4D.glsl) vec4 g1000 = vec4(gx00.y,gy00.y,gz00.y,gw00.y); //LOCATION( 86, noise/shaders/classicnoise4D.glsl) vec4 g0100 = vec4(gx00.z,gy00.z,gz00.z,gw00.z); //LOCATION( 87, noise/shaders/classicnoise4D.glsl) vec4 g1100 = vec4(gx00.w,gy00.w,gz00.w,gw00.w); //LOCATION( 88, noise/shaders/classicnoise4D.glsl) vec4 g0010 = vec4(gx10.x,gy10.x,gz10.x,gw10.x); //LOCATION( 89, noise/shaders/classicnoise4D.glsl) vec4 g1010 = vec4(gx10.y,gy10.y,gz10.y,gw10.y); //LOCATION( 90, noise/shaders/classicnoise4D.glsl) vec4 g0110 = vec4(gx10.z,gy10.z,gz10.z,gw10.z); //LOCATION( 91, noise/shaders/classicnoise4D.glsl) vec4 g1110 = vec4(gx10.w,gy10.w,gz10.w,gw10.w); //LOCATION( 92, noise/shaders/classicnoise4D.glsl) vec4 g0001 = vec4(gx01.x,gy01.x,gz01.x,gw01.x); //LOCATION( 93, noise/shaders/classicnoise4D.glsl) vec4 g1001 = vec4(gx01.y,gy01.y,gz01.y,gw01.y); //LOCATION( 94, noise/shaders/classicnoise4D.glsl) vec4 g0101 = vec4(gx01.z,gy01.z,gz01.z,gw01.z); //LOCATION( 95, noise/shaders/classicnoise4D.glsl) vec4 g1101 = vec4(gx01.w,gy01.w,gz01.w,gw01.w); //LOCATION( 96, noise/shaders/classicnoise4D.glsl) vec4 g0011 = vec4(gx11.x,gy11.x,gz11.x,gw11.x); //LOCATION( 97, noise/shaders/classicnoise4D.glsl) vec4 g1011 = vec4(gx11.y,gy11.y,gz11.y,gw11.y); //LOCATION( 98, noise/shaders/classicnoise4D.glsl) vec4 g0111 = vec4(gx11.z,gy11.z,gz11.z,gw11.z); //LOCATION( 99, noise/shaders/classicnoise4D.glsl) vec4 g1111 = vec4(gx11.w,gy11.w,gz11.w,gw11.w); //LOCATION(100, noise/shaders/classicnoise4D.glsl) //LOCATION(101, noise/shaders/classicnoise4D.glsl) vec4 norm00 = taylorInvSqrt(vec4(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); //LOCATION(102, noise/shaders/classicnoise4D.glsl) g0000 *= norm00.x; //LOCATION(103, noise/shaders/classicnoise4D.glsl) g0100 *= norm00.y; //LOCATION(104, noise/shaders/classicnoise4D.glsl) g1000 *= norm00.z; //LOCATION(105, noise/shaders/classicnoise4D.glsl) g1100 *= norm00.w; //LOCATION(106, noise/shaders/classicnoise4D.glsl) //LOCATION(107, noise/shaders/classicnoise4D.glsl) vec4 norm01 = taylorInvSqrt(vec4(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); //LOCATION(108, noise/shaders/classicnoise4D.glsl) g0001 *= norm01.x; //LOCATION(109, noise/shaders/classicnoise4D.glsl) g0101 *= norm01.y; //LOCATION(110, noise/shaders/classicnoise4D.glsl) g1001 *= norm01.z; //LOCATION(111, noise/shaders/classicnoise4D.glsl) g1101 *= norm01.w; //LOCATION(112, noise/shaders/classicnoise4D.glsl) //LOCATION(113, noise/shaders/classicnoise4D.glsl) vec4 norm10 = taylorInvSqrt(vec4(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); //LOCATION(114, noise/shaders/classicnoise4D.glsl) g0010 *= norm10.x; //LOCATION(115, noise/shaders/classicnoise4D.glsl) g0110 *= norm10.y; //LOCATION(116, noise/shaders/classicnoise4D.glsl) g1010 *= norm10.z; //LOCATION(117, noise/shaders/classicnoise4D.glsl) g1110 *= norm10.w; //LOCATION(118, noise/shaders/classicnoise4D.glsl) //LOCATION(119, noise/shaders/classicnoise4D.glsl) vec4 norm11 = taylorInvSqrt(vec4(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); //LOCATION(120, noise/shaders/classicnoise4D.glsl) g0011 *= norm11.x; //LOCATION(121, noise/shaders/classicnoise4D.glsl) g0111 *= norm11.y; //LOCATION(122, noise/shaders/classicnoise4D.glsl) g1011 *= norm11.z; //LOCATION(123, noise/shaders/classicnoise4D.glsl) g1111 *= norm11.w; //LOCATION(124, noise/shaders/classicnoise4D.glsl) //LOCATION(125, noise/shaders/classicnoise4D.glsl) float n0000 = dot(g0000, Pf0); //LOCATION(126, noise/shaders/classicnoise4D.glsl) float n1000 = dot(g1000, vec4(Pf1.x, Pf0.yzw)); //LOCATION(127, noise/shaders/classicnoise4D.glsl) float n0100 = dot(g0100, vec4(Pf0.x, Pf1.y, Pf0.zw)); //LOCATION(128, noise/shaders/classicnoise4D.glsl) float n1100 = dot(g1100, vec4(Pf1.xy, Pf0.zw)); //LOCATION(129, noise/shaders/classicnoise4D.glsl) float n0010 = dot(g0010, vec4(Pf0.xy, Pf1.z, Pf0.w)); //LOCATION(130, noise/shaders/classicnoise4D.glsl) float n1010 = dot(g1010, vec4(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); //LOCATION(131, noise/shaders/classicnoise4D.glsl) float n0110 = dot(g0110, vec4(Pf0.x, Pf1.yz, Pf0.w)); //LOCATION(132, noise/shaders/classicnoise4D.glsl) float n1110 = dot(g1110, vec4(Pf1.xyz, Pf0.w)); //LOCATION(133, noise/shaders/classicnoise4D.glsl) float n0001 = dot(g0001, vec4(Pf0.xyz, Pf1.w)); //LOCATION(134, noise/shaders/classicnoise4D.glsl) float n1001 = dot(g1001, vec4(Pf1.x, Pf0.yz, Pf1.w)); //LOCATION(135, noise/shaders/classicnoise4D.glsl) float n0101 = dot(g0101, vec4(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); //LOCATION(136, noise/shaders/classicnoise4D.glsl) float n1101 = dot(g1101, vec4(Pf1.xy, Pf0.z, Pf1.w)); //LOCATION(137, noise/shaders/classicnoise4D.glsl) float n0011 = dot(g0011, vec4(Pf0.xy, Pf1.zw)); //LOCATION(138, noise/shaders/classicnoise4D.glsl) float n1011 = dot(g1011, vec4(Pf1.x, Pf0.y, Pf1.zw)); //LOCATION(139, noise/shaders/classicnoise4D.glsl) float n0111 = dot(g0111, vec4(Pf0.x, Pf1.yzw)); //LOCATION(140, noise/shaders/classicnoise4D.glsl) float n1111 = dot(g1111, Pf1); //LOCATION(141, noise/shaders/classicnoise4D.glsl) //LOCATION(142, noise/shaders/classicnoise4D.glsl) vec4 fade_xyzw = fade(Pf0); //LOCATION(143, noise/shaders/classicnoise4D.glsl) vec4 n_0w = mix(vec4(n0000, n1000, n0100, n1100), vec4(n0001, n1001, n0101, n1101), fade_xyzw.w); //LOCATION(144, noise/shaders/classicnoise4D.glsl) vec4 n_1w = mix(vec4(n0010, n1010, n0110, n1110), vec4(n0011, n1011, n0111, n1111), fade_xyzw.w); //LOCATION(145, noise/shaders/classicnoise4D.glsl) vec4 n_zw = mix(n_0w, n_1w, fade_xyzw.z); //LOCATION(146, noise/shaders/classicnoise4D.glsl) vec2 n_yzw = mix(n_zw.xy, n_zw.zw, fade_xyzw.y); //LOCATION(147, noise/shaders/classicnoise4D.glsl) float n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x); //LOCATION(148, noise/shaders/classicnoise4D.glsl) return 2.2 * n_xyzw; //LOCATION(149, noise/shaders/classicnoise4D.glsl) } //LOCATION(150, noise/shaders/classicnoise4D.glsl) //LOCATION(151, noise/shaders/classicnoise4D.glsl) // Classic Perlin noise, periodic version //LOCATION(152, noise/shaders/classicnoise4D.glsl) float pnoise(vec4 P, vec4 rep) //LOCATION(153, noise/shaders/classicnoise4D.glsl) { //LOCATION(154, noise/shaders/classicnoise4D.glsl) vec4 Pi0 = mod(floor(P), rep); // Integer part modulo rep //LOCATION(155, noise/shaders/classicnoise4D.glsl) vec4 Pi1 = mod(Pi0 + 1.0, rep); // Integer part + 1 mod rep //LOCATION(156, noise/shaders/classicnoise4D.glsl) Pi0 = mod289(Pi0); //LOCATION(157, noise/shaders/classicnoise4D.glsl) Pi1 = mod289(Pi1); //LOCATION(158, noise/shaders/classicnoise4D.glsl) vec4 Pf0 = fract(P); // Fractional part for interpolation //LOCATION(159, noise/shaders/classicnoise4D.glsl) vec4 Pf1 = Pf0 - 1.0; // Fractional part - 1.0 //LOCATION(160, noise/shaders/classicnoise4D.glsl) vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); //LOCATION(161, noise/shaders/classicnoise4D.glsl) vec4 iy = vec4(Pi0.yy, Pi1.yy); //LOCATION(162, noise/shaders/classicnoise4D.glsl) vec4 iz0 = vec4(Pi0.zzzz); //LOCATION(163, noise/shaders/classicnoise4D.glsl) vec4 iz1 = vec4(Pi1.zzzz); //LOCATION(164, noise/shaders/classicnoise4D.glsl) vec4 iw0 = vec4(Pi0.wwww); //LOCATION(165, noise/shaders/classicnoise4D.glsl) vec4 iw1 = vec4(Pi1.wwww); //LOCATION(166, noise/shaders/classicnoise4D.glsl) //LOCATION(167, noise/shaders/classicnoise4D.glsl) vec4 ixy = permute(permute(ix) + iy); //LOCATION(168, noise/shaders/classicnoise4D.glsl) vec4 ixy0 = permute(ixy + iz0); //LOCATION(169, noise/shaders/classicnoise4D.glsl) vec4 ixy1 = permute(ixy + iz1); //LOCATION(170, noise/shaders/classicnoise4D.glsl) vec4 ixy00 = permute(ixy0 + iw0); //LOCATION(171, noise/shaders/classicnoise4D.glsl) vec4 ixy01 = permute(ixy0 + iw1); //LOCATION(172, noise/shaders/classicnoise4D.glsl) vec4 ixy10 = permute(ixy1 + iw0); //LOCATION(173, noise/shaders/classicnoise4D.glsl) vec4 ixy11 = permute(ixy1 + iw1); //LOCATION(174, noise/shaders/classicnoise4D.glsl) //LOCATION(175, noise/shaders/classicnoise4D.glsl) vec4 gx00 = ixy00 * (1.0 / 7.0); //LOCATION(176, noise/shaders/classicnoise4D.glsl) vec4 gy00 = floor(gx00) * (1.0 / 7.0); //LOCATION(177, noise/shaders/classicnoise4D.glsl) vec4 gz00 = floor(gy00) * (1.0 / 6.0); //LOCATION(178, noise/shaders/classicnoise4D.glsl) gx00 = fract(gx00) - 0.5; //LOCATION(179, noise/shaders/classicnoise4D.glsl) gy00 = fract(gy00) - 0.5; //LOCATION(180, noise/shaders/classicnoise4D.glsl) gz00 = fract(gz00) - 0.5; //LOCATION(181, noise/shaders/classicnoise4D.glsl) vec4 gw00 = vec4(0.75) - abs(gx00) - abs(gy00) - abs(gz00); //LOCATION(182, noise/shaders/classicnoise4D.glsl) vec4 sw00 = step(gw00, vec4(0.0)); //LOCATION(183, noise/shaders/classicnoise4D.glsl) gx00 -= sw00 * (step(0.0, gx00) - 0.5); //LOCATION(184, noise/shaders/classicnoise4D.glsl) gy00 -= sw00 * (step(0.0, gy00) - 0.5); //LOCATION(185, noise/shaders/classicnoise4D.glsl) //LOCATION(186, noise/shaders/classicnoise4D.glsl) vec4 gx01 = ixy01 * (1.0 / 7.0); //LOCATION(187, noise/shaders/classicnoise4D.glsl) vec4 gy01 = floor(gx01) * (1.0 / 7.0); //LOCATION(188, noise/shaders/classicnoise4D.glsl) vec4 gz01 = floor(gy01) * (1.0 / 6.0); //LOCATION(189, noise/shaders/classicnoise4D.glsl) gx01 = fract(gx01) - 0.5; //LOCATION(190, noise/shaders/classicnoise4D.glsl) gy01 = fract(gy01) - 0.5; //LOCATION(191, noise/shaders/classicnoise4D.glsl) gz01 = fract(gz01) - 0.5; //LOCATION(192, noise/shaders/classicnoise4D.glsl) vec4 gw01 = vec4(0.75) - abs(gx01) - abs(gy01) - abs(gz01); //LOCATION(193, noise/shaders/classicnoise4D.glsl) vec4 sw01 = step(gw01, vec4(0.0)); //LOCATION(194, noise/shaders/classicnoise4D.glsl) gx01 -= sw01 * (step(0.0, gx01) - 0.5); //LOCATION(195, noise/shaders/classicnoise4D.glsl) gy01 -= sw01 * (step(0.0, gy01) - 0.5); //LOCATION(196, noise/shaders/classicnoise4D.glsl) //LOCATION(197, noise/shaders/classicnoise4D.glsl) vec4 gx10 = ixy10 * (1.0 / 7.0); //LOCATION(198, noise/shaders/classicnoise4D.glsl) vec4 gy10 = floor(gx10) * (1.0 / 7.0); //LOCATION(199, noise/shaders/classicnoise4D.glsl) vec4 gz10 = floor(gy10) * (1.0 / 6.0); //LOCATION(200, noise/shaders/classicnoise4D.glsl) gx10 = fract(gx10) - 0.5; //LOCATION(201, noise/shaders/classicnoise4D.glsl) gy10 = fract(gy10) - 0.5; //LOCATION(202, noise/shaders/classicnoise4D.glsl) gz10 = fract(gz10) - 0.5; //LOCATION(203, noise/shaders/classicnoise4D.glsl) vec4 gw10 = vec4(0.75) - abs(gx10) - abs(gy10) - abs(gz10); //LOCATION(204, noise/shaders/classicnoise4D.glsl) vec4 sw10 = step(gw10, vec4(0.0)); //LOCATION(205, noise/shaders/classicnoise4D.glsl) gx10 -= sw10 * (step(0.0, gx10) - 0.5); //LOCATION(206, noise/shaders/classicnoise4D.glsl) gy10 -= sw10 * (step(0.0, gy10) - 0.5); //LOCATION(207, noise/shaders/classicnoise4D.glsl) //LOCATION(208, noise/shaders/classicnoise4D.glsl) vec4 gx11 = ixy11 * (1.0 / 7.0); //LOCATION(209, noise/shaders/classicnoise4D.glsl) vec4 gy11 = floor(gx11) * (1.0 / 7.0); //LOCATION(210, noise/shaders/classicnoise4D.glsl) vec4 gz11 = floor(gy11) * (1.0 / 6.0); //LOCATION(211, noise/shaders/classicnoise4D.glsl) gx11 = fract(gx11) - 0.5; //LOCATION(212, noise/shaders/classicnoise4D.glsl) gy11 = fract(gy11) - 0.5; //LOCATION(213, noise/shaders/classicnoise4D.glsl) gz11 = fract(gz11) - 0.5; //LOCATION(214, noise/shaders/classicnoise4D.glsl) vec4 gw11 = vec4(0.75) - abs(gx11) - abs(gy11) - abs(gz11); //LOCATION(215, noise/shaders/classicnoise4D.glsl) vec4 sw11 = step(gw11, vec4(0.0)); //LOCATION(216, noise/shaders/classicnoise4D.glsl) gx11 -= sw11 * (step(0.0, gx11) - 0.5); //LOCATION(217, noise/shaders/classicnoise4D.glsl) gy11 -= sw11 * (step(0.0, gy11) - 0.5); //LOCATION(218, noise/shaders/classicnoise4D.glsl) //LOCATION(219, noise/shaders/classicnoise4D.glsl) vec4 g0000 = vec4(gx00.x,gy00.x,gz00.x,gw00.x); //LOCATION(220, noise/shaders/classicnoise4D.glsl) vec4 g1000 = vec4(gx00.y,gy00.y,gz00.y,gw00.y); //LOCATION(221, noise/shaders/classicnoise4D.glsl) vec4 g0100 = vec4(gx00.z,gy00.z,gz00.z,gw00.z); //LOCATION(222, noise/shaders/classicnoise4D.glsl) vec4 g1100 = vec4(gx00.w,gy00.w,gz00.w,gw00.w); //LOCATION(223, noise/shaders/classicnoise4D.glsl) vec4 g0010 = vec4(gx10.x,gy10.x,gz10.x,gw10.x); //LOCATION(224, noise/shaders/classicnoise4D.glsl) vec4 g1010 = vec4(gx10.y,gy10.y,gz10.y,gw10.y); //LOCATION(225, noise/shaders/classicnoise4D.glsl) vec4 g0110 = vec4(gx10.z,gy10.z,gz10.z,gw10.z); //LOCATION(226, noise/shaders/classicnoise4D.glsl) vec4 g1110 = vec4(gx10.w,gy10.w,gz10.w,gw10.w); //LOCATION(227, noise/shaders/classicnoise4D.glsl) vec4 g0001 = vec4(gx01.x,gy01.x,gz01.x,gw01.x); //LOCATION(228, noise/shaders/classicnoise4D.glsl) vec4 g1001 = vec4(gx01.y,gy01.y,gz01.y,gw01.y); //LOCATION(229, noise/shaders/classicnoise4D.glsl) vec4 g0101 = vec4(gx01.z,gy01.z,gz01.z,gw01.z); //LOCATION(230, noise/shaders/classicnoise4D.glsl) vec4 g1101 = vec4(gx01.w,gy01.w,gz01.w,gw01.w); //LOCATION(231, noise/shaders/classicnoise4D.glsl) vec4 g0011 = vec4(gx11.x,gy11.x,gz11.x,gw11.x); //LOCATION(232, noise/shaders/classicnoise4D.glsl) vec4 g1011 = vec4(gx11.y,gy11.y,gz11.y,gw11.y); //LOCATION(233, noise/shaders/classicnoise4D.glsl) vec4 g0111 = vec4(gx11.z,gy11.z,gz11.z,gw11.z); //LOCATION(234, noise/shaders/classicnoise4D.glsl) vec4 g1111 = vec4(gx11.w,gy11.w,gz11.w,gw11.w); //LOCATION(235, noise/shaders/classicnoise4D.glsl) //LOCATION(236, noise/shaders/classicnoise4D.glsl) vec4 norm00 = taylorInvSqrt(vec4(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); //LOCATION(237, noise/shaders/classicnoise4D.glsl) g0000 *= norm00.x; //LOCATION(238, noise/shaders/classicnoise4D.glsl) g0100 *= norm00.y; //LOCATION(239, noise/shaders/classicnoise4D.glsl) g1000 *= norm00.z; //LOCATION(240, noise/shaders/classicnoise4D.glsl) g1100 *= norm00.w; //LOCATION(241, noise/shaders/classicnoise4D.glsl) //LOCATION(242, noise/shaders/classicnoise4D.glsl) vec4 norm01 = taylorInvSqrt(vec4(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); //LOCATION(243, noise/shaders/classicnoise4D.glsl) g0001 *= norm01.x; //LOCATION(244, noise/shaders/classicnoise4D.glsl) g0101 *= norm01.y; //LOCATION(245, noise/shaders/classicnoise4D.glsl) g1001 *= norm01.z; //LOCATION(246, noise/shaders/classicnoise4D.glsl) g1101 *= norm01.w; //LOCATION(247, noise/shaders/classicnoise4D.glsl) //LOCATION(248, noise/shaders/classicnoise4D.glsl) vec4 norm10 = taylorInvSqrt(vec4(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); //LOCATION(249, noise/shaders/classicnoise4D.glsl) g0010 *= norm10.x; //LOCATION(250, noise/shaders/classicnoise4D.glsl) g0110 *= norm10.y; //LOCATION(251, noise/shaders/classicnoise4D.glsl) g1010 *= norm10.z; //LOCATION(252, noise/shaders/classicnoise4D.glsl) g1110 *= norm10.w; //LOCATION(253, noise/shaders/classicnoise4D.glsl) //LOCATION(254, noise/shaders/classicnoise4D.glsl) vec4 norm11 = taylorInvSqrt(vec4(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); //LOCATION(255, noise/shaders/classicnoise4D.glsl) g0011 *= norm11.x; //LOCATION(256, noise/shaders/classicnoise4D.glsl) g0111 *= norm11.y; //LOCATION(257, noise/shaders/classicnoise4D.glsl) g1011 *= norm11.z; //LOCATION(258, noise/shaders/classicnoise4D.glsl) g1111 *= norm11.w; //LOCATION(259, noise/shaders/classicnoise4D.glsl) //LOCATION(260, noise/shaders/classicnoise4D.glsl) float n0000 = dot(g0000, Pf0); //LOCATION(261, noise/shaders/classicnoise4D.glsl) float n1000 = dot(g1000, vec4(Pf1.x, Pf0.yzw)); //LOCATION(262, noise/shaders/classicnoise4D.glsl) float n0100 = dot(g0100, vec4(Pf0.x, Pf1.y, Pf0.zw)); //LOCATION(263, noise/shaders/classicnoise4D.glsl) float n1100 = dot(g1100, vec4(Pf1.xy, Pf0.zw)); //LOCATION(264, noise/shaders/classicnoise4D.glsl) float n0010 = dot(g0010, vec4(Pf0.xy, Pf1.z, Pf0.w)); //LOCATION(265, noise/shaders/classicnoise4D.glsl) float n1010 = dot(g1010, vec4(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); //LOCATION(266, noise/shaders/classicnoise4D.glsl) float n0110 = dot(g0110, vec4(Pf0.x, Pf1.yz, Pf0.w)); //LOCATION(267, noise/shaders/classicnoise4D.glsl) float n1110 = dot(g1110, vec4(Pf1.xyz, Pf0.w)); //LOCATION(268, noise/shaders/classicnoise4D.glsl) float n0001 = dot(g0001, vec4(Pf0.xyz, Pf1.w)); //LOCATION(269, noise/shaders/classicnoise4D.glsl) float n1001 = dot(g1001, vec4(Pf1.x, Pf0.yz, Pf1.w)); //LOCATION(270, noise/shaders/classicnoise4D.glsl) float n0101 = dot(g0101, vec4(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); //LOCATION(271, noise/shaders/classicnoise4D.glsl) float n1101 = dot(g1101, vec4(Pf1.xy, Pf0.z, Pf1.w)); //LOCATION(272, noise/shaders/classicnoise4D.glsl) float n0011 = dot(g0011, vec4(Pf0.xy, Pf1.zw)); //LOCATION(273, noise/shaders/classicnoise4D.glsl) float n1011 = dot(g1011, vec4(Pf1.x, Pf0.y, Pf1.zw)); //LOCATION(274, noise/shaders/classicnoise4D.glsl) float n0111 = dot(g0111, vec4(Pf0.x, Pf1.yzw)); //LOCATION(275, noise/shaders/classicnoise4D.glsl) float n1111 = dot(g1111, Pf1); //LOCATION(276, noise/shaders/classicnoise4D.glsl) //LOCATION(277, noise/shaders/classicnoise4D.glsl) vec4 fade_xyzw = fade(Pf0); //LOCATION(278, noise/shaders/classicnoise4D.glsl) vec4 n_0w = mix(vec4(n0000, n1000, n0100, n1100), vec4(n0001, n1001, n0101, n1101), fade_xyzw.w); //LOCATION(279, noise/shaders/classicnoise4D.glsl) vec4 n_1w = mix(vec4(n0010, n1010, n0110, n1110), vec4(n0011, n1011, n0111, n1111), fade_xyzw.w); //LOCATION(280, noise/shaders/classicnoise4D.glsl) vec4 n_zw = mix(n_0w, n_1w, fade_xyzw.z); //LOCATION(281, noise/shaders/classicnoise4D.glsl) vec2 n_yzw = mix(n_zw.xy, n_zw.zw, fade_xyzw.y); //LOCATION(282, noise/shaders/classicnoise4D.glsl) float n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x); //LOCATION(283, noise/shaders/classicnoise4D.glsl) return 2.2 * n_xyzw; //LOCATION(284, noise/shaders/classicnoise4D.glsl) } //LOCATION(285, noise/shaders/classicnoise4D.glsl) // //LOCATION( 1, noise/shaders/noise4D.glsl) // Description : Array and textureless GLSL 2D/3D/4D simplex //LOCATION( 2, noise/shaders/noise4D.glsl) // noise functions. //LOCATION( 3, noise/shaders/noise4D.glsl) // Author : Ian McEwan, Ashima Arts. //LOCATION( 4, noise/shaders/noise4D.glsl) // Maintainer : ijm //LOCATION( 5, noise/shaders/noise4D.glsl) // Lastmod : 20110822 (ijm) //LOCATION( 6, noise/shaders/noise4D.glsl) // License : Copyright (C) 2011 Ashima Arts. All rights reserved. //LOCATION( 7, noise/shaders/noise4D.glsl) // Distributed under the MIT License. See LICENSE file. //LOCATION( 8, noise/shaders/noise4D.glsl) // https://github.com/ashima/webgl-noise //LOCATION( 9, noise/shaders/noise4D.glsl) // //LOCATION( 10, noise/shaders/noise4D.glsl) //LOCATION( 11, noise/shaders/noise4D.glsl) //LOCATION( 12, noise/shaders/noise4D.glsl) //LOCATION( 13, noise/shaders/noise4D.glsl) vec4 grad4(float j, vec4 ip) //LOCATION( 14, noise/shaders/noise4D.glsl) { //LOCATION( 15, noise/shaders/noise4D.glsl) const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0); //LOCATION( 16, noise/shaders/noise4D.glsl) vec4 p,s; //LOCATION( 17, noise/shaders/noise4D.glsl) //LOCATION( 18, noise/shaders/noise4D.glsl) p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0; //LOCATION( 19, noise/shaders/noise4D.glsl) p.w = 1.5 - dot(abs(p.xyz), ones.xyz); //LOCATION( 20, noise/shaders/noise4D.glsl) s = vec4(lessThan(p, vec4(0.0))); //LOCATION( 21, noise/shaders/noise4D.glsl) p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www; //LOCATION( 22, noise/shaders/noise4D.glsl) //LOCATION( 23, noise/shaders/noise4D.glsl) return p; //LOCATION( 24, noise/shaders/noise4D.glsl) } //LOCATION( 25, noise/shaders/noise4D.glsl) //LOCATION( 26, noise/shaders/noise4D.glsl) // (sqrt(5) - 1)/4 = F4, used once below //LOCATION( 27, noise/shaders/noise4D.glsl) #define F4 0.309016994374947451 //LOCATION( 28, noise/shaders/noise4D.glsl) //LOCATION( 29, noise/shaders/noise4D.glsl) float snoise(vec4 v) //LOCATION( 30, noise/shaders/noise4D.glsl) { //LOCATION( 31, noise/shaders/noise4D.glsl) const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4 //LOCATION( 32, noise/shaders/noise4D.glsl) 0.276393202250021, // 2 * G4 //LOCATION( 33, noise/shaders/noise4D.glsl) 0.414589803375032, // 3 * G4 //LOCATION( 34, noise/shaders/noise4D.glsl) -0.447213595499958); // -1 + 4 * G4 //LOCATION( 35, noise/shaders/noise4D.glsl) //LOCATION( 36, noise/shaders/noise4D.glsl) // First corner //LOCATION( 37, noise/shaders/noise4D.glsl) vec4 i = floor(v + dot(v, vec4(F4)) ); //LOCATION( 38, noise/shaders/noise4D.glsl) vec4 x0 = v - i + dot(i, C.xxxx); //LOCATION( 39, noise/shaders/noise4D.glsl) //LOCATION( 40, noise/shaders/noise4D.glsl) // Other corners //LOCATION( 41, noise/shaders/noise4D.glsl) //LOCATION( 42, noise/shaders/noise4D.glsl) // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI) //LOCATION( 43, noise/shaders/noise4D.glsl) vec4 i0; //LOCATION( 44, noise/shaders/noise4D.glsl) vec3 isX = step( x0.yzw, x0.xxx ); //LOCATION( 45, noise/shaders/noise4D.glsl) vec3 isYZ = step( x0.zww, x0.yyz ); //LOCATION( 46, noise/shaders/noise4D.glsl) // i0.x = dot( isX, vec3( 1.0 ) ); //LOCATION( 47, noise/shaders/noise4D.glsl) i0.x = isX.x + isX.y + isX.z; //LOCATION( 48, noise/shaders/noise4D.glsl) i0.yzw = 1.0 - isX; //LOCATION( 49, noise/shaders/noise4D.glsl) // i0.y += dot( isYZ.xy, vec2( 1.0 ) ); //LOCATION( 50, noise/shaders/noise4D.glsl) i0.y += isYZ.x + isYZ.y; //LOCATION( 51, noise/shaders/noise4D.glsl) i0.zw += 1.0 - isYZ.xy; //LOCATION( 52, noise/shaders/noise4D.glsl) i0.z += isYZ.z; //LOCATION( 53, noise/shaders/noise4D.glsl) i0.w += 1.0 - isYZ.z; //LOCATION( 54, noise/shaders/noise4D.glsl) //LOCATION( 55, noise/shaders/noise4D.glsl) // i0 now contains the unique values 0,1,2,3 in each channel //LOCATION( 56, noise/shaders/noise4D.glsl) vec4 i3 = clamp( i0, 0.0, 1.0 ); //LOCATION( 57, noise/shaders/noise4D.glsl) vec4 i2 = clamp( i0-1.0, 0.0, 1.0 ); //LOCATION( 58, noise/shaders/noise4D.glsl) vec4 i1 = clamp( i0-2.0, 0.0, 1.0 ); //LOCATION( 59, noise/shaders/noise4D.glsl) //LOCATION( 60, noise/shaders/noise4D.glsl) // x0 = x0 - 0.0 + 0.0 * C.xxxx //LOCATION( 61, noise/shaders/noise4D.glsl) // x1 = x0 - i1 + 1.0 * C.xxxx //LOCATION( 62, noise/shaders/noise4D.glsl) // x2 = x0 - i2 + 2.0 * C.xxxx //LOCATION( 63, noise/shaders/noise4D.glsl) // x3 = x0 - i3 + 3.0 * C.xxxx //LOCATION( 64, noise/shaders/noise4D.glsl) // x4 = x0 - 1.0 + 4.0 * C.xxxx //LOCATION( 65, noise/shaders/noise4D.glsl) vec4 x1 = x0 - i1 + C.xxxx; //LOCATION( 66, noise/shaders/noise4D.glsl) vec4 x2 = x0 - i2 + C.yyyy; //LOCATION( 67, noise/shaders/noise4D.glsl) vec4 x3 = x0 - i3 + C.zzzz; //LOCATION( 68, noise/shaders/noise4D.glsl) vec4 x4 = x0 + C.wwww; //LOCATION( 69, noise/shaders/noise4D.glsl) //LOCATION( 70, noise/shaders/noise4D.glsl) // Permutations //LOCATION( 71, noise/shaders/noise4D.glsl) i = mod289(i); //LOCATION( 72, noise/shaders/noise4D.glsl) float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x); //LOCATION( 73, noise/shaders/noise4D.glsl) vec4 j1 = permute( permute( permute( permute ( //LOCATION( 74, noise/shaders/noise4D.glsl) i.w + vec4(i1.w, i2.w, i3.w, 1.0 )) //LOCATION( 75, noise/shaders/noise4D.glsl) + i.z + vec4(i1.z, i2.z, i3.z, 1.0 )) //LOCATION( 76, noise/shaders/noise4D.glsl) + i.y + vec4(i1.y, i2.y, i3.y, 1.0 )) //LOCATION( 77, noise/shaders/noise4D.glsl) + i.x + vec4(i1.x, i2.x, i3.x, 1.0 )); //LOCATION( 78, noise/shaders/noise4D.glsl) //LOCATION( 79, noise/shaders/noise4D.glsl) // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope //LOCATION( 80, noise/shaders/noise4D.glsl) // 7*7*6 = 294, which is close to the ring size 17*17 = 289. //LOCATION( 81, noise/shaders/noise4D.glsl) vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ; //LOCATION( 82, noise/shaders/noise4D.glsl) //LOCATION( 83, noise/shaders/noise4D.glsl) vec4 p0 = grad4(j0, ip); //LOCATION( 84, noise/shaders/noise4D.glsl) vec4 p1 = grad4(j1.x, ip); //LOCATION( 85, noise/shaders/noise4D.glsl) vec4 p2 = grad4(j1.y, ip); //LOCATION( 86, noise/shaders/noise4D.glsl) vec4 p3 = grad4(j1.z, ip); //LOCATION( 87, noise/shaders/noise4D.glsl) vec4 p4 = grad4(j1.w, ip); //LOCATION( 88, noise/shaders/noise4D.glsl) //LOCATION( 89, noise/shaders/noise4D.glsl) // Normalise gradients //LOCATION( 90, noise/shaders/noise4D.glsl) vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); //LOCATION( 91, noise/shaders/noise4D.glsl) p0 *= norm.x; //LOCATION( 92, noise/shaders/noise4D.glsl) p1 *= norm.y; //LOCATION( 93, noise/shaders/noise4D.glsl) p2 *= norm.z; //LOCATION( 94, noise/shaders/noise4D.glsl) p3 *= norm.w; //LOCATION( 95, noise/shaders/noise4D.glsl) p4 *= taylorInvSqrt(dot(p4,p4)); //LOCATION( 96, noise/shaders/noise4D.glsl) //LOCATION( 97, noise/shaders/noise4D.glsl) // Mix contributions from the five corners //LOCATION( 98, noise/shaders/noise4D.glsl) vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0); //LOCATION( 99, noise/shaders/noise4D.glsl) vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0); //LOCATION(100, noise/shaders/noise4D.glsl) m0 = m0 * m0; //LOCATION(101, noise/shaders/noise4D.glsl) m1 = m1 * m1; //LOCATION(102, noise/shaders/noise4D.glsl) return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 ))) //LOCATION(103, noise/shaders/noise4D.glsl) + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ; //LOCATION(104, noise/shaders/noise4D.glsl) //LOCATION(105, noise/shaders/noise4D.glsl) } //LOCATION(106, noise/shaders/noise4D.glsl) //LOCATION( 1, raw string) float NOISE_FUNC(vec2 x); //LOCATION( 2, raw string) //LOCATION( 1, noise/shaders/frag.glsl) varying vec2 w; //LOCATION( 2, noise/shaders/frag.glsl) //LOCATION( 3, noise/shaders/frag.glsl) //LOCATION( 4, noise/shaders/frag.glsl) //LOCATION( 5, noise/shaders/frag.glsl) uniform float time_s; //LOCATION( 6, noise/shaders/frag.glsl) uniform float time_ms; //LOCATION( 7, noise/shaders/frag.glsl) //LOCATION( 8, noise/shaders/frag.glsl) float time_dependent(void) //LOCATION( 9, noise/shaders/frag.glsl) { //LOCATION( 10, noise/shaders/frag.glsl) return time_s*2.0 + time_ms/500.0; //LOCATION( 11, noise/shaders/frag.glsl) } //LOCATION( 12, noise/shaders/frag.glsl) //LOCATION( 13, noise/shaders/frag.glsl) float noise_value(vec2 q) //LOCATION( 14, noise/shaders/frag.glsl) { //LOCATION( 15, noise/shaders/frag.glsl) float R; //LOCATION( 16, noise/shaders/frag.glsl) R=NOISE_FUNC(q); //LOCATION( 17, noise/shaders/frag.glsl) return 0.5*(R+1.0); //LOCATION( 18, noise/shaders/frag.glsl) } //LOCATION( 19, noise/shaders/frag.glsl) //LOCATION( 20, noise/shaders/frag.glsl) void main(void) //LOCATION( 21, noise/shaders/frag.glsl) { //LOCATION( 22, noise/shaders/frag.glsl) float r, g, b; //LOCATION( 23, noise/shaders/frag.glsl) vec2 xy; //LOCATION( 24, noise/shaders/frag.glsl) float omega; //LOCATION( 25, noise/shaders/frag.glsl) //LOCATION( 26, noise/shaders/frag.glsl) omega= (time_s + time_ms/1000.0)*2.0*3.14159/5.0; //LOCATION( 27, noise/shaders/frag.glsl) xy=float(CircleRadius)*vec2(cos(omega), sin(omega)); //LOCATION( 28, noise/shaders/frag.glsl) //LOCATION( 29, noise/shaders/frag.glsl) //LOCATION( 30, noise/shaders/frag.glsl) r=noise_value(w+xy); //LOCATION( 31, noise/shaders/frag.glsl) #ifdef GREY_SCALE_NOISE //LOCATION( 32, noise/shaders/frag.glsl) { //LOCATION( 33, noise/shaders/frag.glsl) g=r; //LOCATION( 34, noise/shaders/frag.glsl) b=r; //LOCATION( 35, noise/shaders/frag.glsl) } //LOCATION( 36, noise/shaders/frag.glsl) #else //LOCATION( 37, noise/shaders/frag.glsl) { //LOCATION( 38, noise/shaders/frag.glsl) g=noise_value(w+xy+vec2(12.0, 3.0)); //LOCATION( 39, noise/shaders/frag.glsl) b=noise_value(w+xy+vec2(3.0, 56.0)); //LOCATION( 40, noise/shaders/frag.glsl) } //LOCATION( 41, noise/shaders/frag.glsl) #endif //LOCATION( 42, noise/shaders/frag.glsl) //LOCATION( 43, noise/shaders/frag.glsl) gl_FragColor=vec4(r,g,b,1.0); //LOCATION( 44, noise/shaders/frag.glsl) } //LOCATION( 45, noise/shaders/frag.glsl) //LOCATION( 1, raw string) float NOISE_FUNC(vec2 x) { return pnoise(vec4(x, time_dependent(), time_dependent()/2.0) ); } //LOCATION( 2, raw string)