module.exports = '// #version 120 // should be placed at very start of shader\n\n// Cellular noise ("Worley noise") in 3D in GLSL.\n// Copyright (c) Stefan Gustavson 2011-04-19. All rights reserved.\n// This code is released under the conditions of the MIT license.\n// See LICENSE file for details.\n// https://github.com/stegu/webgl-noise\n\n// Modulo 289 without a division (only multiplications)\nvec3 mod289(vec3 x) {\n  return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n  return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\n// Modulo 7 without a division\nvec4 mod7(vec4 x) {\n  return x - floor(x * (1.0 / 7.0)) * 7.0;\n}\n\n\n// Permutation polynomial: (34x^2 + x) mod 289\nvec3 permute(vec3 x) {\n  return mod289((34.0 * x + 1.0) * x);\n}\n\nvec4 permute(vec4 x) {\n  return mod289((34.0 * x + 1.0) * x);\n}\n\n// Cellular noise, returning F1 and F2 in a vec2.\n// Speeded up by using 2x2x2 search window instead of 3x3x3,\n// at the expense of some pattern artifacts.\n// F2 is often wrong and has sharp discontinuities.\n// If you need a good F2, use the slower 3x3x3 version.\nvec2 cellular2x2x2(vec3 P) {\n#define K 0.142857142857 // 1/7\n#define Ko 0.428571428571 // 1/2-K/2\n#define K2 0.020408163265306 // 1/(7*7)\n#define Kz 0.166666666667 // 1/6\n#define Kzo 0.416666666667 // 1/2-1/6*2\n#define jitter 0.8 // smaller jitter gives less errors in F2\n	vec3 Pi = mod289(floor(P));\n 	vec3 Pf = fract(P);\n	vec4 Pfx = Pf.x + vec4(0.0, -1.0, 0.0, -1.0);\n	vec4 Pfy = Pf.y + vec4(0.0, 0.0, -1.0, -1.0);\n	vec4 p = permute(Pi.x + vec4(0.0, 1.0, 0.0, 1.0));\n	p = permute(p + Pi.y + vec4(0.0, 0.0, 1.0, 1.0));\n	vec4 p1 = permute(p + Pi.z); // z+0\n	vec4 p2 = permute(p + Pi.z + vec4(1.0)); // z+1\n	vec4 ox1 = fract(p1*K) - Ko;\n	vec4 oy1 = mod7(floor(p1*K))*K - Ko;\n	vec4 oz1 = floor(p1*K2)*Kz - Kzo; // p1 < 289 guaranteed\n	vec4 ox2 = fract(p2*K) - Ko;\n	vec4 oy2 = mod7(floor(p2*K))*K - Ko;\n	vec4 oz2 = floor(p2*K2)*Kz - Kzo;\n	vec4 dx1 = Pfx + jitter*ox1;\n	vec4 dy1 = Pfy + jitter*oy1;\n	vec4 dz1 = Pf.z + jitter*oz1;\n	vec4 dx2 = Pfx + jitter*ox2;\n	vec4 dy2 = Pfy + jitter*oy2;\n	vec4 dz2 = Pf.z - 1.0 + jitter*oz2;\n	vec4 d1 = dx1 * dx1 + dy1 * dy1 + dz1 * dz1; // z+0\n	vec4 d2 = dx2 * dx2 + dy2 * dy2 + dz2 * dz2; // z+1\n\n	// Sort out the two smallest distances (F1, F2)\n#if 0\n	// Cheat and sort out only F1\n	d1 = min(d1, d2);\n	d1.xy = min(d1.xy, d1.wz);\n	d1.x = min(d1.x, d1.y);\n	return vec2(sqrt(d1.x));\n#else\n	// Do it right and sort out both F1 and F2\n	vec4 d = min(d1,d2); // F1 is now in d\n	d2 = max(d1,d2); // Make sure we keep all candidates for F2\n	d.xy = (d.x < d.y) ? d.xy : d.yx; // Swap smallest to d.x\n	d.xz = (d.x < d.z) ? d.xz : d.zx;\n	d.xw = (d.x < d.w) ? d.xw : d.wx; // F1 is now in d.x\n	d.yzw = min(d.yzw, d2.yzw); // F2 now not in d2.yzw\n	d.y = min(d.y, d.z); // nor in d.z\n	d.y = min(d.y, d.w); // nor in d.w\n	d.y = min(d.y, d2.x); // F2 is now in d.y\n	return sqrt(d.xy); // F1 and F2\n#endif\n}\n';
