Comparing version 0.0.10 to 0.0.11
import easing from './easing.glsl' | ||
import easingModules from './easing' | ||
import easingModules from './easing/index.js' | ||
export default { easing: Object.assign(easing, easingModules) } |
import blend from './blend.glsl' | ||
import blendModules from './blend' | ||
import blendModules from './blend/index.js' | ||
import contrastMatrix from './contrastMatrix.glsl' | ||
@@ -15,4 +15,4 @@ import hueShift from './hueShift.glsl' | ||
import space from './space.glsl' | ||
import spaceModules from './space' | ||
import paletteModules from './palette' | ||
import spaceModules from './space/index.js' | ||
import paletteModules from './palette/index.js' | ||
@@ -19,0 +19,0 @@ export default { |
@@ -1,1 +0,85 @@ | ||
var n={4912:n=>{n.exports='/*\ndescription: Include all available easing animations\n*/\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Back easing. From https://github.com/stackgl/glsl-easings\nuse: back<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BACKIN\n#define FNC_BACKIN\nfloat backIn(in float t) {\n return pow(t, 3.) - t * sin(t * PI);\n}\n#endif\n\n#ifndef FNC_BACKOUT\n#define FNC_BACKOUT\nfloat backOut(in float t) {\n return 1. - backIn(1. - t);\n}\n#endif\n\n#ifndef FNC_BACKINOUT\n#define FNC_BACKINOUT\nfloat backInOut(in float t) {\n float f = t < .5\n ? 2.0 * t\n : 1.0 - (2.0 * t - 1.0);\n\n float g = backIn(f);\n\n return t < 0.5\n ? 0.5 * g\n : 0.5 * (1.0 - g) + 0.5;\n}\n#endif\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: bounce easing. From https://github.com/stackgl/glsl-easings\nuse: bounce<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BOUNCEOUT\n#define FNC_BOUNCEOUT\nfloat bounceOut(in float t) {\n const float a = 4.0 / 11.0;\n const float b = 8.0 / 11.0;\n const float c = 9.0 / 10.0;\n\n const float ca = 4356.0 / 361.0;\n const float cb = 35442.0 / 1805.0;\n const float cc = 16061.0 / 1805.0;\n\n float t2 = t * t;\n\n return t < a\n ? 7.5625 * t2\n : t < b\n ? 9.075 * t2 - 9.9 * t + 3.4\n : t < c\n ? ca * t2 - cb * t + cc\n : 10.8 * t * t - 20.52 * t + 10.72;\n}\n#endif\n\n#ifndef FNC_BOUNCEIN\n#define FNC_BOUNCEIN\nfloat bounceIn(in float t) {\n return 1.0 - bounceOut(1.0 - t);\n}\n#endif\n\n#ifndef FNC_BOUNCEINOUT\n#define FNC_BOUNCEINOUT\nfloat bounceInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0))\n : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: circular easing. From https://github.com/stackgl/glsl-easings\nuse: circular<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CIRCULARIN\n#define FNC_CIRCULARIN\nfloat circularIn(in float t) {\n return 1.0 - sqrt(1.0 - t * t);\n}\n#endif\n\n#ifndef FNC_CIRCULAROUT\n#define FNC_CIRCULAROUT\nfloat circularOut(in float t) {\n return sqrt((2.0 - t) * t);\n}\n#endif\n\n#ifndef FNC_CIRCULARINOUT\n#define FNC_CIRCULARINOUT\nfloat circularInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - sqrt(1.0 - 4.0 * t * t))\n : 0.5 * (sqrt((3.0 - 2.0 * t) * (2.0 * t - 1.0)) + 1.0);\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: cubic easing. From https://github.com/stackgl/glsl-easings\nuse: cubic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CUBICIN\n#define FNC_CUBICIN\nfloat cubicIn(in float t) {\n return t * t * t;\n}\n#endif\n\n#ifndef FNC_CUBICOUT\n#define FNC_CUBICOUT\nfloat cubicOut(in float t) {\n float f = t - 1.0;\n return f * f * f + 1.0;\n}\n#endif\n\n#ifndef FNC_CUBICINOUT\n#define FNC_CUBICINOUT\nfloat cubicInOut(in float t) {\n return t < 0.5\n ? 4.0 * t * t * t\n : 0.5 * pow(2.0 * t - 2.0, 3.0) + 1.0;\n}\n#endif\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: elastic easing. From https://github.com/stackgl/glsl-easings\nuse: elastic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_ELASTICIN\n#define FNC_ELASTICIN\nfloat elasticIn(in float t) {\n return sin(13.0 * t * HALF_PI) * pow(2.0, 10.0 * (t - 1.0));\n}\n#endif \n\n#ifndef FNC_ELASTICOUT\n#define FNC_ELASTICOUT\nfloat elasticOut(in float t) {\n return sin(-13.0 * (t + 1.0) * HALF_PI) * pow(2.0, -10.0 * t) + 1.0;\n}\n#endif\n\n#ifndef FNC_ELASTICINOUT\n#define FNC_ELASTICINOUT\nfloat elasticInOut(in float t) {\n return t < 0.5\n ? 0.5 * sin(+13.0 * HALF_PI * 2.0 * t) * pow(2.0, 10.0 * (2.0 * t - 1.0))\n : 0.5 * sin(-13.0 * HALF_PI * ((2.0 * t - 1.0) + 1.0)) * pow(2.0, -10.0 * (2.0 * t - 1.0)) + 1.0;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: exponential easing. From https://github.com/stackgl/glsl-easings\nuse: exponential<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_EXPONENTIALIN\n#define FNC_EXPONENTIALIN\nfloat exponentialIn(in float t) {\n return t == 0.0 ? t : pow(2.0, 10.0 * (t - 1.0));\n}\n#endif\n\n#ifndef FNC_EXPONENTIALOUT\n#define FNC_EXPONENTIALOUT\nfloat exponentialOut(in float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n#endif\n\n#ifndef FNC_EXPONENTIALINOUT\n#define FNC_EXPONENTIALINOUT\nfloat exponentialInOut(in float t) {\n return t == 0.0 || t == 1.0\n ? t\n : t < 0.5\n ? +0.5 * pow(2.0, (20.0 * t) - 10.0)\n : -0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0;\n}\n#endif\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Linear easing. From https://github.com/stackgl/glsl-easings\nuse: linear(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_LINEAR\n#define FNC_LINEAR\nfloat linear(in float t) {\n return t;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quadrtic easing. From https://github.com/stackgl/glsl-easings\nuse: quadratic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUADRATICIN\n#define FNC_QUADRATICIN\nfloat quadraticIn(in float t) {\n return t * t;\n}\n#endif\n\n#ifndef FNC_QUADRATICOUT\n#define FNC_QUADRATICOUT\nfloat quadraticOut(in float t) {\n return -t * (t - 2.0);\n}\n#endif\n\n#ifndef FNC_QUADRATICINOUT\n#define FNC_QUADRATICINOUT\nfloat quadraticInOut(in float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quintic easing. From https://github.com/stackgl/glsl-easings\nuse: quintic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUINTICIN\n#define FNC_QUINTICIN\nfloat quinticIn(in float t) {\n return pow(t, 5.0);\n}\n#endif\n\n#ifndef FNC_QUINTICOUT\n#define FNC_QUINTICOUT\nfloat quinticOut(in float t) {\n return 1.0 - (pow(t - 1.0, 5.0));\n}\n#endif\n\n#ifndef FNC_QUINTICINOUT\n#define FNC_QUINTICINOUT\nfloat quinticInOut(in float t) {\n return t < 0.5\n ? +16.0 * pow(t, 5.0)\n : -0.5 * pow(2.0 * t - 2.0, 5.0) + 1.0;\n}\n#endif\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: sine easing. From https://github.com/stackgl/glsl-easings\nuse: sine<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QINTICIN\n#define FNC_QINTICIN\nfloat sineIn(in float t) {\n return sin((t - 1.0) * HALF_PI) + 1.0;\n}\n#endif\n\n#ifndef FNC_QINTICOUT\n#define FNC_QINTICOUT\nfloat sineOut(in float t) {\n return sin(t * HALF_PI);\n}\n#endif\n\n#ifndef FNC_QINTICINOUT\n#define FNC_QINTICINOUT\nfloat sineInOut(in float t) {\n return -0.5 * (cos(PI * t) - 1.0);\n}\n#endif\n'},1198:n=>{n.exports='#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Back easing. From https://github.com/stackgl/glsl-easings\nuse: back<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BACKIN\n#define FNC_BACKIN\nfloat backIn(in float t) {\n return pow(t, 3.) - t * sin(t * PI);\n}\n#endif\n\n#ifndef FNC_BACKOUT\n#define FNC_BACKOUT\nfloat backOut(in float t) {\n return 1. - backIn(1. - t);\n}\n#endif\n\n#ifndef FNC_BACKINOUT\n#define FNC_BACKINOUT\nfloat backInOut(in float t) {\n float f = t < .5\n ? 2.0 * t\n : 1.0 - (2.0 * t - 1.0);\n\n float g = backIn(f);\n\n return t < 0.5\n ? 0.5 * g\n : 0.5 * (1.0 - g) + 0.5;\n}\n#endif\n'},6788:n=>{n.exports='#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: bounce easing. From https://github.com/stackgl/glsl-easings\nuse: bounce<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BOUNCEOUT\n#define FNC_BOUNCEOUT\nfloat bounceOut(in float t) {\n const float a = 4.0 / 11.0;\n const float b = 8.0 / 11.0;\n const float c = 9.0 / 10.0;\n\n const float ca = 4356.0 / 361.0;\n const float cb = 35442.0 / 1805.0;\n const float cc = 16061.0 / 1805.0;\n\n float t2 = t * t;\n\n return t < a\n ? 7.5625 * t2\n : t < b\n ? 9.075 * t2 - 9.9 * t + 3.4\n : t < c\n ? ca * t2 - cb * t + cc\n : 10.8 * t * t - 20.52 * t + 10.72;\n}\n#endif\n\n#ifndef FNC_BOUNCEIN\n#define FNC_BOUNCEIN\nfloat bounceIn(in float t) {\n return 1.0 - bounceOut(1.0 - t);\n}\n#endif\n\n#ifndef FNC_BOUNCEINOUT\n#define FNC_BOUNCEINOUT\nfloat bounceInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0))\n : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;\n}\n#endif\n'},4477:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: circular easing. From https://github.com/stackgl/glsl-easings\nuse: circular<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CIRCULARIN\n#define FNC_CIRCULARIN\nfloat circularIn(in float t) {\n return 1.0 - sqrt(1.0 - t * t);\n}\n#endif\n\n#ifndef FNC_CIRCULAROUT\n#define FNC_CIRCULAROUT\nfloat circularOut(in float t) {\n return sqrt((2.0 - t) * t);\n}\n#endif\n\n#ifndef FNC_CIRCULARINOUT\n#define FNC_CIRCULARINOUT\nfloat circularInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - sqrt(1.0 - 4.0 * t * t))\n : 0.5 * (sqrt((3.0 - 2.0 * t) * (2.0 * t - 1.0)) + 1.0);\n}\n#endif\n'},134:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: cubic easing. From https://github.com/stackgl/glsl-easings\nuse: cubic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CUBICIN\n#define FNC_CUBICIN\nfloat cubicIn(in float t) {\n return t * t * t;\n}\n#endif\n\n#ifndef FNC_CUBICOUT\n#define FNC_CUBICOUT\nfloat cubicOut(in float t) {\n float f = t - 1.0;\n return f * f * f + 1.0;\n}\n#endif\n\n#ifndef FNC_CUBICINOUT\n#define FNC_CUBICINOUT\nfloat cubicInOut(in float t) {\n return t < 0.5\n ? 4.0 * t * t * t\n : 0.5 * pow(2.0 * t - 2.0, 3.0) + 1.0;\n}\n#endif\n'},4621:n=>{n.exports='#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: elastic easing. From https://github.com/stackgl/glsl-easings\nuse: elastic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_ELASTICIN\n#define FNC_ELASTICIN\nfloat elasticIn(in float t) {\n return sin(13.0 * t * HALF_PI) * pow(2.0, 10.0 * (t - 1.0));\n}\n#endif \n\n#ifndef FNC_ELASTICOUT\n#define FNC_ELASTICOUT\nfloat elasticOut(in float t) {\n return sin(-13.0 * (t + 1.0) * HALF_PI) * pow(2.0, -10.0 * t) + 1.0;\n}\n#endif\n\n#ifndef FNC_ELASTICINOUT\n#define FNC_ELASTICINOUT\nfloat elasticInOut(in float t) {\n return t < 0.5\n ? 0.5 * sin(+13.0 * HALF_PI * 2.0 * t) * pow(2.0, 10.0 * (2.0 * t - 1.0))\n : 0.5 * sin(-13.0 * HALF_PI * ((2.0 * t - 1.0) + 1.0)) * pow(2.0, -10.0 * (2.0 * t - 1.0)) + 1.0;\n}\n#endif\n'},3814:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: exponential easing. From https://github.com/stackgl/glsl-easings\nuse: exponential<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_EXPONENTIALIN\n#define FNC_EXPONENTIALIN\nfloat exponentialIn(in float t) {\n return t == 0.0 ? t : pow(2.0, 10.0 * (t - 1.0));\n}\n#endif\n\n#ifndef FNC_EXPONENTIALOUT\n#define FNC_EXPONENTIALOUT\nfloat exponentialOut(in float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n#endif\n\n#ifndef FNC_EXPONENTIALINOUT\n#define FNC_EXPONENTIALINOUT\nfloat exponentialInOut(in float t) {\n return t == 0.0 || t == 1.0\n ? t\n : t < 0.5\n ? +0.5 * pow(2.0, (20.0 * t) - 10.0)\n : -0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0;\n}\n#endif'},406:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Linear easing. From https://github.com/stackgl/glsl-easings\nuse: linear(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_LINEAR\n#define FNC_LINEAR\nfloat linear(in float t) {\n return t;\n}\n#endif\n'},6463:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quadrtic easing. From https://github.com/stackgl/glsl-easings\nuse: quadratic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUADRATICIN\n#define FNC_QUADRATICIN\nfloat quadraticIn(in float t) {\n return t * t;\n}\n#endif\n\n#ifndef FNC_QUADRATICOUT\n#define FNC_QUADRATICOUT\nfloat quadraticOut(in float t) {\n return -t * (t - 2.0);\n}\n#endif\n\n#ifndef FNC_QUADRATICINOUT\n#define FNC_QUADRATICINOUT\nfloat quadraticInOut(in float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n#endif\n'},7549:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quartic easing. From https://github.com/stackgl/glsl-easings\nuse: quartic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUARTICIN\n#define FNC_QUARTICIN\nfloat quarticIn(in float t) {\n return pow(t, 4.0);\n}\n#endif\n\n#ifndef FNC_QUARTICOUT\n#define FNC_QUARTICOUT\nfloat quarticOut(in float t) {\n return pow(t - 1.0, 3.0) * (1.0 - t) + 1.0;\n}\n#endif\n\n#ifndef FNC_QUARTICINOUT\n#define FNC_QUARTICINOUT\nfloat quarticInOut(in float t) {\n return t < 0.5\n ? +8.0 * pow(t, 4.0)\n : -8.0 * pow(t - 1.0, 4.0) + 1.0;\n}\n#endif\n'},173:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quintic easing. From https://github.com/stackgl/glsl-easings\nuse: quintic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUINTICIN\n#define FNC_QUINTICIN\nfloat quinticIn(in float t) {\n return pow(t, 5.0);\n}\n#endif\n\n#ifndef FNC_QUINTICOUT\n#define FNC_QUINTICOUT\nfloat quinticOut(in float t) {\n return 1.0 - (pow(t - 1.0, 5.0));\n}\n#endif\n\n#ifndef FNC_QUINTICINOUT\n#define FNC_QUINTICINOUT\nfloat quinticInOut(in float t) {\n return t < 0.5\n ? +16.0 * pow(t, 5.0)\n : -0.5 * pow(2.0 * t - 2.0, 5.0) + 1.0;\n}\n#endif\n'},3241:n=>{n.exports='#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: sine easing. From https://github.com/stackgl/glsl-easings\nuse: sine<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QINTICIN\n#define FNC_QINTICIN\nfloat sineIn(in float t) {\n return sin((t - 1.0) * HALF_PI) + 1.0;\n}\n#endif\n\n#ifndef FNC_QINTICOUT\n#define FNC_QINTICOUT\nfloat sineOut(in float t) {\n return sin(t * HALF_PI);\n}\n#endif\n\n#ifndef FNC_QINTICINOUT\n#define FNC_QINTICINOUT\nfloat sineInOut(in float t) {\n return -0.5 * (cos(PI * t) - 1.0);\n}\n#endif'}},e={};function t(i){var o=e[i];if(void 0!==o)return o.exports;var I=e[i]={exports:{}};return n[i](I,I.exports,t),I.exports}t.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return t.d(e,{a:e}),e},t.d=(n,e)=>{for(var i in e)t.o(e,i)&&!t.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:e[i]})},t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var i={};(()=>{t.d(i,{Z:()=>g});var n=t(4912),e=t.n(n),o=t(1198),I=t.n(o),s=t(4477),f=t.n(s),O=t(4621),T=t.n(O),N=t(406),a=t.n(N),E=t(7549),d=t.n(E),r=t(3241),R=t.n(r),A=t(6788),l=t.n(A),h=t(134),c=t.n(h),u=t(3814),S=t.n(u),C=t(6463),L=t.n(C),H=t(173),F=t.n(H);const p={back:I(),circular:f(),elastic:T(),linear:a(),quartic:d(),sine:R(),bounce:l(),cubic:c(),exponential:S(),quadratic:L(),quintic:F()},g={easing:Object.assign(e(),p)}})();var o=i.Z;export{o as default}; | ||
var n = { | ||
4912: (n) => { | ||
n.exports = | ||
'/*\ndescription: Include all available easing animations\n*/\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Back easing. From https://github.com/stackgl/glsl-easings\nuse: back<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BACKIN\n#define FNC_BACKIN\nfloat backIn(in float t) {\n return pow(t, 3.) - t * sin(t * PI);\n}\n#endif\n\n#ifndef FNC_BACKOUT\n#define FNC_BACKOUT\nfloat backOut(in float t) {\n return 1. - backIn(1. - t);\n}\n#endif\n\n#ifndef FNC_BACKINOUT\n#define FNC_BACKINOUT\nfloat backInOut(in float t) {\n float f = t < .5\n ? 2.0 * t\n : 1.0 - (2.0 * t - 1.0);\n\n float g = backIn(f);\n\n return t < 0.5\n ? 0.5 * g\n : 0.5 * (1.0 - g) + 0.5;\n}\n#endif\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: bounce easing. From https://github.com/stackgl/glsl-easings\nuse: bounce<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BOUNCEOUT\n#define FNC_BOUNCEOUT\nfloat bounceOut(in float t) {\n const float a = 4.0 / 11.0;\n const float b = 8.0 / 11.0;\n const float c = 9.0 / 10.0;\n\n const float ca = 4356.0 / 361.0;\n const float cb = 35442.0 / 1805.0;\n const float cc = 16061.0 / 1805.0;\n\n float t2 = t * t;\n\n return t < a\n ? 7.5625 * t2\n : t < b\n ? 9.075 * t2 - 9.9 * t + 3.4\n : t < c\n ? ca * t2 - cb * t + cc\n : 10.8 * t * t - 20.52 * t + 10.72;\n}\n#endif\n\n#ifndef FNC_BOUNCEIN\n#define FNC_BOUNCEIN\nfloat bounceIn(in float t) {\n return 1.0 - bounceOut(1.0 - t);\n}\n#endif\n\n#ifndef FNC_BOUNCEINOUT\n#define FNC_BOUNCEINOUT\nfloat bounceInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0))\n : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: circular easing. From https://github.com/stackgl/glsl-easings\nuse: circular<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CIRCULARIN\n#define FNC_CIRCULARIN\nfloat circularIn(in float t) {\n return 1.0 - sqrt(1.0 - t * t);\n}\n#endif\n\n#ifndef FNC_CIRCULAROUT\n#define FNC_CIRCULAROUT\nfloat circularOut(in float t) {\n return sqrt((2.0 - t) * t);\n}\n#endif\n\n#ifndef FNC_CIRCULARINOUT\n#define FNC_CIRCULARINOUT\nfloat circularInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - sqrt(1.0 - 4.0 * t * t))\n : 0.5 * (sqrt((3.0 - 2.0 * t) * (2.0 * t - 1.0)) + 1.0);\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: cubic easing. From https://github.com/stackgl/glsl-easings\nuse: cubic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CUBICIN\n#define FNC_CUBICIN\nfloat cubicIn(in float t) {\n return t * t * t;\n}\n#endif\n\n#ifndef FNC_CUBICOUT\n#define FNC_CUBICOUT\nfloat cubicOut(in float t) {\n float f = t - 1.0;\n return f * f * f + 1.0;\n}\n#endif\n\n#ifndef FNC_CUBICINOUT\n#define FNC_CUBICINOUT\nfloat cubicInOut(in float t) {\n return t < 0.5\n ? 4.0 * t * t * t\n : 0.5 * pow(2.0 * t - 2.0, 3.0) + 1.0;\n}\n#endif\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: elastic easing. From https://github.com/stackgl/glsl-easings\nuse: elastic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_ELASTICIN\n#define FNC_ELASTICIN\nfloat elasticIn(in float t) {\n return sin(13.0 * t * HALF_PI) * pow(2.0, 10.0 * (t - 1.0));\n}\n#endif \n\n#ifndef FNC_ELASTICOUT\n#define FNC_ELASTICOUT\nfloat elasticOut(in float t) {\n return sin(-13.0 * (t + 1.0) * HALF_PI) * pow(2.0, -10.0 * t) + 1.0;\n}\n#endif\n\n#ifndef FNC_ELASTICINOUT\n#define FNC_ELASTICINOUT\nfloat elasticInOut(in float t) {\n return t < 0.5\n ? 0.5 * sin(+13.0 * HALF_PI * 2.0 * t) * pow(2.0, 10.0 * (2.0 * t - 1.0))\n : 0.5 * sin(-13.0 * HALF_PI * ((2.0 * t - 1.0) + 1.0)) * pow(2.0, -10.0 * (2.0 * t - 1.0)) + 1.0;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: exponential easing. From https://github.com/stackgl/glsl-easings\nuse: exponential<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_EXPONENTIALIN\n#define FNC_EXPONENTIALIN\nfloat exponentialIn(in float t) {\n return t == 0.0 ? t : pow(2.0, 10.0 * (t - 1.0));\n}\n#endif\n\n#ifndef FNC_EXPONENTIALOUT\n#define FNC_EXPONENTIALOUT\nfloat exponentialOut(in float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n#endif\n\n#ifndef FNC_EXPONENTIALINOUT\n#define FNC_EXPONENTIALINOUT\nfloat exponentialInOut(in float t) {\n return t == 0.0 || t == 1.0\n ? t\n : t < 0.5\n ? +0.5 * pow(2.0, (20.0 * t) - 10.0)\n : -0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0;\n}\n#endif\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Linear easing. From https://github.com/stackgl/glsl-easings\nuse: linear(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_LINEAR\n#define FNC_LINEAR\nfloat linear(in float t) {\n return t;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quadrtic easing. From https://github.com/stackgl/glsl-easings\nuse: quadratic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUADRATICIN\n#define FNC_QUADRATICIN\nfloat quadraticIn(in float t) {\n return t * t;\n}\n#endif\n\n#ifndef FNC_QUADRATICOUT\n#define FNC_QUADRATICOUT\nfloat quadraticOut(in float t) {\n return -t * (t - 2.0);\n}\n#endif\n\n#ifndef FNC_QUADRATICINOUT\n#define FNC_QUADRATICINOUT\nfloat quadraticInOut(in float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quintic easing. From https://github.com/stackgl/glsl-easings\nuse: quintic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUINTICIN\n#define FNC_QUINTICIN\nfloat quinticIn(in float t) {\n return pow(t, 5.0);\n}\n#endif\n\n#ifndef FNC_QUINTICOUT\n#define FNC_QUINTICOUT\nfloat quinticOut(in float t) {\n return 1.0 - (pow(t - 1.0, 5.0));\n}\n#endif\n\n#ifndef FNC_QUINTICINOUT\n#define FNC_QUINTICINOUT\nfloat quinticInOut(in float t) {\n return t < 0.5\n ? +16.0 * pow(t, 5.0)\n : -0.5 * pow(2.0 * t - 2.0, 5.0) + 1.0;\n}\n#endif\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: sine easing. From https://github.com/stackgl/glsl-easings\nuse: sine<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_SINEIN\n#define FNC_SINEIN\nfloat sineIn(in float t) {\n return sin((t - 1.0) * HALF_PI) + 1.0;\n}\n#endif\n\n#ifndef FNC_SINEOUT\n#define FNC_SINEOUT\nfloat sineOut(in float t) {\n return sin(t * HALF_PI);\n}\n#endif\n\n#ifndef FNC_SINEINOUT\n#define FNC_SINEINOUT\nfloat sineInOut(in float t) {\n return -0.5 * (cos(PI * t) - 1.0);\n}\n#endif\n\n' | ||
}, | ||
1198: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Back easing. From https://github.com/stackgl/glsl-easings\nuse: back<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BACKIN\n#define FNC_BACKIN\nfloat backIn(in float t) {\n return pow(t, 3.) - t * sin(t * PI);\n}\n#endif\n\n#ifndef FNC_BACKOUT\n#define FNC_BACKOUT\nfloat backOut(in float t) {\n return 1. - backIn(1. - t);\n}\n#endif\n\n#ifndef FNC_BACKINOUT\n#define FNC_BACKINOUT\nfloat backInOut(in float t) {\n float f = t < .5\n ? 2.0 * t\n : 1.0 - (2.0 * t - 1.0);\n\n float g = backIn(f);\n\n return t < 0.5\n ? 0.5 * g\n : 0.5 * (1.0 - g) + 0.5;\n}\n#endif\n' | ||
}, | ||
6788: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: bounce easing. From https://github.com/stackgl/glsl-easings\nuse: bounce<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BOUNCEOUT\n#define FNC_BOUNCEOUT\nfloat bounceOut(in float t) {\n const float a = 4.0 / 11.0;\n const float b = 8.0 / 11.0;\n const float c = 9.0 / 10.0;\n\n const float ca = 4356.0 / 361.0;\n const float cb = 35442.0 / 1805.0;\n const float cc = 16061.0 / 1805.0;\n\n float t2 = t * t;\n\n return t < a\n ? 7.5625 * t2\n : t < b\n ? 9.075 * t2 - 9.9 * t + 3.4\n : t < c\n ? ca * t2 - cb * t + cc\n : 10.8 * t * t - 20.52 * t + 10.72;\n}\n#endif\n\n#ifndef FNC_BOUNCEIN\n#define FNC_BOUNCEIN\nfloat bounceIn(in float t) {\n return 1.0 - bounceOut(1.0 - t);\n}\n#endif\n\n#ifndef FNC_BOUNCEINOUT\n#define FNC_BOUNCEINOUT\nfloat bounceInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0))\n : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;\n}\n#endif\n' | ||
}, | ||
4477: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: circular easing. From https://github.com/stackgl/glsl-easings\nuse: circular<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CIRCULARIN\n#define FNC_CIRCULARIN\nfloat circularIn(in float t) {\n return 1.0 - sqrt(1.0 - t * t);\n}\n#endif\n\n#ifndef FNC_CIRCULAROUT\n#define FNC_CIRCULAROUT\nfloat circularOut(in float t) {\n return sqrt((2.0 - t) * t);\n}\n#endif\n\n#ifndef FNC_CIRCULARINOUT\n#define FNC_CIRCULARINOUT\nfloat circularInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - sqrt(1.0 - 4.0 * t * t))\n : 0.5 * (sqrt((3.0 - 2.0 * t) * (2.0 * t - 1.0)) + 1.0);\n}\n#endif\n' | ||
}, | ||
134: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: cubic easing. From https://github.com/stackgl/glsl-easings\nuse: cubic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CUBICIN\n#define FNC_CUBICIN\nfloat cubicIn(in float t) {\n return t * t * t;\n}\n#endif\n\n#ifndef FNC_CUBICOUT\n#define FNC_CUBICOUT\nfloat cubicOut(in float t) {\n float f = t - 1.0;\n return f * f * f + 1.0;\n}\n#endif\n\n#ifndef FNC_CUBICINOUT\n#define FNC_CUBICINOUT\nfloat cubicInOut(in float t) {\n return t < 0.5\n ? 4.0 * t * t * t\n : 0.5 * pow(2.0 * t - 2.0, 3.0) + 1.0;\n}\n#endif\n' | ||
}, | ||
4621: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: elastic easing. From https://github.com/stackgl/glsl-easings\nuse: elastic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_ELASTICIN\n#define FNC_ELASTICIN\nfloat elasticIn(in float t) {\n return sin(13.0 * t * HALF_PI) * pow(2.0, 10.0 * (t - 1.0));\n}\n#endif \n\n#ifndef FNC_ELASTICOUT\n#define FNC_ELASTICOUT\nfloat elasticOut(in float t) {\n return sin(-13.0 * (t + 1.0) * HALF_PI) * pow(2.0, -10.0 * t) + 1.0;\n}\n#endif\n\n#ifndef FNC_ELASTICINOUT\n#define FNC_ELASTICINOUT\nfloat elasticInOut(in float t) {\n return t < 0.5\n ? 0.5 * sin(+13.0 * HALF_PI * 2.0 * t) * pow(2.0, 10.0 * (2.0 * t - 1.0))\n : 0.5 * sin(-13.0 * HALF_PI * ((2.0 * t - 1.0) + 1.0)) * pow(2.0, -10.0 * (2.0 * t - 1.0)) + 1.0;\n}\n#endif\n' | ||
}, | ||
3814: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: exponential easing. From https://github.com/stackgl/glsl-easings\nuse: exponential<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_EXPONENTIALIN\n#define FNC_EXPONENTIALIN\nfloat exponentialIn(in float t) {\n return t == 0.0 ? t : pow(2.0, 10.0 * (t - 1.0));\n}\n#endif\n\n#ifndef FNC_EXPONENTIALOUT\n#define FNC_EXPONENTIALOUT\nfloat exponentialOut(in float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n#endif\n\n#ifndef FNC_EXPONENTIALINOUT\n#define FNC_EXPONENTIALINOUT\nfloat exponentialInOut(in float t) {\n return t == 0.0 || t == 1.0\n ? t\n : t < 0.5\n ? +0.5 * pow(2.0, (20.0 * t) - 10.0)\n : -0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0;\n}\n#endif' | ||
}, | ||
406: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Linear easing. From https://github.com/stackgl/glsl-easings\nuse: linear(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_LINEAR\n#define FNC_LINEAR\nfloat linear(in float t) {\n return t;\n}\n#endif\n' | ||
}, | ||
6463: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quadrtic easing. From https://github.com/stackgl/glsl-easings\nuse: quadratic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUADRATICIN\n#define FNC_QUADRATICIN\nfloat quadraticIn(in float t) {\n return t * t;\n}\n#endif\n\n#ifndef FNC_QUADRATICOUT\n#define FNC_QUADRATICOUT\nfloat quadraticOut(in float t) {\n return -t * (t - 2.0);\n}\n#endif\n\n#ifndef FNC_QUADRATICINOUT\n#define FNC_QUADRATICINOUT\nfloat quadraticInOut(in float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n#endif\n' | ||
}, | ||
7549: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quartic easing. From https://github.com/stackgl/glsl-easings\nuse: quartic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUARTICIN\n#define FNC_QUARTICIN\nfloat quarticIn(in float t) {\n return pow(t, 4.0);\n}\n#endif\n\n#ifndef FNC_QUARTICOUT\n#define FNC_QUARTICOUT\nfloat quarticOut(in float t) {\n return pow(t - 1.0, 3.0) * (1.0 - t) + 1.0;\n}\n#endif\n\n#ifndef FNC_QUARTICINOUT\n#define FNC_QUARTICINOUT\nfloat quarticInOut(in float t) {\n return t < 0.5\n ? +8.0 * pow(t, 4.0)\n : -8.0 * pow(t - 1.0, 4.0) + 1.0;\n}\n#endif\n' | ||
}, | ||
173: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quintic easing. From https://github.com/stackgl/glsl-easings\nuse: quintic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUINTICIN\n#define FNC_QUINTICIN\nfloat quinticIn(in float t) {\n return pow(t, 5.0);\n}\n#endif\n\n#ifndef FNC_QUINTICOUT\n#define FNC_QUINTICOUT\nfloat quinticOut(in float t) {\n return 1.0 - (pow(t - 1.0, 5.0));\n}\n#endif\n\n#ifndef FNC_QUINTICINOUT\n#define FNC_QUINTICINOUT\nfloat quinticInOut(in float t) {\n return t < 0.5\n ? +16.0 * pow(t, 5.0)\n : -0.5 * pow(2.0 * t - 2.0, 5.0) + 1.0;\n}\n#endif\n' | ||
}, | ||
3241: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: sine easing. From https://github.com/stackgl/glsl-easings\nuse: sine<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_SINEIN\n#define FNC_SINEIN\nfloat sineIn(in float t) {\n return sin((t - 1.0) * HALF_PI) + 1.0;\n}\n#endif\n\n#ifndef FNC_SINEOUT\n#define FNC_SINEOUT\nfloat sineOut(in float t) {\n return sin(t * HALF_PI);\n}\n#endif\n\n#ifndef FNC_SINEINOUT\n#define FNC_SINEINOUT\nfloat sineInOut(in float t) {\n return -0.5 * (cos(PI * t) - 1.0);\n}\n#endif\n' | ||
}, | ||
}, | ||
e = {} | ||
function t(i) { | ||
var o = e[i] | ||
if (void 0 !== o) return o.exports | ||
var I = (e[i] = { exports: {} }) | ||
return n[i](I, I.exports, t), I.exports | ||
} | ||
;(t.d = (n, e) => { | ||
for (var i in e) | ||
t.o(e, i) && | ||
!t.o(n, i) && | ||
Object.defineProperty(n, i, { enumerable: !0, get: e[i] }) | ||
}), | ||
(t.o = (n, e) => Object.prototype.hasOwnProperty.call(n, e)) | ||
var i = {} | ||
;(() => { | ||
t.d(i, { Z: () => o }) | ||
var n = t(4912) | ||
const e = { | ||
back: t(1198), | ||
circular: t(4477), | ||
elastic: t(4621), | ||
linear: t(406), | ||
quartic: t(7549), | ||
sine: t(3241), | ||
bounce: t(6788), | ||
cubic: t(134), | ||
exponential: t(3814), | ||
quadratic: t(6463), | ||
quintic: t(173), | ||
}, | ||
o = { easing: Object.assign(n, e) } | ||
})() | ||
var o = i.Z | ||
export { o as default } |
@@ -1,1 +0,44 @@ | ||
var n={4249:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Squared length\nuse: lengthSq(<vec2|float2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LENGTHSQ\n#define FNC_LENGTHSQ\nfloat lengthSq(in vec2 st) {\n return dot(st, st);\n}\n\nfloat lengthSq(in vec3 pos) {\n return dot(pos, pos);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Barrel distortion\nuse: barrel(sampler2D tex, <vec2> st, [, <vec2|float> sdf])\noptions:\n BARREL_DISTANCE: function used to shape the distortion, defaults to radial shape with lengthSq\n BARREL_TYPE: return type, defaults to vec3\n BARREL_SAMPLER_FNC: function used to sample the input texture, defaults to texture2D(tex, POS_UV).rgb\n BARREL_OCT_1: one octave of distortion\n BARREL_OCT_2: two octaves of distortion\n BARREL_OCT_3: three octaves of distortion\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef BARREL_DISTANCE\n#define BARREL_DISTANCE dist\n#endif\n\n#ifndef BARREL_TYPE\n#define BARREL_TYPE vec3\n#endif\n\n#ifndef BARREL_SAMPLER_FNC\n#define BARREL_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV).rgb\n#endif\n\n#ifndef FNC_BARREL\n#define FNC_BARREL\nvec2 barrel(vec2 st, float amt, float dist) {\n return st + (st-.5) * (BARREL_DISTANCE) * amt;\n}\n\nvec2 barrel(vec2 st, float amt) {\n return barrel(st, amt, lengthSq(st-.5));\n}\n\nBARREL_TYPE barrel(in sampler2D tex, in vec2 st, float offset) {\n BARREL_TYPE a1 = BARREL_SAMPLER_FNC( barrel(st, .0, offset));\n BARREL_TYPE a2 = BARREL_SAMPLER_FNC( barrel(st, .2, offset));\n BARREL_TYPE a3 = BARREL_SAMPLER_FNC( barrel(st, .4, offset));\n BARREL_TYPE a4 = BARREL_SAMPLER_FNC( barrel(st, .6, offset));\n#ifdef BARREL_OCT_1\n return (a1+a2+a3+a4)/4.;\n#endif\n BARREL_TYPE a5 = BARREL_SAMPLER_FNC( barrel(st, .8, offset));\n BARREL_TYPE a6 = BARREL_SAMPLER_FNC( barrel(st, 1.0, offset));\n BARREL_TYPE a7 = BARREL_SAMPLER_FNC( barrel(st, 1.2, offset));\n BARREL_TYPE a8 = BARREL_SAMPLER_FNC( barrel(st, 1.4, offset));\n#ifdef BARREL_OCT_2\n return (a1+a2+a3+a4+a5+a6+a7+a8)/8.;\n#endif\n BARREL_TYPE a9 = BARREL_SAMPLER_FNC( barrel(st, 1.6, offset));\n BARREL_TYPE a10 = BARREL_SAMPLER_FNC( barrel(st, 1.8, offset));\n BARREL_TYPE a11 = BARREL_SAMPLER_FNC( barrel(st, 2.0, offset));\n BARREL_TYPE a12 = BARREL_SAMPLER_FNC( barrel(st, 2.2, offset));\n return (a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12)/12.;\n}\n\nBARREL_TYPE barrel(in sampler2D tex, in vec2 st, in vec2 offset) {\n return barrel(tex, st, dot(vec2(.5), offset));\n}\n\nBARREL_TYPE barrel(in sampler2D tex, in vec2 st) {\n return barrel(tex, st, lengthSq(st-.5));\n}\n\n#endif\n'},3886:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Squared length\nuse: lengthSq(<vec2|float2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LENGTHSQ\n#define FNC_LENGTHSQ\nfloat lengthSq(in vec2 st) {\n return dot(st, st);\n}\n\nfloat lengthSq(in vec3 pos) {\n return dot(pos, pos);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo, Johan Ismael\ndescription: Chroma Aberration inspired by https://www.shadertoy.com/view/4sX3z4\nuse: chromaAB(<sampler2D> texture, <vec2> st [, <float|vec2> sdf|offset, <float> pct])\noptions:\n CHROMAAB_TYPE: return type, defauls to vec3\n CHROMAAB_PCT: amount of aberration, defaults to 1.5\n CHROMAAB_SAMPLER_FNC: function used to sample the input texture, defaults to texture2D(tex, POS_UV)\n CHROMAAB_CENTER_BUFFER: scalar to attenuate the sdf passed in \nlicense: |\n Copyright (c) 2021 Patricio Gonzalez Vivo and Johan Ismael\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef CHROMAAB_PCT\n#define CHROMAAB_PCT 1.5\n#endif\n\n#ifndef CHROMAAB_TYPE\n#define CHROMAAB_TYPE vec3\n#endif\n\n#ifndef CHROMAAB_SAMPLER_FNC\n#define CHROMAAB_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_CHROMAAB\n#define FNC_CHROMAAB\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in vec2 direction, in vec3 distortion ) {\n vec2 offset = vec2(0.0);\n CHROMAAB_TYPE c = CHROMAAB_TYPE(1.);\n c.r = CHROMAAB_SAMPLER_FNC(st + direction * distortion.r).r;\n c.g = CHROMAAB_SAMPLER_FNC(st + direction * distortion.g).g;\n c.b = CHROMAAB_SAMPLER_FNC(st + direction * distortion.b).b;\n return c;\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in vec2 offset, in float pct) {\n\n #ifdef CHROMAAB_CENTER_BUFFER\n // modify the distance from the center, so that only the edges are affected\n offset = max(offset - CHROMAAB_CENTER_BUFFER, 0.);\n #endif\n\n // Distort the UVs\n vec2 stR = st * (1.0 + offset * 0.02 * pct),\n stB = st * (1.0 - offset * 0.02 * pct);\n\n // Get the individual channels using the modified UVs\n CHROMAAB_TYPE c = CHROMAAB_TYPE(1.);\n c.r = CHROMAAB_SAMPLER_FNC(stR).r;\n c.g = CHROMAAB_SAMPLER_FNC(st).g;\n c.b = CHROMAAB_SAMPLER_FNC(stB).b;\n return c;\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in float sdf, in float pct) {\n return chromaAB(tex, st, vec2(sdf), pct);\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in float sdf) {\n return chromaAB(tex, st, sdf, CHROMAAB_PCT);\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in vec2 offset) {\n return chromaAB(tex, st, offset, CHROMAAB_PCT);\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st) {\n return chromaAB(tex, st, lengthSq(st - .5), CHROMAAB_PCT);\n}\n\n#endif\n'},4775:n=>{n.exports='/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: grad4, used for snoise(vec4 v)\nuse: grad4(<float> j, <vec4> ip)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_GRAD4\n#define FNC_GRAD4\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Simplex Noise https://github.com/ashima/webgl-noise\nuse: snoise(<vec2|vec3|vec4> pos)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n*/\n\n#ifndef FNC_SNOISE\n#define FNC_SNOISE\nfloat snoise(in vec2 v) {\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0\n //i1.y = 1.0 - i1.x;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n // x0 = x0 - 0.0 + 0.0 * C.xx ;\n // x1 = x0 - i1 + 1.0 * C.xx ;\n // x2 = x0 - 1.0 + 2.0 * C.xx ;\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\n\nfloat snoise(in vec3 v) {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n // Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients: 7x7 points over a square, mapped onto an octahedron.\n // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n //Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}\n\nfloat snoise(in vec4 v) {\n const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\n 0.276393202250021, // 2 * G4\n 0.414589803375032, // 3 * G4\n -0.447213595499958); // -1 + 4 * G4\n\n // First corner\n vec4 i = floor(v + dot(v, vec4(.309016994374947451)) ); // (sqrt(5) - 1)/4\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxxx\n // x1 = x0 - i1 + 1.0 * C.xxxx\n // x2 = x0 - i2 + 2.0 * C.xxxx\n // x3 = x0 - i3 + 3.0 * C.xxxx\n // x4 = x0 - 1.0 + 4.0 * C.xxxx\n vec4 x1 = x0 - i1 + C.xxxx;\n vec4 x2 = x0 - i2 + C.yyyy;\n vec4 x3 = x0 - i3 + C.zzzz;\n vec4 x4 = x0 + C.wwww;\n\n // Permutations\n i = mod289(i);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n}\n\nvec3 snoise3( vec3 x ){\n float s = snoise(vec3( x ));\n float s1 = snoise(vec3( x.y - 19.1 , x.z + 33.4 , x.x + 47.2 ));\n float s2 = snoise(vec3( x.z + 74.2 , x.x - 124.5 , x.y + 99.4 ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\nvec3 snoise3( vec4 x ){\n float s = snoise(vec4( x ));\n float s1 = snoise(vec4( x.y - 19.1 , x.z + 33.4 , x.x + 47.2, x.w ));\n float s2 = snoise(vec4( x.z + 74.2 , x.x - 124.5 , x.y + 99.4, x.w ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: fade\nuse: fade(<vec2|vec3|vec4> t)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_FADE\n#define FNC_FADE\nfloat fade(in float t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec2 fade(in vec2 t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec3 fade(in vec3 t) {\n return t * t * t * (t * (t * 6. - 15. ) + 10.);\n}\n\nvec4 fade(vec4 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Classic Perlin Noise with periodic variant https://github.com/ashima/webgl-noise\nuse: pnoise(<vec2|vec3|vec4> pos, <vec2|vec3|vec4> periodic)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n*/\n\n#ifndef FNC_PNOISE\n#define FNC_PNOISE\n// Classic Perlin noise, periodic variant\nfloat pnoise(in vec2 P, in vec2 rep) {\n vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0);\n vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0);\n Pi = mod(Pi, rep.xyxy); // To create noise with explicit period\n Pi = mod289(Pi); // To avoid truncation effects in permutation\n vec4 ix = Pi.xzxz;\n vec4 iy = Pi.yyww;\n vec4 fx = Pf.xzxz;\n vec4 fy = Pf.yyww;\n\n vec4 i = permute(permute(ix) + iy);\n\n vec4 gx = fract(i * (1.0 / 41.0)) * 2.0 - 1.0 ;\n vec4 gy = abs(gx) - 0.5 ;\n vec4 tx = floor(gx + 0.5);\n gx = gx - tx;\n\n vec2 g00 = vec2(gx.x,gy.x);\n vec2 g10 = vec2(gx.y,gy.y);\n vec2 g01 = vec2(gx.z,gy.z);\n vec2 g11 = vec2(gx.w,gy.w);\n\n vec4 norm = taylorInvSqrt(vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)));\n g00 *= norm.x;\n g01 *= norm.y;\n g10 *= norm.z;\n g11 *= norm.w;\n\n float n00 = dot(g00, vec2(fx.x, fy.x));\n float n10 = dot(g10, vec2(fx.y, fy.y));\n float n01 = dot(g01, vec2(fx.z, fy.z));\n float n11 = dot(g11, vec2(fx.w, fy.w));\n\n vec2 fade_xy = fade(Pf.xy);\n vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x);\n float n_xy = mix(n_x.x, n_x.y, fade_xy.y);\n return 2.3 * n_xy;\n}\n\nfloat pnoise(in vec3 P, in vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nfloat pnoise(in vec4 P, in vec4 rep) {\n vec4 Pi0 = mod(floor(P), rep); // Integer part modulo rep\n vec4 Pi1 = mod(Pi0 + 1.0, rep); // Integer part + 1 mod rep\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec4 Pf0 = fract(P); // Fractional part for interpolation\n vec4 Pf1 = Pf0 - 1.0; // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = vec4(Pi0.zzzz);\n vec4 iz1 = vec4(Pi1.zzzz);\n vec4 iw0 = vec4(Pi0.wwww);\n vec4 iw1 = vec4(Pi1.wwww);\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 ixy00 = permute(ixy0 + iw0);\n vec4 ixy01 = permute(ixy0 + iw1);\n vec4 ixy10 = permute(ixy1 + iw0);\n vec4 ixy11 = permute(ixy1 + iw1);\n\n vec4 gx00 = ixy00 * (1.0 / 7.0);\n vec4 gy00 = floor(gx00) * (1.0 / 7.0);\n vec4 gz00 = floor(gy00) * (1.0 / 6.0);\n gx00 = fract(gx00) - 0.5;\n gy00 = fract(gy00) - 0.5;\n gz00 = fract(gz00) - 0.5;\n vec4 gw00 = vec4(0.75) - abs(gx00) - abs(gy00) - abs(gz00);\n vec4 sw00 = step(gw00, vec4(0.0));\n gx00 -= sw00 * (step(0.0, gx00) - 0.5);\n gy00 -= sw00 * (step(0.0, gy00) - 0.5);\n\n vec4 gx01 = ixy01 * (1.0 / 7.0);\n vec4 gy01 = floor(gx01) * (1.0 / 7.0);\n vec4 gz01 = floor(gy01) * (1.0 / 6.0);\n gx01 = fract(gx01) - 0.5;\n gy01 = fract(gy01) - 0.5;\n gz01 = fract(gz01) - 0.5;\n vec4 gw01 = vec4(0.75) - abs(gx01) - abs(gy01) - abs(gz01);\n vec4 sw01 = step(gw01, vec4(0.0));\n gx01 -= sw01 * (step(0.0, gx01) - 0.5);\n gy01 -= sw01 * (step(0.0, gy01) - 0.5);\n\n vec4 gx10 = ixy10 * (1.0 / 7.0);\n vec4 gy10 = floor(gx10) * (1.0 / 7.0);\n vec4 gz10 = floor(gy10) * (1.0 / 6.0);\n gx10 = fract(gx10) - 0.5;\n gy10 = fract(gy10) - 0.5;\n gz10 = fract(gz10) - 0.5;\n vec4 gw10 = vec4(0.75) - abs(gx10) - abs(gy10) - abs(gz10);\n vec4 sw10 = step(gw10, vec4(0.0));\n gx10 -= sw10 * (step(0.0, gx10) - 0.5);\n gy10 -= sw10 * (step(0.0, gy10) - 0.5);\n\n vec4 gx11 = ixy11 * (1.0 / 7.0);\n vec4 gy11 = floor(gx11) * (1.0 / 7.0);\n vec4 gz11 = floor(gy11) * (1.0 / 6.0);\n gx11 = fract(gx11) - 0.5;\n gy11 = fract(gy11) - 0.5;\n gz11 = fract(gz11) - 0.5;\n vec4 gw11 = vec4(0.75) - abs(gx11) - abs(gy11) - abs(gz11);\n vec4 sw11 = step(gw11, vec4(0.0));\n gx11 -= sw11 * (step(0.0, gx11) - 0.5);\n gy11 -= sw11 * (step(0.0, gy11) - 0.5);\n\n vec4 g0000 = vec4(gx00.x,gy00.x,gz00.x,gw00.x);\n vec4 g1000 = vec4(gx00.y,gy00.y,gz00.y,gw00.y);\n vec4 g0100 = vec4(gx00.z,gy00.z,gz00.z,gw00.z);\n vec4 g1100 = vec4(gx00.w,gy00.w,gz00.w,gw00.w);\n vec4 g0010 = vec4(gx10.x,gy10.x,gz10.x,gw10.x);\n vec4 g1010 = vec4(gx10.y,gy10.y,gz10.y,gw10.y);\n vec4 g0110 = vec4(gx10.z,gy10.z,gz10.z,gw10.z);\n vec4 g1110 = vec4(gx10.w,gy10.w,gz10.w,gw10.w);\n vec4 g0001 = vec4(gx01.x,gy01.x,gz01.x,gw01.x);\n vec4 g1001 = vec4(gx01.y,gy01.y,gz01.y,gw01.y);\n vec4 g0101 = vec4(gx01.z,gy01.z,gz01.z,gw01.z);\n vec4 g1101 = vec4(gx01.w,gy01.w,gz01.w,gw01.w);\n vec4 g0011 = vec4(gx11.x,gy11.x,gz11.x,gw11.x);\n vec4 g1011 = vec4(gx11.y,gy11.y,gz11.y,gw11.y);\n vec4 g0111 = vec4(gx11.z,gy11.z,gz11.z,gw11.z);\n vec4 g1111 = vec4(gx11.w,gy11.w,gz11.w,gw11.w);\n\n vec4 norm00 = taylorInvSqrt(vec4(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100)));\n g0000 *= norm00.x;\n g0100 *= norm00.y;\n g1000 *= norm00.z;\n g1100 *= norm00.w;\n\n vec4 norm01 = taylorInvSqrt(vec4(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101)));\n g0001 *= norm01.x;\n g0101 *= norm01.y;\n g1001 *= norm01.z;\n g1101 *= norm01.w;\n\n vec4 norm10 = taylorInvSqrt(vec4(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110)));\n g0010 *= norm10.x;\n g0110 *= norm10.y;\n g1010 *= norm10.z;\n g1110 *= norm10.w;\n\n vec4 norm11 = taylorInvSqrt(vec4(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111)));\n g0011 *= norm11.x;\n g0111 *= norm11.y;\n g1011 *= norm11.z;\n g1111 *= norm11.w;\n\n float n0000 = dot(g0000, Pf0);\n float n1000 = dot(g1000, vec4(Pf1.x, Pf0.yzw));\n float n0100 = dot(g0100, vec4(Pf0.x, Pf1.y, Pf0.zw));\n float n1100 = dot(g1100, vec4(Pf1.xy, Pf0.zw));\n float n0010 = dot(g0010, vec4(Pf0.xy, Pf1.z, Pf0.w));\n float n1010 = dot(g1010, vec4(Pf1.x, Pf0.y, Pf1.z, Pf0.w));\n float n0110 = dot(g0110, vec4(Pf0.x, Pf1.yz, Pf0.w));\n float n1110 = dot(g1110, vec4(Pf1.xyz, Pf0.w));\n float n0001 = dot(g0001, vec4(Pf0.xyz, Pf1.w));\n float n1001 = dot(g1001, vec4(Pf1.x, Pf0.yz, Pf1.w));\n float n0101 = dot(g0101, vec4(Pf0.x, Pf1.y, Pf0.z, Pf1.w));\n float n1101 = dot(g1101, vec4(Pf1.xy, Pf0.z, Pf1.w));\n float n0011 = dot(g0011, vec4(Pf0.xy, Pf1.zw));\n float n1011 = dot(g1011, vec4(Pf1.x, Pf0.y, Pf1.zw));\n float n0111 = dot(g0111, vec4(Pf0.x, Pf1.yzw));\n float n1111 = dot(g1111, Pf1);\n\n vec4 fade_xyzw = fade(Pf0);\n vec4 n_0w = mix(vec4(n0000, n1000, n0100, n1100), vec4(n0001, n1001, n0101, n1101), fade_xyzw.w);\n vec4 n_1w = mix(vec4(n0010, n1010, n0110, n1110), vec4(n0011, n1011, n0111, n1111), fade_xyzw.w);\n vec4 n_zw = mix(n_0w, n_1w, fade_xyzw.z);\n vec2 n_yzw = mix(n_zw.xy, n_zw.zw, fade_xyzw.y);\n float n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x);\n return 2.2 * n_xyzw;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get\'s the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: rgb2luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_RGB2LUMA\n#define FNC_RGB2LUMA\nfloat rgb2luma(in vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\nfloat rgb2luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_LUMA\n#define FNC_LUMA\nfloat luma(float color) {\n return color;\n}\n\nfloat luma(in vec3 color) {\n return rgb2luma(color);\n}\n\nfloat luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n/*\nauthor: Jamie Owen\ndescription: Photoshop Soft Light blend mode mplementations sourced from this article on https://mouaif.wordpress.com/2009/01/05/photoshop-math-with-glsl-shaders/\nuse: blendSoftLight(<float|vec3> base, <float|vec3> blend [, <float> opacity])\nlicence: TODO\n*/\n\n#ifndef FNC_BLENDSOFTLIGHT\n#define FNC_BLENDSOFTLIGHT\nfloat blendSoftLight(in float base, in float blend) {\n return (blend < .5)? (2. * base * blend + base * base * (1. - 2.*blend)): (sqrt(base) * (2. * blend - 1.) + 2. * base * (1. - blend));\n}\n\nvec3 blendSoftLight(in vec3 base, in vec3 blend) {\n return vec3(blendSoftLight(base.r, blend.r),\n blendSoftLight(base.g, blend.g),\n blendSoftLight(base.b, blend.b));\n}\n\nvec4 blendSoftLight(in vec4 base, in vec4 blend) {\n return vec4(blendSoftLight( base.r, blend.r ),\n blendSoftLight( base.g, blend.g ),\n blendSoftLight( base.b, blend.b ),\n blendSoftLight( base.a, blend.a )\n );\n}\n\nvec3 blendSoftLight(in vec3 base, in vec3 blend, in float opacity) {\n return (blendSoftLight(base, blend) * opacity + base * (1. - opacity));\n}\n#endif\n\n\n/*\nauthor: Matt DesLauriers\ndescription: Natural looking film grain using 3D noise functions (original source: https://github.com/mattdesl/glsl-film-grain). Inspired by [Martins Upitis](http://devlog-martinsh.blogspot.com/2013/05/image-imperfections-and-film-grain-post.html).\nuse: \n - grain(<vec2> texCoord, <vec2> resolution [, <float> t, <float> multiplier])\n - grain(<sampler2D> texture, <vec2> texCoord, <float|vec2> resolution [, <float> t, <float> multiplier])\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Matt DesLauriers\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef GRAIN_TYPE\n#define GRAIN_TYPE vec3\n#endif\n\n#ifndef GRAIN_SAMPLER_FNC\n#define GRAIN_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV).rgb\n#endif\n\n#ifndef FNC_GRAIN\n#define FNC_GRAIN\nfloat grain(vec2 texCoord, vec2 resolution, float t, float multiplier) {\n vec2 mult = texCoord * resolution;\n float offset = snoise(vec3(mult / multiplier, t));\n float n1 = pnoise(vec3(mult, offset), vec3(1. / texCoord * resolution, 1.));\n return n1 / 2. + .5;\n}\n\nfloat grain(vec2 texCoord, vec2 resolution, float t) {\n return grain(texCoord, resolution, t, 2.5);\n}\n\nfloat grain(vec2 texCoord, vec2 resolution) {\n return grain(texCoord, resolution, 0.);\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, vec2 resolution, float t, float multiplier ) {\n GRAIN_TYPE org = GRAIN_SAMPLER_FNC(st);\n\n float g = grain(st, resolution, t, multiplier);\n\n //get the luminance of the background\n float luminance = luma(org);\n \n //reduce the noise based on some \n //threshold of the background luminance\n float response = smoothstep(0.05, 0.5, luminance);\n return mix( blendSoftLight(org, GRAIN_TYPE(g)), \n org, \n response * response);\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, vec2 resolution, float t ) {\n return grain(tex, st, resolution, t, 2.5 );\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, vec2 resolution) {\n return grain(tex, st, resolution, 0.);\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, float resolution, float t, float multiplier ) {\n return grain(tex, st, vec2(resolution), t, multiplier );\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, float resolution, float t ) {\n return grain(tex, st, resolution, t, 2.5 );\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, float resolution) {\n return grain(tex, st, resolution, 0.);\n}\n\n#endif'},8249:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo, Johan Ismael\ndescription: Samples multiple times a texture in the specified direction\nuse: stretch(<sampler2D> tex, <vec2> st, <vec2> direction [, int samples])\noptions:\n STRETCH_SAMPLES: number of samples taken, defaults to 20\n STRETCH_TYPE: return type, defauls to vec4\n STRETCH_SAMPLER_FNC(POS_UV): function used to sample the input texture, defaults to texture2D(tex, POS_UV)\n STRETCH_WEIGHT: shaping equation to multiply the sample weight.\nlicense: |\n Copyright (c) 2021 Patricio Gonzalez Vivo and Johan Ismael\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOF\n*/\n\n#ifndef STRETCH_SAMPLES\n#define STRETCH_SAMPLES 20\n#endif\n\n#ifndef STRETCH_TYPE\n#define STRETCH_TYPE vec4\n#endif\n\n#ifndef STRETCH_SAMPLER_FNC\n#define STRETCH_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_STRETCH\n#define FNC_STRETCH\nSTRETCH_TYPE stretch(in sampler2D tex, in vec2 st, in vec2 direction, const int i_samples) {\n float f_samples = float(i_samples);\n STRETCH_TYPE color = STRETCH_TYPE(0.);\n\n #ifdef PLATFORM_WEBGL\n for (int i = 0; i < 50; i++) {\n if (i == i_samples) break;\n #else\n for (int i = 0; i < i_samples; i++) {\n #endif\n\n float f_sample = float(i);\n STRETCH_TYPE tx = STRETCH_SAMPLER_FNC(st + direction * f_sample);\n #ifdef STRETCH_WEIGHT\n tx *= STRETCH_WEIGHT;\n #endif\n color += tx;\n }\n return color / f_samples;\n}\n\nSTRETCH_TYPE stretch(in sampler2D tex, in vec2 st, in vec2 direction) {\n float f_samples = float(STRETCH_SAMPLES); \n STRETCH_TYPE color = STRETCH_TYPE(0.);\n for (int i = 0; i < STRETCH_SAMPLES; i++) {\n float f_sample = float(i); \n STRETCH_TYPE tx = STRETCH_SAMPLER_FNC(st + direction * f_sample);\n #ifdef STRETCH_WEIGHT\n tx *= STRETCH_WEIGHT; \n #endif\n color += tx;\n }\n return color / f_samples;\n}\n#endif\n'}},e={};function t(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return n[o](r,r.exports,t),r.exports}t.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return t.d(e,{a:e}),e},t.d=(n,e)=>{for(var o in e)t.o(e,o)&&!t.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:e[o]})},t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var o={};(()=>{t.d(o,{Z:()=>l});var n=t(4249),e=t.n(n),i=t(3886),r=t.n(i),s=t(4775),a=t.n(s),c=t(8249),f=t.n(c);const l={barrel:e(),chromaAB:r(),grain:a(),stretch:f()}})();var i=o.Z;export{i as default}; | ||
var n = { | ||
4249: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Squared length\nuse: lengthSq(<vec2|float2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LENGTHSQ\n#define FNC_LENGTHSQ\nfloat lengthSq(in vec2 st) {\n return dot(st, st);\n}\n\nfloat lengthSq(in vec3 pos) {\n return dot(pos, pos);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Barrel distortion\nuse: barrel(sampler2D tex, <vec2> st, [, <vec2|float> sdf])\noptions:\n BARREL_DISTANCE: function used to shape the distortion, defaults to radial shape with lengthSq\n BARREL_TYPE: return type, defaults to vec3\n BARREL_SAMPLER_FNC: function used to sample the input texture, defaults to texture2D(tex, POS_UV).rgb\n BARREL_OCT_1: one octave of distortion\n BARREL_OCT_2: two octaves of distortion\n BARREL_OCT_3: three octaves of distortion\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef BARREL_DISTANCE\n#define BARREL_DISTANCE dist\n#endif\n\n#ifndef BARREL_TYPE\n#define BARREL_TYPE vec3\n#endif\n\n#ifndef BARREL_SAMPLER_FNC\n#define BARREL_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV).rgb\n#endif\n\n#ifndef FNC_BARREL\n#define FNC_BARREL\nvec2 barrel(vec2 st, float amt, float dist) {\n return st + (st-.5) * (BARREL_DISTANCE) * amt;\n}\n\nvec2 barrel(vec2 st, float amt) {\n return barrel(st, amt, lengthSq(st-.5));\n}\n\nBARREL_TYPE barrel(in sampler2D tex, in vec2 st, float offset) {\n BARREL_TYPE a1 = BARREL_SAMPLER_FNC( barrel(st, .0, offset));\n BARREL_TYPE a2 = BARREL_SAMPLER_FNC( barrel(st, .2, offset));\n BARREL_TYPE a3 = BARREL_SAMPLER_FNC( barrel(st, .4, offset));\n BARREL_TYPE a4 = BARREL_SAMPLER_FNC( barrel(st, .6, offset));\n#ifdef BARREL_OCT_1\n return (a1+a2+a3+a4)/4.;\n#endif\n BARREL_TYPE a5 = BARREL_SAMPLER_FNC( barrel(st, .8, offset));\n BARREL_TYPE a6 = BARREL_SAMPLER_FNC( barrel(st, 1.0, offset));\n BARREL_TYPE a7 = BARREL_SAMPLER_FNC( barrel(st, 1.2, offset));\n BARREL_TYPE a8 = BARREL_SAMPLER_FNC( barrel(st, 1.4, offset));\n#ifdef BARREL_OCT_2\n return (a1+a2+a3+a4+a5+a6+a7+a8)/8.;\n#endif\n BARREL_TYPE a9 = BARREL_SAMPLER_FNC( barrel(st, 1.6, offset));\n BARREL_TYPE a10 = BARREL_SAMPLER_FNC( barrel(st, 1.8, offset));\n BARREL_TYPE a11 = BARREL_SAMPLER_FNC( barrel(st, 2.0, offset));\n BARREL_TYPE a12 = BARREL_SAMPLER_FNC( barrel(st, 2.2, offset));\n return (a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12)/12.;\n}\n\nBARREL_TYPE barrel(in sampler2D tex, in vec2 st, in vec2 offset) {\n return barrel(tex, st, dot(vec2(.5), offset));\n}\n\nBARREL_TYPE barrel(in sampler2D tex, in vec2 st) {\n return barrel(tex, st, lengthSq(st-.5));\n}\n\n#endif\n' | ||
}, | ||
3886: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Squared length\nuse: lengthSq(<vec2|float2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LENGTHSQ\n#define FNC_LENGTHSQ\nfloat lengthSq(in vec2 st) {\n return dot(st, st);\n}\n\nfloat lengthSq(in vec3 pos) {\n return dot(pos, pos);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo, Johan Ismael\ndescription: Chroma Aberration inspired by https://www.shadertoy.com/view/4sX3z4\nuse: chromaAB(<sampler2D> texture, <vec2> st [, <float|vec2> sdf|offset, <float> pct])\noptions:\n CHROMAAB_TYPE: return type, defauls to vec3\n CHROMAAB_PCT: amount of aberration, defaults to 1.5\n CHROMAAB_SAMPLER_FNC: function used to sample the input texture, defaults to texture2D(tex, POS_UV)\n CHROMAAB_CENTER_BUFFER: scalar to attenuate the sdf passed in \nlicense: |\n Copyright (c) 2021 Patricio Gonzalez Vivo and Johan Ismael\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef CHROMAAB_PCT\n#define CHROMAAB_PCT 1.5\n#endif\n\n#ifndef CHROMAAB_TYPE\n#define CHROMAAB_TYPE vec3\n#endif\n\n#ifndef CHROMAAB_SAMPLER_FNC\n#define CHROMAAB_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_CHROMAAB\n#define FNC_CHROMAAB\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in vec2 direction, in vec3 distortion ) {\n vec2 offset = vec2(0.0);\n CHROMAAB_TYPE c = CHROMAAB_TYPE(1.);\n c.r = CHROMAAB_SAMPLER_FNC(st + direction * distortion.r).r;\n c.g = CHROMAAB_SAMPLER_FNC(st + direction * distortion.g).g;\n c.b = CHROMAAB_SAMPLER_FNC(st + direction * distortion.b).b;\n return c;\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in vec2 offset, in float pct) {\n\n #ifdef CHROMAAB_CENTER_BUFFER\n // modify the distance from the center, so that only the edges are affected\n offset = max(offset - CHROMAAB_CENTER_BUFFER, 0.);\n #endif\n\n // Distort the UVs\n vec2 stR = st * (1.0 + offset * 0.02 * pct),\n stB = st * (1.0 - offset * 0.02 * pct);\n\n // Get the individual channels using the modified UVs\n CHROMAAB_TYPE c = CHROMAAB_TYPE(1.);\n c.r = CHROMAAB_SAMPLER_FNC(stR).r;\n c.g = CHROMAAB_SAMPLER_FNC(st).g;\n c.b = CHROMAAB_SAMPLER_FNC(stB).b;\n return c;\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in float sdf, in float pct) {\n return chromaAB(tex, st, vec2(sdf), pct);\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in float sdf) {\n return chromaAB(tex, st, sdf, CHROMAAB_PCT);\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in vec2 offset) {\n return chromaAB(tex, st, offset, CHROMAAB_PCT);\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st) {\n return chromaAB(tex, st, lengthSq(st - .5), CHROMAAB_PCT);\n}\n\n#endif\n' | ||
}, | ||
4775: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: grad4, used for snoise(vec4 v)\nuse: grad4(<float> j, <vec4> ip)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_GRAD4\n#define FNC_GRAD4\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Simplex Noise https://github.com/ashima/webgl-noise\nuse: snoise(<vec2|vec3|vec4> pos)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n*/\n\n#ifndef FNC_SNOISE\n#define FNC_SNOISE\nfloat snoise(in vec2 v) {\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0\n //i1.y = 1.0 - i1.x;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n // x0 = x0 - 0.0 + 0.0 * C.xx ;\n // x1 = x0 - i1 + 1.0 * C.xx ;\n // x2 = x0 - 1.0 + 2.0 * C.xx ;\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\n\nfloat snoise(in vec3 v) {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n // Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients: 7x7 points over a square, mapped onto an octahedron.\n // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n //Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}\n\nfloat snoise(in vec4 v) {\n const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\n 0.276393202250021, // 2 * G4\n 0.414589803375032, // 3 * G4\n -0.447213595499958); // -1 + 4 * G4\n\n // First corner\n vec4 i = floor(v + dot(v, vec4(.309016994374947451)) ); // (sqrt(5) - 1)/4\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxxx\n // x1 = x0 - i1 + 1.0 * C.xxxx\n // x2 = x0 - i2 + 2.0 * C.xxxx\n // x3 = x0 - i3 + 3.0 * C.xxxx\n // x4 = x0 - 1.0 + 4.0 * C.xxxx\n vec4 x1 = x0 - i1 + C.xxxx;\n vec4 x2 = x0 - i2 + C.yyyy;\n vec4 x3 = x0 - i3 + C.zzzz;\n vec4 x4 = x0 + C.wwww;\n\n // Permutations\n i = mod289(i);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n}\n\nvec3 snoise3( vec3 x ){\n float s = snoise(vec3( x ));\n float s1 = snoise(vec3( x.y - 19.1 , x.z + 33.4 , x.x + 47.2 ));\n float s2 = snoise(vec3( x.z + 74.2 , x.x - 124.5 , x.y + 99.4 ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\nvec3 snoise3( vec4 x ){\n float s = snoise(vec4( x ));\n float s1 = snoise(vec4( x.y - 19.1 , x.z + 33.4 , x.x + 47.2, x.w ));\n float s2 = snoise(vec4( x.z + 74.2 , x.x - 124.5 , x.y + 99.4, x.w ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: fade\nuse: fade(<vec2|vec3|vec4> t)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_FADE\n#define FNC_FADE\nfloat fade(in float t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec2 fade(in vec2 t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec3 fade(in vec3 t) {\n return t * t * t * (t * (t * 6. - 15. ) + 10.);\n}\n\nvec4 fade(vec4 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Classic Perlin Noise with periodic variant https://github.com/ashima/webgl-noise\nuse: pnoise(<vec2|vec3|vec4> pos, <vec2|vec3|vec4> periodic)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n*/\n\n#ifndef FNC_PNOISE\n#define FNC_PNOISE\n// Classic Perlin noise, periodic variant\nfloat pnoise(in vec2 P, in vec2 rep) {\n vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0);\n vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0);\n Pi = mod(Pi, rep.xyxy); // To create noise with explicit period\n Pi = mod289(Pi); // To avoid truncation effects in permutation\n vec4 ix = Pi.xzxz;\n vec4 iy = Pi.yyww;\n vec4 fx = Pf.xzxz;\n vec4 fy = Pf.yyww;\n\n vec4 i = permute(permute(ix) + iy);\n\n vec4 gx = fract(i * (1.0 / 41.0)) * 2.0 - 1.0 ;\n vec4 gy = abs(gx) - 0.5 ;\n vec4 tx = floor(gx + 0.5);\n gx = gx - tx;\n\n vec2 g00 = vec2(gx.x,gy.x);\n vec2 g10 = vec2(gx.y,gy.y);\n vec2 g01 = vec2(gx.z,gy.z);\n vec2 g11 = vec2(gx.w,gy.w);\n\n vec4 norm = taylorInvSqrt(vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)));\n g00 *= norm.x;\n g01 *= norm.y;\n g10 *= norm.z;\n g11 *= norm.w;\n\n float n00 = dot(g00, vec2(fx.x, fy.x));\n float n10 = dot(g10, vec2(fx.y, fy.y));\n float n01 = dot(g01, vec2(fx.z, fy.z));\n float n11 = dot(g11, vec2(fx.w, fy.w));\n\n vec2 fade_xy = fade(Pf.xy);\n vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x);\n float n_xy = mix(n_x.x, n_x.y, fade_xy.y);\n return 2.3 * n_xy;\n}\n\nfloat pnoise(in vec3 P, in vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nfloat pnoise(in vec4 P, in vec4 rep) {\n vec4 Pi0 = mod(floor(P), rep); // Integer part modulo rep\n vec4 Pi1 = mod(Pi0 + 1.0, rep); // Integer part + 1 mod rep\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec4 Pf0 = fract(P); // Fractional part for interpolation\n vec4 Pf1 = Pf0 - 1.0; // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = vec4(Pi0.zzzz);\n vec4 iz1 = vec4(Pi1.zzzz);\n vec4 iw0 = vec4(Pi0.wwww);\n vec4 iw1 = vec4(Pi1.wwww);\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 ixy00 = permute(ixy0 + iw0);\n vec4 ixy01 = permute(ixy0 + iw1);\n vec4 ixy10 = permute(ixy1 + iw0);\n vec4 ixy11 = permute(ixy1 + iw1);\n\n vec4 gx00 = ixy00 * (1.0 / 7.0);\n vec4 gy00 = floor(gx00) * (1.0 / 7.0);\n vec4 gz00 = floor(gy00) * (1.0 / 6.0);\n gx00 = fract(gx00) - 0.5;\n gy00 = fract(gy00) - 0.5;\n gz00 = fract(gz00) - 0.5;\n vec4 gw00 = vec4(0.75) - abs(gx00) - abs(gy00) - abs(gz00);\n vec4 sw00 = step(gw00, vec4(0.0));\n gx00 -= sw00 * (step(0.0, gx00) - 0.5);\n gy00 -= sw00 * (step(0.0, gy00) - 0.5);\n\n vec4 gx01 = ixy01 * (1.0 / 7.0);\n vec4 gy01 = floor(gx01) * (1.0 / 7.0);\n vec4 gz01 = floor(gy01) * (1.0 / 6.0);\n gx01 = fract(gx01) - 0.5;\n gy01 = fract(gy01) - 0.5;\n gz01 = fract(gz01) - 0.5;\n vec4 gw01 = vec4(0.75) - abs(gx01) - abs(gy01) - abs(gz01);\n vec4 sw01 = step(gw01, vec4(0.0));\n gx01 -= sw01 * (step(0.0, gx01) - 0.5);\n gy01 -= sw01 * (step(0.0, gy01) - 0.5);\n\n vec4 gx10 = ixy10 * (1.0 / 7.0);\n vec4 gy10 = floor(gx10) * (1.0 / 7.0);\n vec4 gz10 = floor(gy10) * (1.0 / 6.0);\n gx10 = fract(gx10) - 0.5;\n gy10 = fract(gy10) - 0.5;\n gz10 = fract(gz10) - 0.5;\n vec4 gw10 = vec4(0.75) - abs(gx10) - abs(gy10) - abs(gz10);\n vec4 sw10 = step(gw10, vec4(0.0));\n gx10 -= sw10 * (step(0.0, gx10) - 0.5);\n gy10 -= sw10 * (step(0.0, gy10) - 0.5);\n\n vec4 gx11 = ixy11 * (1.0 / 7.0);\n vec4 gy11 = floor(gx11) * (1.0 / 7.0);\n vec4 gz11 = floor(gy11) * (1.0 / 6.0);\n gx11 = fract(gx11) - 0.5;\n gy11 = fract(gy11) - 0.5;\n gz11 = fract(gz11) - 0.5;\n vec4 gw11 = vec4(0.75) - abs(gx11) - abs(gy11) - abs(gz11);\n vec4 sw11 = step(gw11, vec4(0.0));\n gx11 -= sw11 * (step(0.0, gx11) - 0.5);\n gy11 -= sw11 * (step(0.0, gy11) - 0.5);\n\n vec4 g0000 = vec4(gx00.x,gy00.x,gz00.x,gw00.x);\n vec4 g1000 = vec4(gx00.y,gy00.y,gz00.y,gw00.y);\n vec4 g0100 = vec4(gx00.z,gy00.z,gz00.z,gw00.z);\n vec4 g1100 = vec4(gx00.w,gy00.w,gz00.w,gw00.w);\n vec4 g0010 = vec4(gx10.x,gy10.x,gz10.x,gw10.x);\n vec4 g1010 = vec4(gx10.y,gy10.y,gz10.y,gw10.y);\n vec4 g0110 = vec4(gx10.z,gy10.z,gz10.z,gw10.z);\n vec4 g1110 = vec4(gx10.w,gy10.w,gz10.w,gw10.w);\n vec4 g0001 = vec4(gx01.x,gy01.x,gz01.x,gw01.x);\n vec4 g1001 = vec4(gx01.y,gy01.y,gz01.y,gw01.y);\n vec4 g0101 = vec4(gx01.z,gy01.z,gz01.z,gw01.z);\n vec4 g1101 = vec4(gx01.w,gy01.w,gz01.w,gw01.w);\n vec4 g0011 = vec4(gx11.x,gy11.x,gz11.x,gw11.x);\n vec4 g1011 = vec4(gx11.y,gy11.y,gz11.y,gw11.y);\n vec4 g0111 = vec4(gx11.z,gy11.z,gz11.z,gw11.z);\n vec4 g1111 = vec4(gx11.w,gy11.w,gz11.w,gw11.w);\n\n vec4 norm00 = taylorInvSqrt(vec4(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100)));\n g0000 *= norm00.x;\n g0100 *= norm00.y;\n g1000 *= norm00.z;\n g1100 *= norm00.w;\n\n vec4 norm01 = taylorInvSqrt(vec4(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101)));\n g0001 *= norm01.x;\n g0101 *= norm01.y;\n g1001 *= norm01.z;\n g1101 *= norm01.w;\n\n vec4 norm10 = taylorInvSqrt(vec4(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110)));\n g0010 *= norm10.x;\n g0110 *= norm10.y;\n g1010 *= norm10.z;\n g1110 *= norm10.w;\n\n vec4 norm11 = taylorInvSqrt(vec4(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111)));\n g0011 *= norm11.x;\n g0111 *= norm11.y;\n g1011 *= norm11.z;\n g1111 *= norm11.w;\n\n float n0000 = dot(g0000, Pf0);\n float n1000 = dot(g1000, vec4(Pf1.x, Pf0.yzw));\n float n0100 = dot(g0100, vec4(Pf0.x, Pf1.y, Pf0.zw));\n float n1100 = dot(g1100, vec4(Pf1.xy, Pf0.zw));\n float n0010 = dot(g0010, vec4(Pf0.xy, Pf1.z, Pf0.w));\n float n1010 = dot(g1010, vec4(Pf1.x, Pf0.y, Pf1.z, Pf0.w));\n float n0110 = dot(g0110, vec4(Pf0.x, Pf1.yz, Pf0.w));\n float n1110 = dot(g1110, vec4(Pf1.xyz, Pf0.w));\n float n0001 = dot(g0001, vec4(Pf0.xyz, Pf1.w));\n float n1001 = dot(g1001, vec4(Pf1.x, Pf0.yz, Pf1.w));\n float n0101 = dot(g0101, vec4(Pf0.x, Pf1.y, Pf0.z, Pf1.w));\n float n1101 = dot(g1101, vec4(Pf1.xy, Pf0.z, Pf1.w));\n float n0011 = dot(g0011, vec4(Pf0.xy, Pf1.zw));\n float n1011 = dot(g1011, vec4(Pf1.x, Pf0.y, Pf1.zw));\n float n0111 = dot(g0111, vec4(Pf0.x, Pf1.yzw));\n float n1111 = dot(g1111, Pf1);\n\n vec4 fade_xyzw = fade(Pf0);\n vec4 n_0w = mix(vec4(n0000, n1000, n0100, n1100), vec4(n0001, n1001, n0101, n1101), fade_xyzw.w);\n vec4 n_1w = mix(vec4(n0010, n1010, n0110, n1110), vec4(n0011, n1011, n0111, n1111), fade_xyzw.w);\n vec4 n_zw = mix(n_0w, n_1w, fade_xyzw.z);\n vec2 n_yzw = mix(n_zw.xy, n_zw.zw, fade_xyzw.y);\n float n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x);\n return 2.2 * n_xyzw;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get\'s the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: rgb2luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_RGB2LUMA\n#define FNC_RGB2LUMA\nfloat rgb2luma(in vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\nfloat rgb2luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_LUMA\n#define FNC_LUMA\nfloat luma(float color) {\n return color;\n}\n\nfloat luma(in vec3 color) {\n return rgb2luma(color);\n}\n\nfloat luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n/*\nauthor: Jamie Owen\ndescription: Photoshop Soft Light blend mode mplementations sourced from this article on https://mouaif.wordpress.com/2009/01/05/photoshop-math-with-glsl-shaders/\nuse: blendSoftLight(<float|vec3> base, <float|vec3> blend [, <float> opacity])\nlicence: TODO\n*/\n\n#ifndef FNC_BLENDSOFTLIGHT\n#define FNC_BLENDSOFTLIGHT\nfloat blendSoftLight(in float base, in float blend) {\n return (blend < .5)? (2. * base * blend + base * base * (1. - 2.*blend)): (sqrt(base) * (2. * blend - 1.) + 2. * base * (1. - blend));\n}\n\nvec3 blendSoftLight(in vec3 base, in vec3 blend) {\n return vec3(blendSoftLight(base.r, blend.r),\n blendSoftLight(base.g, blend.g),\n blendSoftLight(base.b, blend.b));\n}\n\nvec4 blendSoftLight(in vec4 base, in vec4 blend) {\n return vec4(blendSoftLight( base.r, blend.r ),\n blendSoftLight( base.g, blend.g ),\n blendSoftLight( base.b, blend.b ),\n blendSoftLight( base.a, blend.a )\n );\n}\n\nvec3 blendSoftLight(in vec3 base, in vec3 blend, in float opacity) {\n return (blendSoftLight(base, blend) * opacity + base * (1. - opacity));\n}\n#endif\n\n\n/*\nauthor: Matt DesLauriers\ndescription: Natural looking film grain using 3D noise functions (original source: https://github.com/mattdesl/glsl-film-grain). Inspired by [Martins Upitis](http://devlog-martinsh.blogspot.com/2013/05/image-imperfections-and-film-grain-post.html).\nuse: \n - grain(<vec2> texCoord, <vec2> resolution [, <float> t, <float> multiplier])\n - grain(<sampler2D> texture, <vec2> texCoord, <float|vec2> resolution [, <float> t, <float> multiplier])\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Matt DesLauriers\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef GRAIN_TYPE\n#define GRAIN_TYPE vec3\n#endif\n\n#ifndef GRAIN_SAMPLER_FNC\n#define GRAIN_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV).rgb\n#endif\n\n#ifndef FNC_GRAIN\n#define FNC_GRAIN\nfloat grain(vec2 texCoord, vec2 resolution, float t, float multiplier) {\n vec2 mult = texCoord * resolution;\n float offset = snoise(vec3(mult / multiplier, t));\n float n1 = pnoise(vec3(mult, offset), vec3(1. / texCoord * resolution, 1.));\n return n1 / 2. + .5;\n}\n\nfloat grain(vec2 texCoord, vec2 resolution, float t) {\n return grain(texCoord, resolution, t, 2.5);\n}\n\nfloat grain(vec2 texCoord, vec2 resolution) {\n return grain(texCoord, resolution, 0.);\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, vec2 resolution, float t, float multiplier ) {\n GRAIN_TYPE org = GRAIN_SAMPLER_FNC(st);\n\n float g = grain(st, resolution, t, multiplier);\n\n //get the luminance of the background\n float luminance = luma(org);\n \n //reduce the noise based on some \n //threshold of the background luminance\n float response = smoothstep(0.05, 0.5, luminance);\n return mix( blendSoftLight(org, GRAIN_TYPE(g)), \n org, \n response * response);\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, vec2 resolution, float t ) {\n return grain(tex, st, resolution, t, 2.5 );\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, vec2 resolution) {\n return grain(tex, st, resolution, 0.);\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, float resolution, float t, float multiplier ) {\n return grain(tex, st, vec2(resolution), t, multiplier );\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, float resolution, float t ) {\n return grain(tex, st, resolution, t, 2.5 );\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, float resolution) {\n return grain(tex, st, resolution, 0.);\n}\n\n#endif' | ||
}, | ||
8249: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo, Johan Ismael\ndescription: Samples multiple times a texture in the specified direction\nuse: stretch(<sampler2D> tex, <vec2> st, <vec2> direction [, int samples])\noptions:\n STRETCH_SAMPLES: number of samples taken, defaults to 20\n STRETCH_TYPE: return type, defauls to vec4\n STRETCH_SAMPLER_FNC(POS_UV): function used to sample the input texture, defaults to texture2D(tex, POS_UV)\n STRETCH_WEIGHT: shaping equation to multiply the sample weight.\nlicense: |\n Copyright (c) 2021 Patricio Gonzalez Vivo and Johan Ismael\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOF\n*/\n\n#ifndef STRETCH_SAMPLES\n#define STRETCH_SAMPLES 20\n#endif\n\n#ifndef STRETCH_TYPE\n#define STRETCH_TYPE vec4\n#endif\n\n#ifndef STRETCH_SAMPLER_FNC\n#define STRETCH_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_STRETCH\n#define FNC_STRETCH\nSTRETCH_TYPE stretch(in sampler2D tex, in vec2 st, in vec2 direction, const int i_samples) {\n float f_samples = float(i_samples);\n STRETCH_TYPE color = STRETCH_TYPE(0.);\n\n #ifdef PLATFORM_WEBGL\n for (int i = 0; i < 50; i++) {\n if (i == i_samples) break;\n #else\n for (int i = 0; i < i_samples; i++) {\n #endif\n\n float f_sample = float(i);\n STRETCH_TYPE tx = STRETCH_SAMPLER_FNC(st + direction * f_sample);\n #ifdef STRETCH_WEIGHT\n tx *= STRETCH_WEIGHT;\n #endif\n color += tx;\n }\n return color / f_samples;\n}\n\nSTRETCH_TYPE stretch(in sampler2D tex, in vec2 st, in vec2 direction) {\n float f_samples = float(STRETCH_SAMPLES); \n STRETCH_TYPE color = STRETCH_TYPE(0.);\n for (int i = 0; i < STRETCH_SAMPLES; i++) {\n float f_sample = float(i); \n STRETCH_TYPE tx = STRETCH_SAMPLER_FNC(st + direction * f_sample);\n #ifdef STRETCH_WEIGHT\n tx *= STRETCH_WEIGHT; \n #endif\n color += tx;\n }\n return color / f_samples;\n}\n#endif\n' | ||
}, | ||
}, | ||
e = {} | ||
function t(o) { | ||
var i = e[o] | ||
if (void 0 !== i) return i.exports | ||
var r = (e[o] = { exports: {} }) | ||
return n[o](r, r.exports, t), r.exports | ||
} | ||
;(t.d = (n, e) => { | ||
for (var o in e) | ||
t.o(e, o) && | ||
!t.o(n, o) && | ||
Object.defineProperty(n, o, { enumerable: !0, get: e[o] }) | ||
}), | ||
(t.o = (n, e) => Object.prototype.hasOwnProperty.call(n, e)) | ||
var o = {} | ||
;(() => { | ||
t.d(o, { Z: () => n }) | ||
const n = { | ||
barrel: t(4249), | ||
chromaAB: t(3886), | ||
grain: t(4775), | ||
stretch: t(8249), | ||
} | ||
})() | ||
var i = o.Z | ||
export { i as default } |
@@ -1,1 +0,64 @@ | ||
var n={1995:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get\'s the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: rgb2luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_RGB2LUMA\n#define FNC_RGB2LUMA\nfloat rgb2luma(in vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\nfloat rgb2luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: TODO\nuse: bilateralBlur(<sampler2D> texture, <vec2> st, <vec2> duv)\noptions: TODO\nlicense: TODO\n*/\n\n#ifndef BILATERALBLUR_AMOUNT\n#define BILATERALBLUR_AMOUNT bilateralBlur13\n#endif\n\n#ifndef BILATERALBLUR_TYPE\n#define BILATERALBLUR_TYPE vec4\n#endif\n\n#ifndef BILATERALBLUR_SAMPLER_FNC\n#define BILATERALBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef BILATERALBLUR_LUMA\n#define BILATERALBLUR_LUMA(RGB) rgb2luma(RGB.rgb)\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get\'s the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: rgb2luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_RGB2LUMA\n#define FNC_RGB2LUMA\nfloat rgb2luma(in vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\nfloat rgb2luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: two dimensional bilateral Blur, to do it in one single pass\nuse: bilateralBlur2D(<sampler2D> texture, <vec2> st, <vec2> offset, <int> kernelSize)\noptions:\n BILATERALBLUR2D_TYPE: default is vec3\n BILATERALBLUR2D_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\n BILATERALBLUR2D_LUMA(RGB): default rgb2luma\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BILATERALBLUR2D_TYPE\n#define BILATERALBLUR2D_TYPE vec4\n#endif\n\n#ifndef BILATERALBLUR2D_SAMPLER_FNC\n#define BILATERALBLUR2D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef BILATERALBLUR2D_LUMA\n#define BILATERALBLUR2D_LUMA(RGB) rgb2luma(RGB.rgb)\n#endif\n\n#ifndef FNC_BILATERALBLUR2D\n#define FNC_BILATERALBLUR2D\nBILATERALBLUR2D_TYPE bilateralBlur2D(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n BILATERALBLUR2D_TYPE accumColor = BILATERALBLUR2D_TYPE(0.);\n #ifndef BILATERALBLUR2D_KERNELSIZE\n #define BILATERALBLUR2D_KERNELSIZE kernelSize\n #endif\n float accumWeight = 0.;\n const float k = .15915494; // 1. / (2.*PI)\n const float k2 = k * k;\n float kernelSize2 = float(BILATERALBLUR2D_KERNELSIZE) * float(BILATERALBLUR2D_KERNELSIZE);\n BILATERALBLUR2D_TYPE tex0 = BILATERALBLUR2D_SAMPLER_FNC(st);\n float lum0 = BILATERALBLUR2D_LUMA(tex0);\n\n for (int j = 0; j < BILATERALBLUR2D_KERNELSIZE; j++) {\n float dy = -.5 * (float(BILATERALBLUR2D_KERNELSIZE) - 1.0) + float(j);\n for (int i = 0; i < BILATERALBLUR2D_KERNELSIZE; i++) {\n float dx = -.5 * (float(BILATERALBLUR2D_KERNELSIZE) - 1.0) + float(i);\n BILATERALBLUR2D_TYPE tex = BILATERALBLUR2D_SAMPLER_FNC(st + vec2(dx, dy) * offset);\n float lum = BILATERALBLUR2D_LUMA(tex);\n float dl = 255. * (lum - lum0);\n float weight = (k2 / kernelSize2) * exp(-(dx * dx + dy * dy + dl * dl) / (2. * kernelSize2));\n accumColor += weight * tex;\n accumWeight += weight;\n }\n }\n return accumColor / accumWeight;\n}\n#endif\n\n\n#ifndef FNC_BILATERALFILTER\n#define FNC_BILATERALFILTER\nBILATERALBLUR_TYPE bilateralBlur(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n return bilateralBlur2D(tex, st, offset, kernelSize);\n}\n\nBILATERALBLUR_TYPE bilateralBlur13(in sampler2D tex, in vec2 st, in vec2 offset) {\n return bilateralBlur(tex, st, offset, 7);\n}\n\nBILATERALBLUR_TYPE bilateralBlur9(in sampler2D tex, in vec2 st, in vec2 offset) {\n return bilateralBlur(tex, st, offset, 5);\n}\n\nBILATERALBLUR_TYPE bilateralBlur5(in sampler2D tex, in vec2 st, in vec2 offset) {\n return bilateralBlur(tex, st, offset, 3);\n}\n\nBILATERALBLUR_TYPE bilateralBlur(in sampler2D tex, in vec2 st, in vec2 offset) {\n return BILATERALBLUR_AMOUNT(tex, st, offset);\n}\n#endif\n'},4207:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: given a texture return a simple box blured pixel\nuse: boxBlur(<sampler2D> texture, <vec2> st, <vec2> pixel_offset)\noptions:\n BOXBLUR_2D: default to 1D\n BOXBLUR_ITERATIONS: default 3\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BOXBLUR_ITERATIONS\n#define BOXBLUR_ITERATIONS 3\n#endif\n\n#ifndef BOXBLUR_TYPE\n#define BOXBLUR_TYPE vec4\n#endif\n\n#ifndef BOXBLUR_SAMPLER_FNC\n#define BOXBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: simple one dimentional box blur, to be applied in two passes\nuse: boxBlur1D(<sampler2D> texture, <vec2> st, <vec2> pixel_offset, <int> kernelSize)\noptions:\n BOXBLUR1D_TYPE: default is vec4\n BOXBLUR1D_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\n BOXBLUR1D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n#ifndef BOXBLUR1D_TYPE\n#define BOXBLUR1D_TYPE vec4\n#endif\n\n#ifndef BOXBLUR1D_SAMPLER_FNC\n#define BOXBLUR1D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_BOXBLUR1D\n#define FNC_BOXBLUR1D\nBOXBLUR1D_TYPE boxBlur1D(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n BOXBLUR1D_TYPE color = BOXBLUR1D_TYPE(0.);\n #ifndef BOXBLUR1D_KERNELSIZE\n #define BOXBLUR1D_KERNELSIZE kernelSize\n #endif\n\n float f_kernelSize = float(BOXBLUR1D_KERNELSIZE);\n float weight = 1. / f_kernelSize;\n\n for (int i = 0; i < BOXBLUR1D_KERNELSIZE; i++) {\n float x = -.5 * (f_kernelSize - 1.) + float(i);\n color += BOXBLUR1D_SAMPLER_FNC(st + offset * x ) * weight;\n }\n return color;\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: simple two dimentional box blur, so can be apply in a single pass\nuse: boxBlur2D(<sampler2D> texture, <vec2> st, <vec2> pixel_offset, <int> kernelSize)\noptions:\n BOXBLUR2D_TYPE: Default `vec4`\n BOXBLUR2D_SAMPLER_FNC(POS_UV): default is `texture2D(tex, POS_UV)`\n BOXBLUR2D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BOXBLUR2D_TYPE\n#define BOXBLUR2D_TYPE vec4\n#endif\n\n#ifndef BOXBLUR2D_SAMPLER_FNC\n#define BOXBLUR2D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_BOXBLUR2D\n#define FNC_BOXBLUR2D\nBOXBLUR2D_TYPE boxBlur2D(in sampler2D tex, in vec2 st, in vec2 pixel, const int kernelSize) {\n BOXBLUR2D_TYPE color = BOXBLUR2D_TYPE(0.);\n #ifndef BOXBLUR2D_KERNELSIZE\n #define BOXBLUR2D_KERNELSIZE kernelSize\n #endif\n\n float accumWeight = 0.;\n float f_kernelSize = float(BOXBLUR2D_KERNELSIZE);\n float kernelSize2 = f_kernelSize * f_kernelSize;\n float weight = 1. / kernelSize2;\n\n for (int j = 0; j < BOXBLUR2D_KERNELSIZE; j++) {\n float y = -.5 * (f_kernelSize - 1.) + float(j);\n for (int i = 0; i < BOXBLUR2D_KERNELSIZE; i++) {\n float x = -.5 * (f_kernelSize - 1.) + float(i);\n color += BOXBLUR2D_SAMPLER_FNC(st + vec2(x, y) * pixel) * weight;\n }\n }\n return color;\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: simple two dimentional box blur, so can be apply in a single pass\nuse: boxBlur1D_fast9(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n BOXBLUR2D_FAST9_TYPE: Default is `vec4`\n BOXBLUR2D_FAST9_SAMPLER_FNC(POS_UV): Default is `texture2D(tex, POS_UV)`\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BOXBLUR2D_FAST9_TYPE\n#define BOXBLUR2D_FAST9_TYPE vec4\n#endif\n\n#ifndef BOXBLUR2D_FAST9_SAMPLER_FNC\n#define BOXBLUR2D_FAST9_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_BOXBLUR2D_FAST9\n#define FNC_BOXBLUR2D_FAST9\nBOXBLUR2D_FAST9_TYPE boxBlur2D_fast9(in sampler2D tex, in vec2 st, in vec2 offset) {\n BOXBLUR2D_FAST9_TYPE color = BOXBLUR2D_FAST9_SAMPLER_FNC(st); // center\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(-offset.x, offset.y)); // tleft\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(-offset.x, 0.)); // left\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(-offset.x, -offset.y)); // bleft\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(0., offset.y)); // top\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(0., -offset.y)); // bottom\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + offset); // tright\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(offset.x, 0.)); // right\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(offset.x, -offset.y)); // bright\n return color * 0.1111111111; // 1./9.\n}\n#endif\n\n\n#ifndef FNC_BOXBLUR\n#define FNC_BOXBLUR\nBOXBLUR_TYPE boxBlur13(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, 7);\n#else\n return boxBlur1D(tex, st, offset, 7);\n#endif\n}\n\nBOXBLUR_TYPE boxBlur9(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef BOXBLUR_2D\n return boxBlur2D_fast9(tex, st, offset);\n#else\n return boxBlur1D(tex, st, offset, 5);\n#endif\n}\n\nBOXBLUR_TYPE boxBlur5(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, 3);\n#else\n return boxBlur1D(tex, st, offset, 3);\n#endif\n}\n\nvec4 boxBlur(in sampler2D tex, in vec2 st, vec2 offset, const int kernelSize) {\n#ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, kernelSize);\n#else\n return boxBlur1D(tex, st, offset, kernelSize);\n#endif\n}\n\nvec4 boxBlur(in sampler2D tex, in vec2 st, vec2 offset) {\n #ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, BOXBLUR_ITERATIONS);\n #else\n return boxBlur1D(tex, st, offset, BOXBLUR_ITERATIONS);\n #endif\n}\n#endif\n'},548:n=>{n.exports='/*\nauthor: [Matt DesLauriers, Patricio Gonzalez Vivo]\ndescription: adapted versions from 5, 9 and 13 gaussian fast blur from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur(<sampler2D> texture, <vec2> st, <vec2> pixel_direction [, const int kernelSize])\noptions:\n GAUSSIANBLUR_AMOUNT: gaussianBlur5 gaussianBlur9 gaussianBlur13 \n GAUSSIANBLUR_2D: default to 1D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n#ifndef GAUSSIANBLUR_AMOUNT\n#define GAUSSIANBLUR_AMOUNT gaussianBlur13\n#endif\n\n#ifndef GAUSSIANBLUR_TYPE\n#define GAUSSIANBLUR_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR_SAMPLER_FNC\n#define GAUSSIANBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: two dimension Gaussian Blur to be applied in only one passes\nuse: gaussianBlur2D(<sampler2D> texture, <vec2> st, <vec2> pixel_direction , const int kernelSize)\noptions:\n GAUSSIANBLUR2D_TYPE: Default `vec4`\n GAUSSIANBLUR2D_SAMPLER_FNC(POS_UV): Default `texture2D(tex, POS_UV)`\n GAUSSIANBLUR2D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n#ifndef GAUSSIANBLUR2D_TYPE\n#define GAUSSIANBLUR2D_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR2D_SAMPLER_FNC\n#define GAUSSIANBLUR2D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR2D\n#define FNC_GAUSSIANBLUR2D\nGAUSSIANBLUR2D_TYPE gaussianBlur2D(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n GAUSSIANBLUR2D_TYPE accumColor = GAUSSIANBLUR2D_TYPE(0.);\n #ifndef GAUSSIANBLUR2D_KERNELSIZE\n #define GAUSSIANBLUR2D_KERNELSIZE kernelSize\n #endif\n\n float accumWeight = 0.;\n const float k = .15915494; // 1 / (2*PI)\n float kernelSize2 = float(GAUSSIANBLUR2D_KERNELSIZE) * float(GAUSSIANBLUR2D_KERNELSIZE);\n\n for (int j = 0; j < GAUSSIANBLUR2D_KERNELSIZE; j++) {\n float y = -.5 * (float(GAUSSIANBLUR2D_KERNELSIZE) - 1.) + float(j);\n for (int i = 0; i < GAUSSIANBLUR2D_KERNELSIZE; i++) {\n float x = -.5 * (float(GAUSSIANBLUR2D_KERNELSIZE) - 1.) + float(i);\n float weight = (k / float(GAUSSIANBLUR2D_KERNELSIZE)) * exp(-(x * x + y * y) / (2. * kernelSize2));\n GAUSSIANBLUR2D_TYPE tex = GAUSSIANBLUR2D_SAMPLER_FNC(st + vec2(x, y) * offset);\n accumColor += weight * tex;\n accumWeight += weight;\n }\n }\n return accumColor / accumWeight;\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: one dimension Gaussian Blur to be applied in two passes\nuse: gaussianBlur1D(<sampler2D> texture, <vec2> st, <vec2> pixel_direction , const int kernelSize)\noptions:\n GAUSSIANBLUR1D_TYPE:\n GAUSSIANBLUR1D_SAMPLER_FNC(POS_UV):\n GAUSSIANBLUR1D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef GAUSSIANBLUR1D_TYPE\n#define GAUSSIANBLUR1D_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_SAMPLER_FNC\n#define GAUSSIANBLUR1D_SAMPLER_FNC(POS_UV)texture2D(tex,POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D\n#define FNC_GAUSSIANBLUR1D\n\n#ifdef GAUSSIANBLUR1D_DYNAMIC\n\nGAUSSIANBLUR1D_TYPE gaussianBlur1D(in sampler2D tex,in vec2 st,in vec2 offset,const int kernelSize){\n GAUSSIANBLUR1D_TYPE accumColor = GAUSSIANBLUR1D_TYPE(0.0);\n \n float accumWeight = 0.0;\n const float k = 0.39894228;// 1 / sqrt(2*PI)\n float kernelSize2 = float(kernelSize)*float(kernelSize);\n for(int i = 0; i < 16; i++){\n if( i >= kernelSize)\n break;\n float x = -0.5 * (float(kernelSize) - 1.0)+float(i);\n float weight = (k/float(kernelSize)) * exp(-(x*x)/(2.0*kernelSize2));\n GAUSSIANBLUR1D_TYPE tex = GAUSSIANBLUR1D_SAMPLER_FNC(st + x * offset);\n accumColor += weight * tex;\n accumWeight += weight;\n }\n return accumColor/accumWeight;\n}\n\n#else\nGAUSSIANBLUR1D_TYPE gaussianBlur1D(in sampler2D tex,in vec2 st,in vec2 offset,const int kernelSize){\n GAUSSIANBLUR1D_TYPE accumColor=GAUSSIANBLUR1D_TYPE(0.);\n #ifndef GAUSSIANBLUR1D_KERNELSIZE\n #define GAUSSIANBLUR1D_KERNELSIZE kernelSize\n #endif\n \n float accumWeight = 0.0;\n const float k = 0.39894228;// 1 / sqrt(2*PI)\n float kernelSize2=float(GAUSSIANBLUR1D_KERNELSIZE)*float(GAUSSIANBLUR1D_KERNELSIZE);\n for(int i = 0; i < GAUSSIANBLUR1D_KERNELSIZE; i++){\n float x = -0.5 * (float(GAUSSIANBLUR1D_KERNELSIZE) -1.0) + float(i);\n float weight = (k/float(GAUSSIANBLUR1D_KERNELSIZE)) * exp(-(x*x)/(2.0*kernelSize2));\n GAUSSIANBLUR1D_TYPE tex = GAUSSIANBLUR1D_SAMPLER_FNC(st + x * offset);\n accumColor += weight * tex;\n accumWeight += weight;\n }\n return accumColor/accumWeight;\n}\n#endif\n\n#endif\n\n/*\nfunction: gaussianBlur1D_fast13\nauthor: Matt DesLauriers\ndescription: adapted versions of gaussian fast blur 13 from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur1D_fast13(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n GAUSSIANBLUR1D_FAST13_TYPE\n GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(POS_UV)\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Jam3\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n#ifndef GAUSSIANBLUR1D_FAST13_TYPE\n#define GAUSSIANBLUR1D_FAST13_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_FAST13_SAMPLER_FNC\n#define GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D_FAST13\n#define FNC_GAUSSIANBLUR1D_FAST13\nGAUSSIANBLUR1D_FAST13_TYPE gaussianBlur1D_fast13(in sampler2D tex, in vec2 st, in vec2 offset) {\n GAUSSIANBLUR1D_FAST13_TYPE color = GAUSSIANBLUR1D_FAST13_TYPE(0.);\n vec2 off1 = vec2(1.411764705882353) * offset;\n vec2 off2 = vec2(3.2941176470588234) * offset;\n vec2 off3 = vec2(5.176470588235294) * offset;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st) * .1964825501511404;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st + (off1)) * .2969069646728344;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st - (off1)) * .2969069646728344;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st + (off2)) * .09447039785044732;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st - (off2)) * .09447039785044732;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st + (off3)) * .010381362401148057;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st - (off3)) * .010381362401148057;\n return color;\n}\n#endif\n\n/*\nauthor: Matt DesLauriers\ndescription: adapted versions of gaussian fast blur 13 from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur1D_fast9(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n GAUSSIANBLUR1D_FAST9_TYPE\n GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(POS_UV)\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Jam3\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n#ifndef GAUSSIANBLUR1D_FAST9_TYPE\n#define GAUSSIANBLUR1D_FAST9_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_FAST9_SAMPLER_FNC\n#define GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D_FAST9\n#define FNC_GAUSSIANBLUR1D_FAST9\nGAUSSIANBLUR1D_FAST9_TYPE gaussianBlur1D_fast9(in sampler2D tex, in vec2 st, in vec2 offset) {\n GAUSSIANBLUR1D_FAST9_TYPE color = GAUSSIANBLUR1D_FAST9_TYPE(0.);\n vec2 off1 = vec2(1.3846153846) * offset;\n vec2 off2 = vec2(3.2307692308) * offset;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st) * .2270270270;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st + (off1)) * .3162162162;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st - (off1)) * .3162162162;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st + (off2)) * .0702702703;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st - (off2)) * .0702702703;\n return color;\n}\n#endif\n\n/*\nauthor: Matt DesLauriers\ndescription: adapted versions of gaussian fast blur 13 from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur1D_fast5(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n GAUSSIANBLUR1D_FAST5_TYPE\n GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(POS_UV)\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Jam3\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef GAUSSIANBLUR1D_FAST5_TYPE\n#define GAUSSIANBLUR1D_FAST5_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_FAST5_SAMPLER_FNC\n#define GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D_FAST5\n#define FNC_GAUSSIANBLUR1D_FAST5\nGAUSSIANBLUR1D_FAST5_TYPE gaussianBlur1D_fast5(in sampler2D tex, in vec2 st, in vec2 offset) {\n GAUSSIANBLUR1D_FAST5_TYPE color = GAUSSIANBLUR1D_FAST5_TYPE(0.);\n vec2 off1 = vec2(1.3333333333333333) * offset;\n color += GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(st) * .29411764705882354;\n color += GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(st + (off1)) * .35294117647058826;\n color += GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(st - (off1)) * .35294117647058826;\n return color;\n}\n#endif\n\n\n#ifndef FNC_GAUSSIANBLUR\n#define FNC_GAUSSIANBLUR\nGAUSSIANBLUR_TYPE gaussianBlur13(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, 7);\n#else\n return gaussianBlur1D_fast13(tex, st, offset);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur9(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, 5);\n#else\n return gaussianBlur1D_fast9(tex, st, offset);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur5(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, 3);\n#else\n return gaussianBlur1D_fast5(tex, st, offset);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, kernelSize);\n#else\n return gaussianBlur1D(tex, st, offset, kernelSize);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur(in sampler2D tex, in vec2 st, in vec2 offset) {\n return GAUSSIANBLUR_AMOUNT(tex, st, offset);\n}\n#endif\n'},5551:n=>{n.exports='/*\nauthor: Brad Larson\ndescription: Kuwahara image abstraction, drawn from the work of Kyprianidis, et. al. in their publication "Anisotropic Kuwahara Filtering on the GPU" within the GPU Pro collection. This produces an oil-painting-like image, but it is extremely computationally expensive, so it can take seconds to render a frame on an iPad 2. This might be best used for still images.\nuse: kuwahara(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n KUWAHARA_TYPE: defaults to vec3\n KUWAHARA_SAMPLER_FNC(POS_UV): defaults to texture2D(tex, POS_UV).rgb\n KUWAHARA_RADIUS radius\nlicence:\n Copyright (c) 2012, Brad Larson, Ben Cochran, Hugues Lismonde, Keitaroh Kobayashi, Alaric Cole, Matthew Clark, Jacob Gundersen, Chris Williams.\n All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef KUWAHARA_TYPE\n#define KUWAHARA_TYPE vec3\n#endif\n\n#ifndef KUWAHARA_SAMPLER_FNC\n#define KUWAHARA_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV).rgb\n#endif\n\n#ifndef KUWAHARA_RADIUS\n#define KUWAHARA_RADIUS radius\n#endif\n\n#ifndef FNC_KUWAHARA\n#define FNC_KUWAHARA\n\n#ifdef TARGET_MOBILE\nKUWAHARA_TYPE kuwahara(in sampler2D tex, in vec2 st, in vec2 pixel, in int radius) {\n float n = float((KUWAHARA_RADIUS + 1) * (KUWAHARA_RADIUS + 1));\n int i; int j;\n KUWAHARA_TYPE m0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE s0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE rta = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE c;\n\n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m0 += c;\n s0 += c * c;\n }\n }\n\n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m1 += c;\n s1 += c * c;\n }\n }\n\n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m2 += c;\n s2 += c * c;\n }\n }\n\n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m3 += c;\n s3 += c * c;\n }\n }\n\n float min_sigma2 = 1e+2;\n m0 /= n;\n s0 = abs(s0 / n - m0 * m0);\n\n float sigma2 = s0.r + s0.g + s0.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m0;\n }\n\n m1 /= n;\n s1 = abs(s1 / n - m1 * m1);\n\n sigma2 = s1.r + s1.g + s1.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m1;\n }\n\n m2 /= n;\n s2 = abs(s2 / n - m2 * m2);\n\n sigma2 = s2.r + s2.g + s2.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m2;\n }\n\n m3 /= n;\n s3 = abs(s3 / n - m3 * m3);\n\n sigma2 = s3.r + s3.g + s3.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m3;\n }\n\n return rta;\n}\n#else\n\nKUWAHARA_TYPE kuwahara(in sampler2D tex, in vec2 st, in vec2 pixel, in int radius) {\n\n float n = float((KUWAHARA_RADIUS + 1) * (KUWAHARA_RADIUS + 1));\n int i; int j;\n KUWAHARA_TYPE m0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE s0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE rta = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE c;\n \n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m0 += c;\n s0 += c * c;\n }\n }\n \n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m1 += c;\n s1 += c * c;\n }\n }\n \n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m2 += c;\n s2 += c * c;\n }\n }\n \n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m3 += c;\n s3 += c * c;\n }\n }\n \n \n float min_sigma2 = 1e+2;\n m0 /= n;\n s0 = abs(s0 / n - m0 * m0);\n \n float sigma2 = s0.r + s0.g + s0.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m0;\n }\n \n m1 /= n;\n s1 = abs(s1 / n - m1 * m1);\n \n sigma2 = s1.r + s1.g + s1.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m1;\n }\n \n m2 /= n;\n s2 = abs(s2 / n - m2 * m2);\n \n sigma2 = s2.r + s2.g + s2.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m2;\n }\n \n m3 /= n;\n s3 = abs(s3 / n - m3 * m3);\n \n sigma2 = s3.r + s3.g + s3.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m3;\n }\n\n return rta;\n}\n\n#endif\n\n#endif'},7030:n=>{n.exports='/*\nauthor: Brad Larson\ndescription: adapted version of mean average sampling on four coorners of a sampled point from https://github.com/BradLarson/GPUImage2\nuse: mean(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEAN_TYPE: defaults to vec4\n AVERAGE_SAMPLER_FNC(POS_UV): defaults to texture2D(tex,POS_UV)\nlicence:\n Copyright (c) 2015, Brad Larson. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef MEAN_TYPE\n#define MEAN_TYPE vec4\n#endif\n\n#ifndef MEAN_AMOUNT\n#define MEAN_AMOUNT mean4\n#endif\n\n#ifndef MEAN_SAMPLER_FNC\n#define MEAN_SAMPLER_FNC(POS_UV) texture2D(tex,POS_UV)\n#endif\n\n#ifndef FNC_AVERAGE\n#define FNC_AVERAGE\nMEAN_TYPE mean4(in sampler2D tex, in vec2 st, in vec2 pixel) {\n MEAN_TYPE topLeft = MEAN_SAMPLER_FNC(st - pixel);\n MEAN_TYPE bottomLeft = MEAN_SAMPLER_FNC(st + vec2(-pixel.x, pixel.y));\n MEAN_TYPE topRight = MEAN_SAMPLER_FNC(st + vec2(pixel.x, -pixel.y));\n MEAN_TYPE bottomRight = MEAN_SAMPLER_FNC(st + pixel);\n return 0.25 * (topLeft + topRight + bottomLeft + bottomRight);\n}\n\nMEAN_TYPE mean(in sampler2D tex, in vec2 st, in vec2 pixel) {\n return MEAN_AMOUNT(tex, st, pixel);\n}\n#endif\n'},6815:n=>{n.exports='/*\nauthor:[Morgan McGuire, Kyle Whitson]\ndescription: 3x3 and 5x5 median filter, adapted from "A Fast, Small-Radius GPU Median Filter" by Morgan McGuire in ShaderX6 https://casual-effects.com/research/McGuire2008Median/index.html\nuse: median(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEDIAN_AMOUNT: median3 (3x3) median5 (5x5)\n MEDIAN_TYPE: default vec4\n MEDIAN_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\nlicense:\n Copyright (c) Morgan McGuire and Williams College, 2006. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef MEDIAN_AMOUNT\n#define MEDIAN_AMOUNT median5\n#endif\n\n#ifndef MEDIAN_TYPE\n#define MEDIAN_TYPE vec4\n#endif\n\n#ifndef MEDIAN_SAMPLER_FNC\n#define MEDIAN_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n/*\nauthor: [Morgan McGuire, Kyle Whitson]\ndescription: |\n 3x3 median filter, adapted from "A Fast, Small-Radius GPU Median Filter" \n by Morgan McGuire in ShaderX6 https://casual-effects.com/research/McGuire2008Median/index.html\nuse: median2D_fast3(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEDIAN2D_FAST3_TYPE: default vec4\n MEDIAN2D_FAST3_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\nlicense:\n Copyright (c) Morgan McGuire and Williams College, 2006. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n*/\n\n#ifndef MEDIAN2D_FAST3_TYPE\n#define MEDIAN2D_FAST3_TYPE vec4\n#endif\n\n#ifndef MEDIAN2D_FAST3_SAMPLER_FNC\n#define MEDIAN2D_FAST3_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef MEDIAN_S2\n#define MEDIAN_S2(a, b) temp = a; a = min(a, b); b = max(temp, b);\n#endif\n\n#ifndef MEDIAN_2\n#define MEDIAN_2(a, b) MEDIAN_S2(v[a], v[b]);\n#endif\n\n#ifndef FNC_MEDIAN2D_FAST3\n#define FNC_MEDIAN2D_FAST3\n#define MEDIAN_MN3(a, b, c) MEDIAN_2(a, b); MEDIAN_2(a, c);\n#define MEDIAN_MX3(a, b, c) MEDIAN_2(b, c); MEDIAN_2(a, c);\n#define MEDIAN_MNMX3(a, b, c) MEDIAN_MX3(a, b, c); MEDIAN_2(a, b); // 3 exchanges\n#define MEDIAN_MNMX4(a, b, c, d) MEDIAN_2(a, b); MEDIAN_2(c, d); MEDIAN_2(a, c); MEDIAN_2(b, d); // 4 exchanges\n#define MEDIAN_MNMX5(a, b, c, d, e) MEDIAN_2(a, b); MEDIAN_2(c, d); MEDIAN_MN3(a, c, e); MEDIAN_MX3(b, d, e); // 6 exchanges\n#define MEDIAN_MNMX6(a, b, c, d, e, f) MEDIAN_2(a, d); MEDIAN_2(b, e); MEDIAN_2(c, f); MEDIAN_MN3(a, b, c); MEDIAN_MX3(d, e, f); // 7 exchanges\nMEDIAN2D_FAST3_TYPE median2D_fast3(in sampler2D tex, in vec2 st, in vec2 radius) {\n MEDIAN2D_FAST3_TYPE v[9];\n for (int dX = -1; dX <= 1; ++dX) {\n for (int dY = -1; dY <= 1; ++dY) {\n vec2 offset = vec2(float(dX), float(dY));\n // If a pixel in the window is located at (x+dX, y+dY), put it at index (dX + R)(2R + 1) + (dY + R) of the\n // pixel array. This will fill the pixel array, with the top left pixel of the window at pixel[0] and the\n // bottom right pixel of the window at pixel[N-1].\n v[(dX + 1) * 3 + (dY + 1)] = MEDIAN2D_FAST3_SAMPLER_FNC(st + offset * radius);\n }\n }\n MEDIAN2D_FAST3_TYPE temp = MEDIAN2D_FAST3_TYPE(0.);\n MEDIAN_MNMX6(0, 1, 2, 3, 4, 5);\n MEDIAN_MNMX5(1, 2, 3, 4, 6);\n MEDIAN_MNMX4(2, 3, 4, 7);\n MEDIAN_MNMX3(3, 4, 8);\n return v[4];\n}\n#endif\n\n/*\nauthor: [Morgan McGuire, Kyle Whitson]\ndescription: |\n 3x3 median filter, adapted from "A Fast, Small-Radius GPU Median Filter" \n by Morgan McGuire in ShaderX6 https://casual-effects.com/research/McGuire2008Median/index.html\nuse: median2D_fast5(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEDIAN2D_FAST5_TYPE: default vec4\n MEDIAN2D_FAST5_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\nlicense:\n Copyright (c) Morgan McGuire and Williams College, 2006. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n*/\n\n#ifndef MEDIAN2D_FAST5_TYPE\n#define MEDIAN2D_FAST5_TYPE vec4\n#endif\n\n#ifndef MEDIAN2D_FAST5_SAMPLER_FNC\n#define MEDIAN2D_FAST5_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef MEDIAN_S2\n#define MEDIAN_S2(a, b) temp = a; a = min(a, b); b = max(temp, b);\n#endif\n\n#ifndef MEDIAN_2\n#define MEDIAN_2(a, b) MEDIAN_S2(v[a], v[b]);\n#endif\n\n#ifndef FNC_MEDIAN2D_FAST5\n#define FNC_MEDIAN2D_FAST5\n#define MEDIAN_S2(a, b) temp = a; a = min(a, b); b = max(temp, b);\n#define MEDIAN_2(a, b) MEDIAN_S2(v[a], v[b]);\n\n#define MEDIAN_24(a, b, c, d, e, f, g, h) MEDIAN_2(a, b); MEDIAN_2(c, d); MEDIAN_2(e, f); MEDIAN_2(g, h);\n#define MEDIAN_25(a, b, c, d, e, f, g, h, i, j) MEDIAN_24(a, b, c, d, e, f, g, h); MEDIAN_2(i, j);\n\nMEDIAN2D_FAST5_TYPE median2D_fast5(in sampler2D tex, in vec2 st, in vec2 radius) {\n MEDIAN2D_FAST5_TYPE v[25];\n for (int dX = -2; dX <= 2; ++dX) {\n for (int dY = -2; dY <= 2; ++dY) {\n vec2 offset = vec2(float(dX), float(dY));\n // If a pixel in the window is located at (x+dX, y+dY), put it at index (dX + R)(2R + 1) + (dY + R) of the\n // pixel array. This will fill the pixel array, with the top left pixel of the window at pixel[0] and the\n // bottom right pixel of the window at pixel[N-1].\n v[(dX + 2) * 5 + (dY + 2)] = MEDIAN2D_FAST5_SAMPLER_FNC(st + offset * radius);\n }\n }\n\n MEDIAN2D_FAST5_TYPE temp = MEDIAN2D_FAST5_TYPE(0.);\n MEDIAN_25(0, 1, 3, 4, 2, 4, 2, 3, 6, 7);\n MEDIAN_25(5, 7, 5, 6, 9, 7, 1, 7, 1, 4);\n MEDIAN_25(12, 13, 11, 13, 11, 12, 15, 16, 14, 16);\n MEDIAN_25(14, 15, 18, 19, 17, 19, 17, 18, 21, 22);\n MEDIAN_25(20, 22, 20, 21, 23, 24, 2, 5, 3, 6);\n MEDIAN_25(0, 6, 0, 3, 4, 7, 1, 7, 1, 4);\n MEDIAN_25(11, 14, 8, 14, 8, 11, 12, 15, 9, 15);\n MEDIAN_25(9, 12, 13, 16, 10, 16, 10, 13, 20, 23);\n MEDIAN_25(17, 23, 17, 20, 21, 24, 18, 24, 18, 21);\n MEDIAN_25(19, 22, 8, 17, 9, 18, 0, 18, 0, 9);\n MEDIAN_25(10, 19, 1, 19, 1, 10, 11, 20, 2, 20);\n MEDIAN_25(2, 11, 12, 21, 3, 21, 3, 12, 13, 22);\n MEDIAN_25(4, 22, 4, 13, 14, 23, 5, 23, 5, 14);\n MEDIAN_25(15, 24, 6, 24, 6, 15, 7, 16, 7, 19);\n MEDIAN_25(3, 11, 5, 17, 11, 17, 9, 17, 4, 10);\n MEDIAN_25(6, 12, 7, 14, 4, 6, 4, 7, 12, 14);\n MEDIAN_25(10, 14, 6, 7, 10, 12, 6, 10, 6, 17);\n MEDIAN_25(12, 17, 7, 17, 7, 10, 12, 18, 7, 12);\n MEDIAN_24(10, 18, 12, 20, 10, 20, 10, 12);\n return v[12];\n}\n#endif\n\n\n#ifndef FNC_MEDIAN\n#define FNC_MEDIAN\nMEDIAN_TYPE median3(in sampler2D tex, in vec2 st, in vec2 radius) {\n return median2D_fast3(tex, st, radius);\n}\n\nMEDIAN_TYPE median5(in sampler2D tex, in vec2 st, in vec2 radius) {\n return median2D_fast5(tex, st, radius);\n}\n\nMEDIAN_TYPE median(in sampler2D tex, in vec2 st, in vec2 radius) {\n return MEDIAN_AMOUNT(tex, st, radius);\n}\n#endif\n'},6105:n=>{n.exports="/*\nauthor: Alan Wolfe\ndescription: white noise blur based on this shader https://www.shadertoy.com/view/XsVBDR\nuse: noiseBlur(<sampler2D> texture, <vec2> st, <vec2> pixel, <float> radius)\noptions:\n NOISEBLUR_TYPE: default to vec3\n NOISEBLUR_GAUSSIAN_K: no gaussian by default\n NOISEBLUR_RANDOM23_FNC(UV): defaults to random2(UV)\n NOISEBLUR_SAMPLE_FNC(UV): defualts to texture2D(tex, UV).rgb\n NOISEBLUR_SAMPLES: default to 4\nlicence: |\n TODO\n*/\n\n#define RANDOM_SCALE3 vec3(443.897, 441.423, .0973)\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: pass a value and get some random normalize value between 0 and 1\nuse: float random[2|3](<float|vec2|vec3> value)\n*/\n\n#ifndef FNC_RANDOM\n#define FNC_RANDOM\nfloat random(in float x) {\n return fract(sin(x) * 43758.5453);\n}\n\nfloat random(in vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nfloat random(in vec3 pos) {\n return fract(sin(dot(pos.xyz, vec3(70.9898, 78.233, 32.4355))) * 43758.5453123);\n}\n\nfloat random(in vec4 pos) {\n float dot_product = dot(pos, vec4(12.9898,78.233,45.164,94.673));\n return fract(sin(dot_product) * 43758.5453);\n}\n\n// Hash function from https://www.shadertoy.com/view/4djSRW\n#ifndef RANDOM_SCALE3\n#define RANDOM_SCALE3 vec3(.1031, .1030, .0973)\n#endif\n\n#ifndef FANDOM_SCALE4\n#define FANDOM_SCALE4 vec4(1031, .1030, .0973, .1099)\n#endif\nvec2 random2(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec2 random2(in vec2 st) {\n const vec2 k = vec2(.3183099, .3678794);\n st = st * k + k.yx;\n return -1. + 2. * fract(16. * k * fract(st.x * st.y * (st.x + st.y)));\n}\n\nvec2 random2(vec3 p3) {\n p3 = fract(p3 * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec3 random3(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx); \n}\n\nvec3 random3(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yxz+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx);\n}\n\nvec3 random3(in vec3 p) {\n p = vec3( dot(p, vec3(127.1, 311.7, 74.7)),\n dot(p, vec3(269.5, 183.3, 246.1)),\n dot(p, vec3(113.5, 271.9, 124.6)));\n return -1. + 2. * fract(sin(p) * 43758.5453123);\n}\n\nvec4 random4(float p) {\n vec4 p4 = fract(vec4(p) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx); \n}\n\nvec4 random4(vec2 p) {\n vec4 p4 = fract(vec4(p.xyxy) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec3 p) {\n vec4 p4 = fract(vec4(p.xyzx) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec4 p4) {\n p4 = fract(p4 * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\n\n#endif\n\n\n#ifndef NOISEBLUR_SAMPLES\n#define NOISEBLUR_SAMPLES 4\n#endif\n\n#ifndef NOISEBLUR_TYPE\n#define NOISEBLUR_TYPE vec3\n#endif\n\n#ifndef NOISEBLUR_SAMPLE_FNC\n#define NOISEBLUR_SAMPLE_FNC(UV) texture2D(tex, UV).rgb\n#endif\n\n#ifndef NOISEBLUR_RANDOM23_FNC\n#define NOISEBLUR_RANDOM23_FNC(UV) random2(UV)\n#endif\n\n#ifndef FNC_NOISEBLUR\n#define FNC_NOISEBLUR\nNOISEBLUR_TYPE noiseBlur(in sampler2D tex, in vec2 st, in vec2 pixel, float radius) {\n float blurRadius = radius;\n vec2 whiteNoiseUV = st;\n NOISEBLUR_TYPE result = NOISEBLUR_TYPE(0.0);\n for (int i = 0; i < NOISEBLUR_SAMPLES; ++i) {\n vec2 whiteNoiseRand = NOISEBLUR_RANDOM23_FNC(vec3(whiteNoiseUV.xy, float(i)));\n whiteNoiseUV = whiteNoiseRand;\n\n vec2 r = whiteNoiseRand;\n r.x *= TAU;\n \n #if defined(NOISEBLUR_GAUSSIAN_K)\n // box-muller transform to get gaussian distributed sample points in the circle\n vec2 cr = vec2(sin(r.x),cos(r.x))*sqrt(-NOISEBLUR_GAUSSIAN_K * log(r.y));\n #else\n // uniform sample the circle\n vec2 cr = vec2(sin(r.x),cos(r.x))*sqrt(r.y);\n #endif\n \n NOISEBLUR_TYPE color = NOISEBLUR_SAMPLE_FNC( st + cr * blurRadius * pixel );\n // average the samples as we get em\n // https://blog.demofox.org/2016/08/23/incremental-averaging/\n result = mix(result, color, 1.0 / float(i+1));\n }\n return result;\n}\n#endif"},6827:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: make a radial blur, with dir as the direction to the center and strength as the amount\nuse: radialBlur(<sampler2D> texture, <vec2> st, <vec2> dir [, <float> strength] )\noptions:\n RADIALBLUR_KERNELSIZE: Default 64 \n RADIALBLUR_STRENGTH: Default 0.125\n RADIALBLUR_TYPE: Default `vec4`\n RADIALBLUR_SAMPLER_FNC(POS_UV): Default `texture2D(tex, POS_UV)`\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef RADIALBLUR_KERNELSIZE\n#define RADIALBLUR_KERNELSIZE 64\n#endif\n\n#ifndef RADIALBLUR_STRENGTH\n#define RADIALBLUR_STRENGTH .125\n#endif\n\n#ifndef RADIALBLUR_TYPE\n#define RADIALBLUR_TYPE vec4\n#endif\n\n#ifndef RADIALBLUR_SAMPLER_FNC\n#define RADIALBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_RADIALBLUR\n#define FNC_RADIALBLUR\nRADIALBLUR_TYPE radialBlur(in sampler2D tex, in vec2 st, in vec2 dir, in float strength) {\n RADIALBLUR_TYPE color = RADIALBLUR_TYPE(0.);\n float f_samples = float(RADIALBLUR_KERNELSIZE);\n float f_factor = 1./f_samples;\n for (int i = 0; i < RADIALBLUR_KERNELSIZE; i += 2) {\n color += RADIALBLUR_SAMPLER_FNC(st + float(i) * f_factor * dir * strength);\n color += RADIALBLUR_SAMPLER_FNC(st + float(i+1) * f_factor * dir * strength);\n }\n return color * f_factor;\n}\n\nRADIALBLUR_TYPE radialBlur(in sampler2D tex, in vec2 st, in vec2 dir) {\n return radialBlur(tex, st, dir, RADIALBLUR_STRENGTH);\n}\n#endif\n'}},e={};function t(i){var o=e[i];if(void 0!==o)return o.exports;var A=e[i]={exports:{}};return n[i](A,A.exports,t),A.exports}t.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return t.d(e,{a:e}),e},t.d=(n,e)=>{for(var i in e)t.o(e,i)&&!t.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:e[i]})},t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var i={};(()=>{t.d(i,{Z:()=>d});var n=t(1995),e=t.n(n),o=t(4207),A=t.n(o),s=t(548),r=t.n(s),E=t(7030),R=t.n(E),a=t(6815),S=t.n(a),I=t(6827),T=t.n(I),f=t(5551),N=t.n(f),l=t(6105),O=t.n(l);const d={bilateralBlur:e(),boxBlur:A(),gaussianBlur:r(),mean:R(),median:S(),radialBlur:T(),kuwahara:N(),noiseBlur:O()}})();var o=i.Z;export{o as default}; | ||
var n = { | ||
1995: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get\'s the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: rgb2luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_RGB2LUMA\n#define FNC_RGB2LUMA\nfloat rgb2luma(in vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\nfloat rgb2luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: TODO\nuse: bilateralBlur(<sampler2D> texture, <vec2> st, <vec2> duv)\noptions: TODO\nlicense: TODO\n*/\n\n#ifndef BILATERALBLUR_AMOUNT\n#define BILATERALBLUR_AMOUNT bilateralBlur13\n#endif\n\n#ifndef BILATERALBLUR_TYPE\n#define BILATERALBLUR_TYPE vec4\n#endif\n\n#ifndef BILATERALBLUR_SAMPLER_FNC\n#define BILATERALBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef BILATERALBLUR_LUMA\n#define BILATERALBLUR_LUMA(RGB) rgb2luma(RGB.rgb)\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get\'s the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: rgb2luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_RGB2LUMA\n#define FNC_RGB2LUMA\nfloat rgb2luma(in vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\nfloat rgb2luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: two dimensional bilateral Blur, to do it in one single pass\nuse: bilateralBlur2D(<sampler2D> texture, <vec2> st, <vec2> offset, <int> kernelSize)\noptions:\n BILATERALBLUR2D_TYPE: default is vec3\n BILATERALBLUR2D_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\n BILATERALBLUR2D_LUMA(RGB): default rgb2luma\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BILATERALBLUR2D_TYPE\n#define BILATERALBLUR2D_TYPE vec4\n#endif\n\n#ifndef BILATERALBLUR2D_SAMPLER_FNC\n#define BILATERALBLUR2D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef BILATERALBLUR2D_LUMA\n#define BILATERALBLUR2D_LUMA(RGB) rgb2luma(RGB.rgb)\n#endif\n\n#ifndef FNC_BILATERALBLUR2D\n#define FNC_BILATERALBLUR2D\nBILATERALBLUR2D_TYPE bilateralBlur2D(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n BILATERALBLUR2D_TYPE accumColor = BILATERALBLUR2D_TYPE(0.);\n #ifndef BILATERALBLUR2D_KERNELSIZE\n #define BILATERALBLUR2D_KERNELSIZE kernelSize\n #endif\n float accumWeight = 0.;\n const float k = .15915494; // 1. / (2.*PI)\n const float k2 = k * k;\n float kernelSize2 = float(BILATERALBLUR2D_KERNELSIZE) * float(BILATERALBLUR2D_KERNELSIZE);\n BILATERALBLUR2D_TYPE tex0 = BILATERALBLUR2D_SAMPLER_FNC(st);\n float lum0 = BILATERALBLUR2D_LUMA(tex0);\n\n for (int j = 0; j < BILATERALBLUR2D_KERNELSIZE; j++) {\n float dy = -.5 * (float(BILATERALBLUR2D_KERNELSIZE) - 1.0) + float(j);\n for (int i = 0; i < BILATERALBLUR2D_KERNELSIZE; i++) {\n float dx = -.5 * (float(BILATERALBLUR2D_KERNELSIZE) - 1.0) + float(i);\n BILATERALBLUR2D_TYPE tex = BILATERALBLUR2D_SAMPLER_FNC(st + vec2(dx, dy) * offset);\n float lum = BILATERALBLUR2D_LUMA(tex);\n float dl = 255. * (lum - lum0);\n float weight = (k2 / kernelSize2) * exp(-(dx * dx + dy * dy + dl * dl) / (2. * kernelSize2));\n accumColor += weight * tex;\n accumWeight += weight;\n }\n }\n return accumColor / accumWeight;\n}\n#endif\n\n\n#ifndef FNC_BILATERALFILTER\n#define FNC_BILATERALFILTER\nBILATERALBLUR_TYPE bilateralBlur(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n return bilateralBlur2D(tex, st, offset, kernelSize);\n}\n\nBILATERALBLUR_TYPE bilateralBlur13(in sampler2D tex, in vec2 st, in vec2 offset) {\n return bilateralBlur(tex, st, offset, 7);\n}\n\nBILATERALBLUR_TYPE bilateralBlur9(in sampler2D tex, in vec2 st, in vec2 offset) {\n return bilateralBlur(tex, st, offset, 5);\n}\n\nBILATERALBLUR_TYPE bilateralBlur5(in sampler2D tex, in vec2 st, in vec2 offset) {\n return bilateralBlur(tex, st, offset, 3);\n}\n\nBILATERALBLUR_TYPE bilateralBlur(in sampler2D tex, in vec2 st, in vec2 offset) {\n return BILATERALBLUR_AMOUNT(tex, st, offset);\n}\n#endif\n' | ||
}, | ||
4207: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: given a texture return a simple box blured pixel\nuse: boxBlur(<sampler2D> texture, <vec2> st, <vec2> pixel_offset)\noptions:\n BOXBLUR_2D: default to 1D\n BOXBLUR_ITERATIONS: default 3\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BOXBLUR_ITERATIONS\n#define BOXBLUR_ITERATIONS 3\n#endif\n\n#ifndef BOXBLUR_TYPE\n#define BOXBLUR_TYPE vec4\n#endif\n\n#ifndef BOXBLUR_SAMPLER_FNC\n#define BOXBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: simple one dimentional box blur, to be applied in two passes\nuse: boxBlur1D(<sampler2D> texture, <vec2> st, <vec2> pixel_offset, <int> kernelSize)\noptions:\n BOXBLUR1D_TYPE: default is vec4\n BOXBLUR1D_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\n BOXBLUR1D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n#ifndef BOXBLUR1D_TYPE\n#define BOXBLUR1D_TYPE vec4\n#endif\n\n#ifndef BOXBLUR1D_SAMPLER_FNC\n#define BOXBLUR1D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_BOXBLUR1D\n#define FNC_BOXBLUR1D\nBOXBLUR1D_TYPE boxBlur1D(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n BOXBLUR1D_TYPE color = BOXBLUR1D_TYPE(0.);\n #ifndef BOXBLUR1D_KERNELSIZE\n #define BOXBLUR1D_KERNELSIZE kernelSize\n #endif\n\n float f_kernelSize = float(BOXBLUR1D_KERNELSIZE);\n float weight = 1. / f_kernelSize;\n\n for (int i = 0; i < BOXBLUR1D_KERNELSIZE; i++) {\n float x = -.5 * (f_kernelSize - 1.) + float(i);\n color += BOXBLUR1D_SAMPLER_FNC(st + offset * x ) * weight;\n }\n return color;\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: simple two dimentional box blur, so can be apply in a single pass\nuse: boxBlur2D(<sampler2D> texture, <vec2> st, <vec2> pixel_offset, <int> kernelSize)\noptions:\n BOXBLUR2D_TYPE: Default `vec4`\n BOXBLUR2D_SAMPLER_FNC(POS_UV): default is `texture2D(tex, POS_UV)`\n BOXBLUR2D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BOXBLUR2D_TYPE\n#define BOXBLUR2D_TYPE vec4\n#endif\n\n#ifndef BOXBLUR2D_SAMPLER_FNC\n#define BOXBLUR2D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_BOXBLUR2D\n#define FNC_BOXBLUR2D\nBOXBLUR2D_TYPE boxBlur2D(in sampler2D tex, in vec2 st, in vec2 pixel, const int kernelSize) {\n BOXBLUR2D_TYPE color = BOXBLUR2D_TYPE(0.);\n #ifndef BOXBLUR2D_KERNELSIZE\n #define BOXBLUR2D_KERNELSIZE kernelSize\n #endif\n\n float accumWeight = 0.;\n float f_kernelSize = float(BOXBLUR2D_KERNELSIZE);\n float kernelSize2 = f_kernelSize * f_kernelSize;\n float weight = 1. / kernelSize2;\n\n for (int j = 0; j < BOXBLUR2D_KERNELSIZE; j++) {\n float y = -.5 * (f_kernelSize - 1.) + float(j);\n for (int i = 0; i < BOXBLUR2D_KERNELSIZE; i++) {\n float x = -.5 * (f_kernelSize - 1.) + float(i);\n color += BOXBLUR2D_SAMPLER_FNC(st + vec2(x, y) * pixel) * weight;\n }\n }\n return color;\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: simple two dimentional box blur, so can be apply in a single pass\nuse: boxBlur1D_fast9(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n BOXBLUR2D_FAST9_TYPE: Default is `vec4`\n BOXBLUR2D_FAST9_SAMPLER_FNC(POS_UV): Default is `texture2D(tex, POS_UV)`\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BOXBLUR2D_FAST9_TYPE\n#define BOXBLUR2D_FAST9_TYPE vec4\n#endif\n\n#ifndef BOXBLUR2D_FAST9_SAMPLER_FNC\n#define BOXBLUR2D_FAST9_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_BOXBLUR2D_FAST9\n#define FNC_BOXBLUR2D_FAST9\nBOXBLUR2D_FAST9_TYPE boxBlur2D_fast9(in sampler2D tex, in vec2 st, in vec2 offset) {\n BOXBLUR2D_FAST9_TYPE color = BOXBLUR2D_FAST9_SAMPLER_FNC(st); // center\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(-offset.x, offset.y)); // tleft\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(-offset.x, 0.)); // left\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(-offset.x, -offset.y)); // bleft\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(0., offset.y)); // top\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(0., -offset.y)); // bottom\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + offset); // tright\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(offset.x, 0.)); // right\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(offset.x, -offset.y)); // bright\n return color * 0.1111111111; // 1./9.\n}\n#endif\n\n\n#ifndef FNC_BOXBLUR\n#define FNC_BOXBLUR\nBOXBLUR_TYPE boxBlur13(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, 7);\n#else\n return boxBlur1D(tex, st, offset, 7);\n#endif\n}\n\nBOXBLUR_TYPE boxBlur9(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef BOXBLUR_2D\n return boxBlur2D_fast9(tex, st, offset);\n#else\n return boxBlur1D(tex, st, offset, 5);\n#endif\n}\n\nBOXBLUR_TYPE boxBlur5(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, 3);\n#else\n return boxBlur1D(tex, st, offset, 3);\n#endif\n}\n\nvec4 boxBlur(in sampler2D tex, in vec2 st, vec2 offset, const int kernelSize) {\n#ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, kernelSize);\n#else\n return boxBlur1D(tex, st, offset, kernelSize);\n#endif\n}\n\nvec4 boxBlur(in sampler2D tex, in vec2 st, vec2 offset) {\n #ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, BOXBLUR_ITERATIONS);\n #else\n return boxBlur1D(tex, st, offset, BOXBLUR_ITERATIONS);\n #endif\n}\n#endif\n' | ||
}, | ||
548: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Matt DesLauriers, Patricio Gonzalez Vivo]\ndescription: adapted versions from 5, 9 and 13 gaussian fast blur from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur(<sampler2D> texture, <vec2> st, <vec2> pixel_direction [, const int kernelSize])\noptions:\n GAUSSIANBLUR_AMOUNT: gaussianBlur5 gaussianBlur9 gaussianBlur13 \n GAUSSIANBLUR_2D: default to 1D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n#ifndef GAUSSIANBLUR_AMOUNT\n#define GAUSSIANBLUR_AMOUNT gaussianBlur13\n#endif\n\n#ifndef GAUSSIANBLUR_TYPE\n#define GAUSSIANBLUR_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR_SAMPLER_FNC\n#define GAUSSIANBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: two dimension Gaussian Blur to be applied in only one passes\nuse: gaussianBlur2D(<sampler2D> texture, <vec2> st, <vec2> pixel_direction , const int kernelSize)\noptions:\n GAUSSIANBLUR2D_TYPE: Default `vec4`\n GAUSSIANBLUR2D_SAMPLER_FNC(POS_UV): Default `texture2D(tex, POS_UV)`\n GAUSSIANBLUR2D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n#ifndef GAUSSIANBLUR2D_TYPE\n#define GAUSSIANBLUR2D_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR2D_SAMPLER_FNC\n#define GAUSSIANBLUR2D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR2D\n#define FNC_GAUSSIANBLUR2D\nGAUSSIANBLUR2D_TYPE gaussianBlur2D(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n GAUSSIANBLUR2D_TYPE accumColor = GAUSSIANBLUR2D_TYPE(0.);\n #ifndef GAUSSIANBLUR2D_KERNELSIZE\n #define GAUSSIANBLUR2D_KERNELSIZE kernelSize\n #endif\n\n float accumWeight = 0.;\n const float k = .15915494; // 1 / (2*PI)\n float kernelSize2 = float(GAUSSIANBLUR2D_KERNELSIZE) * float(GAUSSIANBLUR2D_KERNELSIZE);\n\n for (int j = 0; j < GAUSSIANBLUR2D_KERNELSIZE; j++) {\n float y = -.5 * (float(GAUSSIANBLUR2D_KERNELSIZE) - 1.) + float(j);\n for (int i = 0; i < GAUSSIANBLUR2D_KERNELSIZE; i++) {\n float x = -.5 * (float(GAUSSIANBLUR2D_KERNELSIZE) - 1.) + float(i);\n float weight = (k / float(GAUSSIANBLUR2D_KERNELSIZE)) * exp(-(x * x + y * y) / (2. * kernelSize2));\n GAUSSIANBLUR2D_TYPE tex = GAUSSIANBLUR2D_SAMPLER_FNC(st + vec2(x, y) * offset);\n accumColor += weight * tex;\n accumWeight += weight;\n }\n }\n return accumColor / accumWeight;\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: one dimension Gaussian Blur to be applied in two passes\nuse: gaussianBlur1D(<sampler2D> texture, <vec2> st, <vec2> pixel_direction , const int kernelSize)\noptions:\n GAUSSIANBLUR1D_TYPE:\n GAUSSIANBLUR1D_SAMPLER_FNC(POS_UV):\n GAUSSIANBLUR1D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef GAUSSIANBLUR1D_TYPE\n#define GAUSSIANBLUR1D_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_SAMPLER_FNC\n#define GAUSSIANBLUR1D_SAMPLER_FNC(POS_UV)texture2D(tex,POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D\n#define FNC_GAUSSIANBLUR1D\n\n#ifdef GAUSSIANBLUR1D_DYNAMIC\n\nGAUSSIANBLUR1D_TYPE gaussianBlur1D(in sampler2D tex,in vec2 st,in vec2 offset,const int kernelSize){\n GAUSSIANBLUR1D_TYPE accumColor = GAUSSIANBLUR1D_TYPE(0.0);\n \n float accumWeight = 0.0;\n const float k = 0.39894228;// 1 / sqrt(2*PI)\n float kernelSize2 = float(kernelSize)*float(kernelSize);\n for(int i = 0; i < 16; i++){\n if( i >= kernelSize)\n break;\n float x = -0.5 * (float(kernelSize) - 1.0)+float(i);\n float weight = (k/float(kernelSize)) * exp(-(x*x)/(2.0*kernelSize2));\n GAUSSIANBLUR1D_TYPE tex = GAUSSIANBLUR1D_SAMPLER_FNC(st + x * offset);\n accumColor += weight * tex;\n accumWeight += weight;\n }\n return accumColor/accumWeight;\n}\n\n#else\nGAUSSIANBLUR1D_TYPE gaussianBlur1D(in sampler2D tex,in vec2 st,in vec2 offset,const int kernelSize){\n GAUSSIANBLUR1D_TYPE accumColor=GAUSSIANBLUR1D_TYPE(0.);\n #ifndef GAUSSIANBLUR1D_KERNELSIZE\n #define GAUSSIANBLUR1D_KERNELSIZE kernelSize\n #endif\n \n float accumWeight = 0.0;\n const float k = 0.39894228;// 1 / sqrt(2*PI)\n float kernelSize2=float(GAUSSIANBLUR1D_KERNELSIZE)*float(GAUSSIANBLUR1D_KERNELSIZE);\n for(int i = 0; i < GAUSSIANBLUR1D_KERNELSIZE; i++){\n float x = -0.5 * (float(GAUSSIANBLUR1D_KERNELSIZE) -1.0) + float(i);\n float weight = (k/float(GAUSSIANBLUR1D_KERNELSIZE)) * exp(-(x*x)/(2.0*kernelSize2));\n GAUSSIANBLUR1D_TYPE tex = GAUSSIANBLUR1D_SAMPLER_FNC(st + x * offset);\n accumColor += weight * tex;\n accumWeight += weight;\n }\n return accumColor/accumWeight;\n}\n#endif\n\n#endif\n\n/*\nfunction: gaussianBlur1D_fast13\nauthor: Matt DesLauriers\ndescription: adapted versions of gaussian fast blur 13 from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur1D_fast13(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n GAUSSIANBLUR1D_FAST13_TYPE\n GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(POS_UV)\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Jam3\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n#ifndef GAUSSIANBLUR1D_FAST13_TYPE\n#define GAUSSIANBLUR1D_FAST13_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_FAST13_SAMPLER_FNC\n#define GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D_FAST13\n#define FNC_GAUSSIANBLUR1D_FAST13\nGAUSSIANBLUR1D_FAST13_TYPE gaussianBlur1D_fast13(in sampler2D tex, in vec2 st, in vec2 offset) {\n GAUSSIANBLUR1D_FAST13_TYPE color = GAUSSIANBLUR1D_FAST13_TYPE(0.);\n vec2 off1 = vec2(1.411764705882353) * offset;\n vec2 off2 = vec2(3.2941176470588234) * offset;\n vec2 off3 = vec2(5.176470588235294) * offset;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st) * .1964825501511404;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st + (off1)) * .2969069646728344;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st - (off1)) * .2969069646728344;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st + (off2)) * .09447039785044732;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st - (off2)) * .09447039785044732;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st + (off3)) * .010381362401148057;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st - (off3)) * .010381362401148057;\n return color;\n}\n#endif\n\n/*\nauthor: Matt DesLauriers\ndescription: adapted versions of gaussian fast blur 13 from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur1D_fast9(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n GAUSSIANBLUR1D_FAST9_TYPE\n GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(POS_UV)\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Jam3\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n#ifndef GAUSSIANBLUR1D_FAST9_TYPE\n#define GAUSSIANBLUR1D_FAST9_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_FAST9_SAMPLER_FNC\n#define GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D_FAST9\n#define FNC_GAUSSIANBLUR1D_FAST9\nGAUSSIANBLUR1D_FAST9_TYPE gaussianBlur1D_fast9(in sampler2D tex, in vec2 st, in vec2 offset) {\n GAUSSIANBLUR1D_FAST9_TYPE color = GAUSSIANBLUR1D_FAST9_TYPE(0.);\n vec2 off1 = vec2(1.3846153846) * offset;\n vec2 off2 = vec2(3.2307692308) * offset;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st) * .2270270270;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st + (off1)) * .3162162162;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st - (off1)) * .3162162162;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st + (off2)) * .0702702703;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st - (off2)) * .0702702703;\n return color;\n}\n#endif\n\n/*\nauthor: Matt DesLauriers\ndescription: adapted versions of gaussian fast blur 13 from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur1D_fast5(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n GAUSSIANBLUR1D_FAST5_TYPE\n GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(POS_UV)\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Jam3\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef GAUSSIANBLUR1D_FAST5_TYPE\n#define GAUSSIANBLUR1D_FAST5_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_FAST5_SAMPLER_FNC\n#define GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D_FAST5\n#define FNC_GAUSSIANBLUR1D_FAST5\nGAUSSIANBLUR1D_FAST5_TYPE gaussianBlur1D_fast5(in sampler2D tex, in vec2 st, in vec2 offset) {\n GAUSSIANBLUR1D_FAST5_TYPE color = GAUSSIANBLUR1D_FAST5_TYPE(0.);\n vec2 off1 = vec2(1.3333333333333333) * offset;\n color += GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(st) * .29411764705882354;\n color += GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(st + (off1)) * .35294117647058826;\n color += GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(st - (off1)) * .35294117647058826;\n return color;\n}\n#endif\n\n\n#ifndef FNC_GAUSSIANBLUR\n#define FNC_GAUSSIANBLUR\nGAUSSIANBLUR_TYPE gaussianBlur13(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, 7);\n#else\n return gaussianBlur1D_fast13(tex, st, offset);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur9(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, 5);\n#else\n return gaussianBlur1D_fast9(tex, st, offset);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur5(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, 3);\n#else\n return gaussianBlur1D_fast5(tex, st, offset);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, kernelSize);\n#else\n return gaussianBlur1D(tex, st, offset, kernelSize);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur(in sampler2D tex, in vec2 st, in vec2 offset) {\n return GAUSSIANBLUR_AMOUNT(tex, st, offset);\n}\n#endif\n' | ||
}, | ||
5551: (n) => { | ||
n.exports = | ||
'/*\nauthor: Brad Larson\ndescription: Kuwahara image abstraction, drawn from the work of Kyprianidis, et. al. in their publication "Anisotropic Kuwahara Filtering on the GPU" within the GPU Pro collection. This produces an oil-painting-like image, but it is extremely computationally expensive, so it can take seconds to render a frame on an iPad 2. This might be best used for still images.\nuse: kuwahara(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n KUWAHARA_TYPE: defaults to vec3\n KUWAHARA_SAMPLER_FNC(POS_UV): defaults to texture2D(tex, POS_UV).rgb\n KUWAHARA_RADIUS radius\nlicence:\n Copyright (c) 2012, Brad Larson, Ben Cochran, Hugues Lismonde, Keitaroh Kobayashi, Alaric Cole, Matthew Clark, Jacob Gundersen, Chris Williams.\n All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef KUWAHARA_TYPE\n#define KUWAHARA_TYPE vec3\n#endif\n\n#ifndef KUWAHARA_SAMPLER_FNC\n#define KUWAHARA_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV).rgb\n#endif\n\n#ifndef KUWAHARA_RADIUS\n#define KUWAHARA_RADIUS radius\n#endif\n\n#ifndef FNC_KUWAHARA\n#define FNC_KUWAHARA\n\n#ifdef TARGET_MOBILE\nKUWAHARA_TYPE kuwahara(in sampler2D tex, in vec2 st, in vec2 pixel, in int radius) {\n float n = float((KUWAHARA_RADIUS + 1) * (KUWAHARA_RADIUS + 1));\n int i; int j;\n KUWAHARA_TYPE m0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE s0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE rta = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE c;\n\n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m0 += c;\n s0 += c * c;\n }\n }\n\n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m1 += c;\n s1 += c * c;\n }\n }\n\n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m2 += c;\n s2 += c * c;\n }\n }\n\n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m3 += c;\n s3 += c * c;\n }\n }\n\n float min_sigma2 = 1e+2;\n m0 /= n;\n s0 = abs(s0 / n - m0 * m0);\n\n float sigma2 = s0.r + s0.g + s0.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m0;\n }\n\n m1 /= n;\n s1 = abs(s1 / n - m1 * m1);\n\n sigma2 = s1.r + s1.g + s1.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m1;\n }\n\n m2 /= n;\n s2 = abs(s2 / n - m2 * m2);\n\n sigma2 = s2.r + s2.g + s2.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m2;\n }\n\n m3 /= n;\n s3 = abs(s3 / n - m3 * m3);\n\n sigma2 = s3.r + s3.g + s3.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m3;\n }\n\n return rta;\n}\n#else\n\nKUWAHARA_TYPE kuwahara(in sampler2D tex, in vec2 st, in vec2 pixel, in int radius) {\n\n float n = float((KUWAHARA_RADIUS + 1) * (KUWAHARA_RADIUS + 1));\n int i; int j;\n KUWAHARA_TYPE m0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE s0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE rta = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE c;\n \n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m0 += c;\n s0 += c * c;\n }\n }\n \n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m1 += c;\n s1 += c * c;\n }\n }\n \n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m2 += c;\n s2 += c * c;\n }\n }\n \n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m3 += c;\n s3 += c * c;\n }\n }\n \n \n float min_sigma2 = 1e+2;\n m0 /= n;\n s0 = abs(s0 / n - m0 * m0);\n \n float sigma2 = s0.r + s0.g + s0.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m0;\n }\n \n m1 /= n;\n s1 = abs(s1 / n - m1 * m1);\n \n sigma2 = s1.r + s1.g + s1.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m1;\n }\n \n m2 /= n;\n s2 = abs(s2 / n - m2 * m2);\n \n sigma2 = s2.r + s2.g + s2.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m2;\n }\n \n m3 /= n;\n s3 = abs(s3 / n - m3 * m3);\n \n sigma2 = s3.r + s3.g + s3.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m3;\n }\n\n return rta;\n}\n\n#endif\n\n#endif' | ||
}, | ||
7030: (n) => { | ||
n.exports = | ||
'/*\nauthor: Brad Larson\ndescription: adapted version of mean average sampling on four coorners of a sampled point from https://github.com/BradLarson/GPUImage2\nuse: mean(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEAN_TYPE: defaults to vec4\n AVERAGE_SAMPLER_FNC(POS_UV): defaults to texture2D(tex,POS_UV)\nlicence:\n Copyright (c) 2015, Brad Larson. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef MEAN_TYPE\n#define MEAN_TYPE vec4\n#endif\n\n#ifndef MEAN_AMOUNT\n#define MEAN_AMOUNT mean4\n#endif\n\n#ifndef MEAN_SAMPLER_FNC\n#define MEAN_SAMPLER_FNC(POS_UV) texture2D(tex,POS_UV)\n#endif\n\n#ifndef FNC_AVERAGE\n#define FNC_AVERAGE\nMEAN_TYPE mean4(in sampler2D tex, in vec2 st, in vec2 pixel) {\n MEAN_TYPE topLeft = MEAN_SAMPLER_FNC(st - pixel);\n MEAN_TYPE bottomLeft = MEAN_SAMPLER_FNC(st + vec2(-pixel.x, pixel.y));\n MEAN_TYPE topRight = MEAN_SAMPLER_FNC(st + vec2(pixel.x, -pixel.y));\n MEAN_TYPE bottomRight = MEAN_SAMPLER_FNC(st + pixel);\n return 0.25 * (topLeft + topRight + bottomLeft + bottomRight);\n}\n\nMEAN_TYPE mean(in sampler2D tex, in vec2 st, in vec2 pixel) {\n return MEAN_AMOUNT(tex, st, pixel);\n}\n#endif\n' | ||
}, | ||
6815: (n) => { | ||
n.exports = | ||
'/*\nauthor:[Morgan McGuire, Kyle Whitson]\ndescription: 3x3 and 5x5 median filter, adapted from "A Fast, Small-Radius GPU Median Filter" by Morgan McGuire in ShaderX6 https://casual-effects.com/research/McGuire2008Median/index.html\nuse: median(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEDIAN_AMOUNT: median3 (3x3) median5 (5x5)\n MEDIAN_TYPE: default vec4\n MEDIAN_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\nlicense:\n Copyright (c) Morgan McGuire and Williams College, 2006. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef MEDIAN_AMOUNT\n#define MEDIAN_AMOUNT median5\n#endif\n\n#ifndef MEDIAN_TYPE\n#define MEDIAN_TYPE vec4\n#endif\n\n#ifndef MEDIAN_SAMPLER_FNC\n#define MEDIAN_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n/*\nauthor: [Morgan McGuire, Kyle Whitson]\ndescription: |\n 3x3 median filter, adapted from "A Fast, Small-Radius GPU Median Filter" \n by Morgan McGuire in ShaderX6 https://casual-effects.com/research/McGuire2008Median/index.html\nuse: median2D_fast3(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEDIAN2D_FAST3_TYPE: default vec4\n MEDIAN2D_FAST3_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\nlicense:\n Copyright (c) Morgan McGuire and Williams College, 2006. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n*/\n\n#ifndef MEDIAN2D_FAST3_TYPE\n#define MEDIAN2D_FAST3_TYPE vec4\n#endif\n\n#ifndef MEDIAN2D_FAST3_SAMPLER_FNC\n#define MEDIAN2D_FAST3_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef MEDIAN_S2\n#define MEDIAN_S2(a, b) temp = a; a = min(a, b); b = max(temp, b);\n#endif\n\n#ifndef MEDIAN_2\n#define MEDIAN_2(a, b) MEDIAN_S2(v[a], v[b]);\n#endif\n\n#ifndef FNC_MEDIAN2D_FAST3\n#define FNC_MEDIAN2D_FAST3\n#define MEDIAN_MN3(a, b, c) MEDIAN_2(a, b); MEDIAN_2(a, c);\n#define MEDIAN_MX3(a, b, c) MEDIAN_2(b, c); MEDIAN_2(a, c);\n#define MEDIAN_MNMX3(a, b, c) MEDIAN_MX3(a, b, c); MEDIAN_2(a, b); // 3 exchanges\n#define MEDIAN_MNMX4(a, b, c, d) MEDIAN_2(a, b); MEDIAN_2(c, d); MEDIAN_2(a, c); MEDIAN_2(b, d); // 4 exchanges\n#define MEDIAN_MNMX5(a, b, c, d, e) MEDIAN_2(a, b); MEDIAN_2(c, d); MEDIAN_MN3(a, c, e); MEDIAN_MX3(b, d, e); // 6 exchanges\n#define MEDIAN_MNMX6(a, b, c, d, e, f) MEDIAN_2(a, d); MEDIAN_2(b, e); MEDIAN_2(c, f); MEDIAN_MN3(a, b, c); MEDIAN_MX3(d, e, f); // 7 exchanges\nMEDIAN2D_FAST3_TYPE median2D_fast3(in sampler2D tex, in vec2 st, in vec2 radius) {\n MEDIAN2D_FAST3_TYPE v[9];\n for (int dX = -1; dX <= 1; ++dX) {\n for (int dY = -1; dY <= 1; ++dY) {\n vec2 offset = vec2(float(dX), float(dY));\n // If a pixel in the window is located at (x+dX, y+dY), put it at index (dX + R)(2R + 1) + (dY + R) of the\n // pixel array. This will fill the pixel array, with the top left pixel of the window at pixel[0] and the\n // bottom right pixel of the window at pixel[N-1].\n v[(dX + 1) * 3 + (dY + 1)] = MEDIAN2D_FAST3_SAMPLER_FNC(st + offset * radius);\n }\n }\n MEDIAN2D_FAST3_TYPE temp = MEDIAN2D_FAST3_TYPE(0.);\n MEDIAN_MNMX6(0, 1, 2, 3, 4, 5);\n MEDIAN_MNMX5(1, 2, 3, 4, 6);\n MEDIAN_MNMX4(2, 3, 4, 7);\n MEDIAN_MNMX3(3, 4, 8);\n return v[4];\n}\n#endif\n\n/*\nauthor: [Morgan McGuire, Kyle Whitson]\ndescription: |\n 3x3 median filter, adapted from "A Fast, Small-Radius GPU Median Filter" \n by Morgan McGuire in ShaderX6 https://casual-effects.com/research/McGuire2008Median/index.html\nuse: median2D_fast5(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEDIAN2D_FAST5_TYPE: default vec4\n MEDIAN2D_FAST5_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\nlicense:\n Copyright (c) Morgan McGuire and Williams College, 2006. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n*/\n\n#ifndef MEDIAN2D_FAST5_TYPE\n#define MEDIAN2D_FAST5_TYPE vec4\n#endif\n\n#ifndef MEDIAN2D_FAST5_SAMPLER_FNC\n#define MEDIAN2D_FAST5_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef MEDIAN_S2\n#define MEDIAN_S2(a, b) temp = a; a = min(a, b); b = max(temp, b);\n#endif\n\n#ifndef MEDIAN_2\n#define MEDIAN_2(a, b) MEDIAN_S2(v[a], v[b]);\n#endif\n\n#ifndef FNC_MEDIAN2D_FAST5\n#define FNC_MEDIAN2D_FAST5\n#define MEDIAN_S2(a, b) temp = a; a = min(a, b); b = max(temp, b);\n#define MEDIAN_2(a, b) MEDIAN_S2(v[a], v[b]);\n\n#define MEDIAN_24(a, b, c, d, e, f, g, h) MEDIAN_2(a, b); MEDIAN_2(c, d); MEDIAN_2(e, f); MEDIAN_2(g, h);\n#define MEDIAN_25(a, b, c, d, e, f, g, h, i, j) MEDIAN_24(a, b, c, d, e, f, g, h); MEDIAN_2(i, j);\n\nMEDIAN2D_FAST5_TYPE median2D_fast5(in sampler2D tex, in vec2 st, in vec2 radius) {\n MEDIAN2D_FAST5_TYPE v[25];\n for (int dX = -2; dX <= 2; ++dX) {\n for (int dY = -2; dY <= 2; ++dY) {\n vec2 offset = vec2(float(dX), float(dY));\n // If a pixel in the window is located at (x+dX, y+dY), put it at index (dX + R)(2R + 1) + (dY + R) of the\n // pixel array. This will fill the pixel array, with the top left pixel of the window at pixel[0] and the\n // bottom right pixel of the window at pixel[N-1].\n v[(dX + 2) * 5 + (dY + 2)] = MEDIAN2D_FAST5_SAMPLER_FNC(st + offset * radius);\n }\n }\n\n MEDIAN2D_FAST5_TYPE temp = MEDIAN2D_FAST5_TYPE(0.);\n MEDIAN_25(0, 1, 3, 4, 2, 4, 2, 3, 6, 7);\n MEDIAN_25(5, 7, 5, 6, 9, 7, 1, 7, 1, 4);\n MEDIAN_25(12, 13, 11, 13, 11, 12, 15, 16, 14, 16);\n MEDIAN_25(14, 15, 18, 19, 17, 19, 17, 18, 21, 22);\n MEDIAN_25(20, 22, 20, 21, 23, 24, 2, 5, 3, 6);\n MEDIAN_25(0, 6, 0, 3, 4, 7, 1, 7, 1, 4);\n MEDIAN_25(11, 14, 8, 14, 8, 11, 12, 15, 9, 15);\n MEDIAN_25(9, 12, 13, 16, 10, 16, 10, 13, 20, 23);\n MEDIAN_25(17, 23, 17, 20, 21, 24, 18, 24, 18, 21);\n MEDIAN_25(19, 22, 8, 17, 9, 18, 0, 18, 0, 9);\n MEDIAN_25(10, 19, 1, 19, 1, 10, 11, 20, 2, 20);\n MEDIAN_25(2, 11, 12, 21, 3, 21, 3, 12, 13, 22);\n MEDIAN_25(4, 22, 4, 13, 14, 23, 5, 23, 5, 14);\n MEDIAN_25(15, 24, 6, 24, 6, 15, 7, 16, 7, 19);\n MEDIAN_25(3, 11, 5, 17, 11, 17, 9, 17, 4, 10);\n MEDIAN_25(6, 12, 7, 14, 4, 6, 4, 7, 12, 14);\n MEDIAN_25(10, 14, 6, 7, 10, 12, 6, 10, 6, 17);\n MEDIAN_25(12, 17, 7, 17, 7, 10, 12, 18, 7, 12);\n MEDIAN_24(10, 18, 12, 20, 10, 20, 10, 12);\n return v[12];\n}\n#endif\n\n\n#ifndef FNC_MEDIAN\n#define FNC_MEDIAN\nMEDIAN_TYPE median3(in sampler2D tex, in vec2 st, in vec2 radius) {\n return median2D_fast3(tex, st, radius);\n}\n\nMEDIAN_TYPE median5(in sampler2D tex, in vec2 st, in vec2 radius) {\n return median2D_fast5(tex, st, radius);\n}\n\nMEDIAN_TYPE median(in sampler2D tex, in vec2 st, in vec2 radius) {\n return MEDIAN_AMOUNT(tex, st, radius);\n}\n#endif\n' | ||
}, | ||
6105: (n) => { | ||
n.exports = | ||
'/*\nauthor: Alan Wolfe\ndescription: white noise blur based on this shader https://www.shadertoy.com/view/XsVBDR\nuse: noiseBlur(<sampler2D> texture, <vec2> st, <vec2> pixel, <float> radius)\noptions:\n NOISEBLUR_TYPE: default to vec3\n NOISEBLUR_GAUSSIAN_K: no gaussian by default\n NOISEBLUR_RANDOM23_FNC(UV): defaults to random2(UV)\n NOISEBLUR_SAMPLE_FNC(UV): defualts to texture2D(tex, UV).rgb\n NOISEBLUR_SAMPLES: default to 4\nlicence: |\n TODO\n*/\n\n#define RANDOM_SCALE3 vec3(443.897, 441.423, .0973)\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: pass a value and get some random normalize value between 0 and 1\nuse: float random[2|3](<float|vec2|vec3> value)\n*/\n\n#ifndef FNC_RANDOM\n#define FNC_RANDOM\nfloat random(in float x) {\n return fract(sin(x) * 43758.5453);\n}\n\nfloat random(in vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nfloat random(in vec3 pos) {\n return fract(sin(dot(pos.xyz, vec3(70.9898, 78.233, 32.4355))) * 43758.5453123);\n}\n\nfloat random(in vec4 pos) {\n float dot_product = dot(pos, vec4(12.9898,78.233,45.164,94.673));\n return fract(sin(dot_product) * 43758.5453);\n}\n\n// Hash function from https://www.shadertoy.com/view/4djSRW\n#ifndef RANDOM_SCALE3\n#define RANDOM_SCALE3 vec3(.1031, .1030, .0973)\n#endif\n\n#ifndef FANDOM_SCALE4\n#define FANDOM_SCALE4 vec4(1031, .1030, .0973, .1099)\n#endif\nvec2 random2(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec2 random2(in vec2 st) {\n const vec2 k = vec2(.3183099, .3678794);\n st = st * k + k.yx;\n return -1. + 2. * fract(16. * k * fract(st.x * st.y * (st.x + st.y)));\n}\n\nvec2 random2(vec3 p3) {\n p3 = fract(p3 * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec3 random3(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx); \n}\n\nvec3 random3(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yxz+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx);\n}\n\nvec3 random3(in vec3 p) {\n p = vec3( dot(p, vec3(127.1, 311.7, 74.7)),\n dot(p, vec3(269.5, 183.3, 246.1)),\n dot(p, vec3(113.5, 271.9, 124.6)));\n return -1. + 2. * fract(sin(p) * 43758.5453123);\n}\n\nvec4 random4(float p) {\n vec4 p4 = fract(vec4(p) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx); \n}\n\nvec4 random4(vec2 p) {\n vec4 p4 = fract(vec4(p.xyxy) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec3 p) {\n vec4 p4 = fract(vec4(p.xyzx) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec4 p4) {\n p4 = fract(p4 * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\n\n#endif\n\n\n#ifndef NOISEBLUR_SAMPLES\n#define NOISEBLUR_SAMPLES 4\n#endif\n\n#ifndef NOISEBLUR_TYPE\n#define NOISEBLUR_TYPE vec3\n#endif\n\n#ifndef NOISEBLUR_SAMPLE_FNC\n#define NOISEBLUR_SAMPLE_FNC(UV) texture2D(tex, UV).rgb\n#endif\n\n#ifndef NOISEBLUR_RANDOM23_FNC\n#define NOISEBLUR_RANDOM23_FNC(UV) random2(UV)\n#endif\n\n#ifndef FNC_NOISEBLUR\n#define FNC_NOISEBLUR\nNOISEBLUR_TYPE noiseBlur(in sampler2D tex, in vec2 st, in vec2 pixel, float radius) {\n float blurRadius = radius;\n vec2 whiteNoiseUV = st;\n NOISEBLUR_TYPE result = NOISEBLUR_TYPE(0.0);\n for (int i = 0; i < NOISEBLUR_SAMPLES; ++i) {\n vec2 whiteNoiseRand = NOISEBLUR_RANDOM23_FNC(vec3(whiteNoiseUV.xy, float(i)));\n whiteNoiseUV = whiteNoiseRand;\n\n vec2 r = whiteNoiseRand;\n r.x *= TAU;\n \n #if defined(NOISEBLUR_GAUSSIAN_K)\n // box-muller transform to get gaussian distributed sample points in the circle\n vec2 cr = vec2(sin(r.x),cos(r.x))*sqrt(-NOISEBLUR_GAUSSIAN_K * log(r.y));\n #else\n // uniform sample the circle\n vec2 cr = vec2(sin(r.x),cos(r.x))*sqrt(r.y);\n #endif\n \n NOISEBLUR_TYPE color = NOISEBLUR_SAMPLE_FNC( st + cr * blurRadius * pixel );\n // average the samples as we get em\n // https://blog.demofox.org/2016/08/23/incremental-averaging/\n result = mix(result, color, 1.0 / float(i+1));\n }\n return result;\n}\n#endif' | ||
}, | ||
6827: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: make a radial blur, with dir as the direction to the center and strength as the amount\nuse: radialBlur(<sampler2D> texture, <vec2> st, <vec2> dir [, <float> strength] )\noptions:\n RADIALBLUR_KERNELSIZE: Default 64 \n RADIALBLUR_STRENGTH: Default 0.125\n RADIALBLUR_TYPE: Default `vec4`\n RADIALBLUR_SAMPLER_FNC(POS_UV): Default `texture2D(tex, POS_UV)`\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef RADIALBLUR_KERNELSIZE\n#define RADIALBLUR_KERNELSIZE 64\n#endif\n\n#ifndef RADIALBLUR_STRENGTH\n#define RADIALBLUR_STRENGTH .125\n#endif\n\n#ifndef RADIALBLUR_TYPE\n#define RADIALBLUR_TYPE vec4\n#endif\n\n#ifndef RADIALBLUR_SAMPLER_FNC\n#define RADIALBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_RADIALBLUR\n#define FNC_RADIALBLUR\nRADIALBLUR_TYPE radialBlur(in sampler2D tex, in vec2 st, in vec2 dir, in float strength) {\n RADIALBLUR_TYPE color = RADIALBLUR_TYPE(0.);\n float f_samples = float(RADIALBLUR_KERNELSIZE);\n float f_factor = 1./f_samples;\n for (int i = 0; i < RADIALBLUR_KERNELSIZE; i += 2) {\n color += RADIALBLUR_SAMPLER_FNC(st + float(i) * f_factor * dir * strength);\n color += RADIALBLUR_SAMPLER_FNC(st + float(i+1) * f_factor * dir * strength);\n }\n return color * f_factor;\n}\n\nRADIALBLUR_TYPE radialBlur(in sampler2D tex, in vec2 st, in vec2 dir) {\n return radialBlur(tex, st, dir, RADIALBLUR_STRENGTH);\n}\n#endif\n' | ||
}, | ||
}, | ||
e = {} | ||
function t(i) { | ||
var o = e[i] | ||
if (void 0 !== o) return o.exports | ||
var A = (e[i] = { exports: {} }) | ||
return n[i](A, A.exports, t), A.exports | ||
} | ||
;(t.d = (n, e) => { | ||
for (var i in e) | ||
t.o(e, i) && | ||
!t.o(n, i) && | ||
Object.defineProperty(n, i, { enumerable: !0, get: e[i] }) | ||
}), | ||
(t.o = (n, e) => Object.prototype.hasOwnProperty.call(n, e)) | ||
var i = {} | ||
;(() => { | ||
t.d(i, { Z: () => n }) | ||
const n = { | ||
bilateralBlur: t(1995), | ||
boxBlur: t(4207), | ||
gaussianBlur: t(548), | ||
mean: t(7030), | ||
median: t(6815), | ||
radialBlur: t(6827), | ||
kuwahara: t(5551), | ||
noiseBlur: t(6105), | ||
} | ||
})() | ||
var o = i.Z | ||
export { o as default } |
@@ -1,1 +0,54 @@ | ||
var n={678:n=>{n.exports='/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: fade\nuse: fade(<vec2|vec3|vec4> t)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_FADE\n#define FNC_FADE\nfloat fade(in float t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec2 fade(in vec2 t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec3 fade(in vec3 t) {\n return t * t * t * (t * (t * 6. - 15. ) + 10.);\n}\n\nvec4 fade(vec4 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Classic Perlin Noise https://github.com/ashima/webgl-noise\nuse: cnoise(<vec2|vec3|vec4> pos)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef FNC_CNOISE\n#define FNC_CNOISE\n\nfloat cnoise(in vec2 P) {\n vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0);\n vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0);\n Pi = mod289(Pi); // To avoid truncation effects in permutation\n vec4 ix = Pi.xzxz;\n vec4 iy = Pi.yyww;\n vec4 fx = Pf.xzxz;\n vec4 fy = Pf.yyww;\n\n vec4 i = permute(permute(ix) + iy);\n\n vec4 gx = fract(i * (1.0 / 41.0)) * 2.0 - 1.0 ;\n vec4 gy = abs(gx) - 0.5 ;\n vec4 tx = floor(gx + 0.5);\n gx = gx - tx;\n\n vec2 g00 = vec2(gx.x,gy.x);\n vec2 g10 = vec2(gx.y,gy.y);\n vec2 g01 = vec2(gx.z,gy.z);\n vec2 g11 = vec2(gx.w,gy.w);\n\n vec4 norm = taylorInvSqrt(vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)));\n g00 *= norm.x;\n g01 *= norm.y;\n g10 *= norm.z;\n g11 *= norm.w;\n\n float n00 = dot(g00, vec2(fx.x, fy.x));\n float n10 = dot(g10, vec2(fx.y, fy.y));\n float n01 = dot(g01, vec2(fx.z, fy.z));\n float n11 = dot(g11, vec2(fx.w, fy.w));\n\n vec2 fade_xy = fade(Pf.xy);\n vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x);\n float n_xy = mix(n_x.x, n_x.y, fade_xy.y);\n return 2.3 * n_xy;\n}\n\nfloat cnoise(in vec3 P) {\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nfloat cnoise(in vec4 P) {\n vec4 Pi0 = floor(P); // Integer part for indexing\n vec4 Pi1 = Pi0 + 1.0; // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec4 Pf0 = fract(P); // Fractional part for interpolation\n vec4 Pf1 = Pf0 - 1.0; // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = vec4(Pi0.zzzz);\n vec4 iz1 = vec4(Pi1.zzzz);\n vec4 iw0 = vec4(Pi0.wwww);\n vec4 iw1 = vec4(Pi1.wwww);\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 ixy00 = permute(ixy0 + iw0);\n vec4 ixy01 = permute(ixy0 + iw1);\n vec4 ixy10 = permute(ixy1 + iw0);\n vec4 ixy11 = permute(ixy1 + iw1);\n\n vec4 gx00 = ixy00 * (1.0 / 7.0);\n vec4 gy00 = floor(gx00) * (1.0 / 7.0);\n vec4 gz00 = floor(gy00) * (1.0 / 6.0);\n gx00 = fract(gx00) - 0.5;\n gy00 = fract(gy00) - 0.5;\n gz00 = fract(gz00) - 0.5;\n vec4 gw00 = vec4(0.75) - abs(gx00) - abs(gy00) - abs(gz00);\n vec4 sw00 = step(gw00, vec4(0.0));\n gx00 -= sw00 * (step(0.0, gx00) - 0.5);\n gy00 -= sw00 * (step(0.0, gy00) - 0.5);\n\n vec4 gx01 = ixy01 * (1.0 / 7.0);\n vec4 gy01 = floor(gx01) * (1.0 / 7.0);\n vec4 gz01 = floor(gy01) * (1.0 / 6.0);\n gx01 = fract(gx01) - 0.5;\n gy01 = fract(gy01) - 0.5;\n gz01 = fract(gz01) - 0.5;\n vec4 gw01 = vec4(0.75) - abs(gx01) - abs(gy01) - abs(gz01);\n vec4 sw01 = step(gw01, vec4(0.0));\n gx01 -= sw01 * (step(0.0, gx01) - 0.5);\n gy01 -= sw01 * (step(0.0, gy01) - 0.5);\n\n vec4 gx10 = ixy10 * (1.0 / 7.0);\n vec4 gy10 = floor(gx10) * (1.0 / 7.0);\n vec4 gz10 = floor(gy10) * (1.0 / 6.0);\n gx10 = fract(gx10) - 0.5;\n gy10 = fract(gy10) - 0.5;\n gz10 = fract(gz10) - 0.5;\n vec4 gw10 = vec4(0.75) - abs(gx10) - abs(gy10) - abs(gz10);\n vec4 sw10 = step(gw10, vec4(0.0));\n gx10 -= sw10 * (step(0.0, gx10) - 0.5);\n gy10 -= sw10 * (step(0.0, gy10) - 0.5);\n\n vec4 gx11 = ixy11 * (1.0 / 7.0);\n vec4 gy11 = floor(gx11) * (1.0 / 7.0);\n vec4 gz11 = floor(gy11) * (1.0 / 6.0);\n gx11 = fract(gx11) - 0.5;\n gy11 = fract(gy11) - 0.5;\n gz11 = fract(gz11) - 0.5;\n vec4 gw11 = vec4(0.75) - abs(gx11) - abs(gy11) - abs(gz11);\n vec4 sw11 = step(gw11, vec4(0.0));\n gx11 -= sw11 * (step(0.0, gx11) - 0.5);\n gy11 -= sw11 * (step(0.0, gy11) - 0.5);\n\n vec4 g0000 = vec4(gx00.x,gy00.x,gz00.x,gw00.x);\n vec4 g1000 = vec4(gx00.y,gy00.y,gz00.y,gw00.y);\n vec4 g0100 = vec4(gx00.z,gy00.z,gz00.z,gw00.z);\n vec4 g1100 = vec4(gx00.w,gy00.w,gz00.w,gw00.w);\n vec4 g0010 = vec4(gx10.x,gy10.x,gz10.x,gw10.x);\n vec4 g1010 = vec4(gx10.y,gy10.y,gz10.y,gw10.y);\n vec4 g0110 = vec4(gx10.z,gy10.z,gz10.z,gw10.z);\n vec4 g1110 = vec4(gx10.w,gy10.w,gz10.w,gw10.w);\n vec4 g0001 = vec4(gx01.x,gy01.x,gz01.x,gw01.x);\n vec4 g1001 = vec4(gx01.y,gy01.y,gz01.y,gw01.y);\n vec4 g0101 = vec4(gx01.z,gy01.z,gz01.z,gw01.z);\n vec4 g1101 = vec4(gx01.w,gy01.w,gz01.w,gw01.w);\n vec4 g0011 = vec4(gx11.x,gy11.x,gz11.x,gw11.x);\n vec4 g1011 = vec4(gx11.y,gy11.y,gz11.y,gw11.y);\n vec4 g0111 = vec4(gx11.z,gy11.z,gz11.z,gw11.z);\n vec4 g1111 = vec4(gx11.w,gy11.w,gz11.w,gw11.w);\n\n vec4 norm00 = taylorInvSqrt(vec4(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100)));\n g0000 *= norm00.x;\n g0100 *= norm00.y;\n g1000 *= norm00.z;\n g1100 *= norm00.w;\n\n vec4 norm01 = taylorInvSqrt(vec4(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101)));\n g0001 *= norm01.x;\n g0101 *= norm01.y;\n g1001 *= norm01.z;\n g1101 *= norm01.w;\n\n vec4 norm10 = taylorInvSqrt(vec4(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110)));\n g0010 *= norm10.x;\n g0110 *= norm10.y;\n g1010 *= norm10.z;\n g1110 *= norm10.w;\n\n vec4 norm11 = taylorInvSqrt(vec4(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111)));\n g0011 *= norm11.x;\n g0111 *= norm11.y;\n g1011 *= norm11.z;\n g1111 *= norm11.w;\n\n float n0000 = dot(g0000, Pf0);\n float n1000 = dot(g1000, vec4(Pf1.x, Pf0.yzw));\n float n0100 = dot(g0100, vec4(Pf0.x, Pf1.y, Pf0.zw));\n float n1100 = dot(g1100, vec4(Pf1.xy, Pf0.zw));\n float n0010 = dot(g0010, vec4(Pf0.xy, Pf1.z, Pf0.w));\n float n1010 = dot(g1010, vec4(Pf1.x, Pf0.y, Pf1.z, Pf0.w));\n float n0110 = dot(g0110, vec4(Pf0.x, Pf1.yz, Pf0.w));\n float n1110 = dot(g1110, vec4(Pf1.xyz, Pf0.w));\n float n0001 = dot(g0001, vec4(Pf0.xyz, Pf1.w));\n float n1001 = dot(g1001, vec4(Pf1.x, Pf0.yz, Pf1.w));\n float n0101 = dot(g0101, vec4(Pf0.x, Pf1.y, Pf0.z, Pf1.w));\n float n1101 = dot(g1101, vec4(Pf1.xy, Pf0.z, Pf1.w));\n float n0011 = dot(g0011, vec4(Pf0.xy, Pf1.zw));\n float n1011 = dot(g1011, vec4(Pf1.x, Pf0.y, Pf1.zw));\n float n0111 = dot(g0111, vec4(Pf0.x, Pf1.yzw));\n float n1111 = dot(g1111, Pf1);\n\n vec4 fade_xyzw = fade(Pf0);\n vec4 n_0w = mix(vec4(n0000, n1000, n0100, n1100), vec4(n0001, n1001, n0101, n1101), fade_xyzw.w);\n vec4 n_1w = mix(vec4(n0010, n1010, n0110, n1110), vec4(n0011, n1011, n0111, n1111), fade_xyzw.w);\n vec4 n_zw = mix(n_0w, n_1w, fade_xyzw.z);\n vec2 n_yzw = mix(n_zw.xy, n_zw.zw, fade_xyzw.y);\n float n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x);\n return 2.2 * n_xyzw;\n}\n#endif\n'},4686:n=>{n.exports="/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: grad4, used for snoise(vec4 v)\nuse: grad4(<float> j, <vec4> ip)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_GRAD4\n#define FNC_GRAD4\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Simplex Noise https://github.com/ashima/webgl-noise\nuse: snoise(<vec2|vec3|vec4> pos)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n*/\n\n#ifndef FNC_SNOISE\n#define FNC_SNOISE\nfloat snoise(in vec2 v) {\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0\n //i1.y = 1.0 - i1.x;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n // x0 = x0 - 0.0 + 0.0 * C.xx ;\n // x1 = x0 - i1 + 1.0 * C.xx ;\n // x2 = x0 - 1.0 + 2.0 * C.xx ;\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\n\nfloat snoise(in vec3 v) {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n // Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients: 7x7 points over a square, mapped onto an octahedron.\n // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n //Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}\n\nfloat snoise(in vec4 v) {\n const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\n 0.276393202250021, // 2 * G4\n 0.414589803375032, // 3 * G4\n -0.447213595499958); // -1 + 4 * G4\n\n // First corner\n vec4 i = floor(v + dot(v, vec4(.309016994374947451)) ); // (sqrt(5) - 1)/4\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxxx\n // x1 = x0 - i1 + 1.0 * C.xxxx\n // x2 = x0 - i2 + 2.0 * C.xxxx\n // x3 = x0 - i3 + 3.0 * C.xxxx\n // x4 = x0 - 1.0 + 4.0 * C.xxxx\n vec4 x1 = x0 - i1 + C.xxxx;\n vec4 x2 = x0 - i2 + C.yyyy;\n vec4 x3 = x0 - i3 + C.zzzz;\n vec4 x4 = x0 + C.wwww;\n\n // Permutations\n i = mod289(i);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n}\n\nvec3 snoise3( vec3 x ){\n float s = snoise(vec3( x ));\n float s1 = snoise(vec3( x.y - 19.1 , x.z + 33.4 , x.x + 47.2 ));\n float s2 = snoise(vec3( x.z + 74.2 , x.x - 124.5 , x.y + 99.4 ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\nvec3 snoise3( vec4 x ){\n float s = snoise(vec4( x ));\n float s1 = snoise(vec4( x.y - 19.1 , x.z + 33.4 , x.x + 47.2, x.w ));\n float s2 = snoise(vec4( x.z + 74.2 , x.x - 124.5 , x.y + 99.4, x.w ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Fractal Brownian Motion\nuse: fbm(<vec2> pos)\noptions:\n FBM_OCTAVES: numbers of octaves. Default is 4.\n FBM_NOISE_FNC(POS_UV): noise function to use Default 'snoise(POS_UV)' (simplex noise)\n FBM_VALUE_INITIAL: initial value. Default is 0.\n FBM_SCALE_SCALAR: scalar. Defualt is 2.\n FBM_AMPLITUD_INITIAL: initial amplitud value. Default is 0.5\n FBM_AMPLITUD_SCALAR: amplitud scalar. Default is 0.5\n*/\n\n#ifndef FBM_OCTAVES\n#define FBM_OCTAVES 4\n#endif\n\n#ifndef FBM_NOISE_FNC\n#define FBM_NOISE_FNC(POS_UV) snoise(POS_UV)\n#endif\n\n#ifndef FBM_VALUE_INITIAL\n#define FBM_VALUE_INITIAL 0.0\n#endif\n\n#ifndef FBM_SCALE_SCALAR\n#define FBM_SCALE_SCALAR 2.0\n#endif\n\n#ifndef FBM_AMPLITUD_INITIAL\n#define FBM_AMPLITUD_INITIAL 0.5\n#endif\n\n#ifndef FBM_AMPLITUD_SCALAR\n#define FBM_AMPLITUD_SCALAR 0.5\n#endif\n\n#ifndef FNC_FBM\n#define FNC_FBM\nfloat fbm(in vec2 st) {\n // Initial values\n float value = FBM_VALUE_INITIAL;\n float amplitud = FBM_AMPLITUD_INITIAL;\n\n // Loop of octaves\n for (int i = 0; i < FBM_OCTAVES; i++) {\n value += amplitud * FBM_NOISE_FNC(st);\n st *= FBM_SCALE_SCALAR;\n amplitud *= FBM_AMPLITUD_SCALAR;\n }\n return value;\n}\n\nfloat fbm(in vec3 pos) {\n // Initial values\n float value = FBM_VALUE_INITIAL;\n float amplitud = FBM_AMPLITUD_INITIAL;\n\n // Loop of octaves\n for (int i = 0; i < FBM_OCTAVES; i++) {\n value += amplitud * FBM_NOISE_FNC(pos);\n pos *= FBM_SCALE_SCALAR;\n amplitud *= FBM_AMPLITUD_SCALAR;\n }\n return value;\n}\n#endif\n"},4401:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: pass a value and get some random normalize value between 0 and 1\nuse: float random[2|3](<float|vec2|vec3> value)\n*/\n\n#ifndef FNC_RANDOM\n#define FNC_RANDOM\nfloat random(in float x) {\n return fract(sin(x) * 43758.5453);\n}\n\nfloat random(in vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nfloat random(in vec3 pos) {\n return fract(sin(dot(pos.xyz, vec3(70.9898, 78.233, 32.4355))) * 43758.5453123);\n}\n\nfloat random(in vec4 pos) {\n float dot_product = dot(pos, vec4(12.9898,78.233,45.164,94.673));\n return fract(sin(dot_product) * 43758.5453);\n}\n\n// Hash function from https://www.shadertoy.com/view/4djSRW\n#ifndef RANDOM_SCALE3\n#define RANDOM_SCALE3 vec3(.1031, .1030, .0973)\n#endif\n\n#ifndef FANDOM_SCALE4\n#define FANDOM_SCALE4 vec4(1031, .1030, .0973, .1099)\n#endif\nvec2 random2(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec2 random2(in vec2 st) {\n const vec2 k = vec2(.3183099, .3678794);\n st = st * k + k.yx;\n return -1. + 2. * fract(16. * k * fract(st.x * st.y * (st.x + st.y)));\n}\n\nvec2 random2(vec3 p3) {\n p3 = fract(p3 * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec3 random3(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx); \n}\n\nvec3 random3(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yxz+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx);\n}\n\nvec3 random3(in vec3 p) {\n p = vec3( dot(p, vec3(127.1, 311.7, 74.7)),\n dot(p, vec3(269.5, 183.3, 246.1)),\n dot(p, vec3(113.5, 271.9, 124.6)));\n return -1. + 2. * fract(sin(p) * 43758.5453123);\n}\n\nvec4 random4(float p) {\n vec4 p4 = fract(vec4(p) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx); \n}\n\nvec4 random4(vec2 p) {\n vec4 p4 = fract(vec4(p.xyxy) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec3 p) {\n vec4 p4 = fract(vec4(p.xyzx) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec4 p4) {\n p4 = fract(p4 * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\n\n#endif\n\n\n/*\nauthor: Inigo Quilez\ndescription: returns 2D/3D value noise in the first channel and in the rest the derivatives. For more details read this nice article http://www.iquilezles.org/www/articles/gradientnoise/gradientnoise.htm\nuse: noised(<vec2|vec3> space)\noptions:\n NOISED_QUINTIC_INTERPOLATION: Quintic interpolation on/off. Default is off.\nlicense: |\n Copyright © 2017 Inigo Quilez\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_NOISED\n#define FNC_NOISED\n\n// return gradient noise (in x) and its derivatives (in yz)\nvec3 noised (in vec2 p) {\n // grid\n vec2 i = floor( p );\n vec2 f = fract( p );\n\n#ifdef NOISED_QUINTIC_INTERPOLATION\n // quintic interpolation\n vec2 u = f * f * f * (f * (f * 6. - 15.) + 10.);\n vec2 du = 30. * f * f * (f * (f - 2.) + 1.);\n#else\n // cubic interpolation\n vec2 u = f * f * (3. - 2. * f);\n vec2 du = 6. * f * (1. - f);\n#endif\n\n vec2 ga = random2(i + vec2(0., 0.));\n vec2 gb = random2(i + vec2(1., 0.));\n vec2 gc = random2(i + vec2(0., 1.));\n vec2 gd = random2(i + vec2(1., 1.));\n\n float va = dot(ga, f - vec2(0., 0.));\n float vb = dot(gb, f - vec2(1., 0.));\n float vc = dot(gc, f - vec2(0., 1.));\n float vd = dot(gd, f - vec2(1., 1.));\n\n return vec3( va + u.x*(vb-va) + u.y*(vc-va) + u.x*u.y*(va-vb-vc+vd), // value\n ga + u.x*(gb-ga) + u.y*(gc-ga) + u.x*u.y*(ga-gb-gc+gd) + // derivatives\n du * (u.yx*(va-vb-vc+vd) + vec2(vb,vc) - va));\n}\n\n// returns 3D value noise (in .x) and its derivatives (in .yzw)\n// https://www.shadertoy.com/view/4dffRH\nvec4 noised (in vec3 pos) {\n // grid\n vec3 p = floor(pos);\n vec3 w = fract(pos);\n\n#ifdef NOISED_QUINTIC_INTERPOLATION\n // quintic interpolant\n vec3 u = w * w * w * ( w * (w * 6. - 15.) + 10. );\n vec3 du = 30.0 * w * w * ( w * (w - 2.) + 1.);\n#else\n // cubic interpolant\n vec3 u = w * w * (3. - 2. * w);\n vec3 du = 6. * w * (1. - w);\n#endif\n\n // gradients\n vec3 ga = random3(p + vec3(0., 0., 0.));\n vec3 gb = random3(p + vec3(1., 0., 0.));\n vec3 gc = random3(p + vec3(0., 1., 0.));\n vec3 gd = random3(p + vec3(1., 1., 0.));\n vec3 ge = random3(p + vec3(0., 0., 1.));\n vec3 gf = random3(p + vec3(1., 0., 1.));\n vec3 gg = random3(p + vec3(0., 1., 1.));\n vec3 gh = random3(p + vec3(1., 1., 1.));\n\n // projections\n float va = dot(ga, w - vec3(0., 0., 0.));\n float vb = dot(gb, w - vec3(1., 0., 0.));\n float vc = dot(gc, w - vec3(0., 1., 0.));\n float vd = dot(gd, w - vec3(1., 1., 0.));\n float ve = dot(ge, w - vec3(0., 0., 1.));\n float vf = dot(gf, w - vec3(1., 0., 1.));\n float vg = dot(gg, w - vec3(0., 1., 1.));\n float vh = dot(gh, w - vec3(1., 1., 1.));\n\n // interpolations\n return vec4( va + u.x*(vb-va) + u.y*(vc-va) + u.z*(ve-va) + u.x*u.y*(va-vb-vc+vd) + u.y*u.z*(va-vc-ve+vg) + u.z*u.x*(va-vb-ve+vf) + (-va+vb+vc-vd+ve-vf-vg+vh)*u.x*u.y*u.z, // value\n ga + u.x*(gb-ga) + u.y*(gc-ga) + u.z*(ge-ga) + u.x*u.y*(ga-gb-gc+gd) + u.y*u.z*(ga-gc-ge+gg) + u.z*u.x*(ga-gb-ge+gf) + (-ga+gb+gc-gd+ge-gf-gg+gh)*u.x*u.y*u.z + // derivatives\n du * (vec3(vb,vc,ve) - va + u.yzx*vec3(va-vb-vc+vd,va-vc-ve+vg,va-vb-ve+vf) + u.zxy*vec3(va-vb-ve+vf,va-vb-vc+vd,va-vc-ve+vg) + u.yzx*u.zxy*(-va+vb+vc-vd+ve-vf-vg+vh) ));\n}\n\n#endif\n'},3700:n=>{n.exports='/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: fade\nuse: fade(<vec2|vec3|vec4> t)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_FADE\n#define FNC_FADE\nfloat fade(in float t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec2 fade(in vec2 t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec3 fade(in vec3 t) {\n return t * t * t * (t * (t * 6. - 15. ) + 10.);\n}\n\nvec4 fade(vec4 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Classic Perlin Noise with periodic variant https://github.com/ashima/webgl-noise\nuse: pnoise(<vec2|vec3|vec4> pos, <vec2|vec3|vec4> periodic)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n*/\n\n#ifndef FNC_PNOISE\n#define FNC_PNOISE\n// Classic Perlin noise, periodic variant\nfloat pnoise(in vec2 P, in vec2 rep) {\n vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0);\n vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0);\n Pi = mod(Pi, rep.xyxy); // To create noise with explicit period\n Pi = mod289(Pi); // To avoid truncation effects in permutation\n vec4 ix = Pi.xzxz;\n vec4 iy = Pi.yyww;\n vec4 fx = Pf.xzxz;\n vec4 fy = Pf.yyww;\n\n vec4 i = permute(permute(ix) + iy);\n\n vec4 gx = fract(i * (1.0 / 41.0)) * 2.0 - 1.0 ;\n vec4 gy = abs(gx) - 0.5 ;\n vec4 tx = floor(gx + 0.5);\n gx = gx - tx;\n\n vec2 g00 = vec2(gx.x,gy.x);\n vec2 g10 = vec2(gx.y,gy.y);\n vec2 g01 = vec2(gx.z,gy.z);\n vec2 g11 = vec2(gx.w,gy.w);\n\n vec4 norm = taylorInvSqrt(vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)));\n g00 *= norm.x;\n g01 *= norm.y;\n g10 *= norm.z;\n g11 *= norm.w;\n\n float n00 = dot(g00, vec2(fx.x, fy.x));\n float n10 = dot(g10, vec2(fx.y, fy.y));\n float n01 = dot(g01, vec2(fx.z, fy.z));\n float n11 = dot(g11, vec2(fx.w, fy.w));\n\n vec2 fade_xy = fade(Pf.xy);\n vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x);\n float n_xy = mix(n_x.x, n_x.y, fade_xy.y);\n return 2.3 * n_xy;\n}\n\nfloat pnoise(in vec3 P, in vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nfloat pnoise(in vec4 P, in vec4 rep) {\n vec4 Pi0 = mod(floor(P), rep); // Integer part modulo rep\n vec4 Pi1 = mod(Pi0 + 1.0, rep); // Integer part + 1 mod rep\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec4 Pf0 = fract(P); // Fractional part for interpolation\n vec4 Pf1 = Pf0 - 1.0; // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = vec4(Pi0.zzzz);\n vec4 iz1 = vec4(Pi1.zzzz);\n vec4 iw0 = vec4(Pi0.wwww);\n vec4 iw1 = vec4(Pi1.wwww);\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 ixy00 = permute(ixy0 + iw0);\n vec4 ixy01 = permute(ixy0 + iw1);\n vec4 ixy10 = permute(ixy1 + iw0);\n vec4 ixy11 = permute(ixy1 + iw1);\n\n vec4 gx00 = ixy00 * (1.0 / 7.0);\n vec4 gy00 = floor(gx00) * (1.0 / 7.0);\n vec4 gz00 = floor(gy00) * (1.0 / 6.0);\n gx00 = fract(gx00) - 0.5;\n gy00 = fract(gy00) - 0.5;\n gz00 = fract(gz00) - 0.5;\n vec4 gw00 = vec4(0.75) - abs(gx00) - abs(gy00) - abs(gz00);\n vec4 sw00 = step(gw00, vec4(0.0));\n gx00 -= sw00 * (step(0.0, gx00) - 0.5);\n gy00 -= sw00 * (step(0.0, gy00) - 0.5);\n\n vec4 gx01 = ixy01 * (1.0 / 7.0);\n vec4 gy01 = floor(gx01) * (1.0 / 7.0);\n vec4 gz01 = floor(gy01) * (1.0 / 6.0);\n gx01 = fract(gx01) - 0.5;\n gy01 = fract(gy01) - 0.5;\n gz01 = fract(gz01) - 0.5;\n vec4 gw01 = vec4(0.75) - abs(gx01) - abs(gy01) - abs(gz01);\n vec4 sw01 = step(gw01, vec4(0.0));\n gx01 -= sw01 * (step(0.0, gx01) - 0.5);\n gy01 -= sw01 * (step(0.0, gy01) - 0.5);\n\n vec4 gx10 = ixy10 * (1.0 / 7.0);\n vec4 gy10 = floor(gx10) * (1.0 / 7.0);\n vec4 gz10 = floor(gy10) * (1.0 / 6.0);\n gx10 = fract(gx10) - 0.5;\n gy10 = fract(gy10) - 0.5;\n gz10 = fract(gz10) - 0.5;\n vec4 gw10 = vec4(0.75) - abs(gx10) - abs(gy10) - abs(gz10);\n vec4 sw10 = step(gw10, vec4(0.0));\n gx10 -= sw10 * (step(0.0, gx10) - 0.5);\n gy10 -= sw10 * (step(0.0, gy10) - 0.5);\n\n vec4 gx11 = ixy11 * (1.0 / 7.0);\n vec4 gy11 = floor(gx11) * (1.0 / 7.0);\n vec4 gz11 = floor(gy11) * (1.0 / 6.0);\n gx11 = fract(gx11) - 0.5;\n gy11 = fract(gy11) - 0.5;\n gz11 = fract(gz11) - 0.5;\n vec4 gw11 = vec4(0.75) - abs(gx11) - abs(gy11) - abs(gz11);\n vec4 sw11 = step(gw11, vec4(0.0));\n gx11 -= sw11 * (step(0.0, gx11) - 0.5);\n gy11 -= sw11 * (step(0.0, gy11) - 0.5);\n\n vec4 g0000 = vec4(gx00.x,gy00.x,gz00.x,gw00.x);\n vec4 g1000 = vec4(gx00.y,gy00.y,gz00.y,gw00.y);\n vec4 g0100 = vec4(gx00.z,gy00.z,gz00.z,gw00.z);\n vec4 g1100 = vec4(gx00.w,gy00.w,gz00.w,gw00.w);\n vec4 g0010 = vec4(gx10.x,gy10.x,gz10.x,gw10.x);\n vec4 g1010 = vec4(gx10.y,gy10.y,gz10.y,gw10.y);\n vec4 g0110 = vec4(gx10.z,gy10.z,gz10.z,gw10.z);\n vec4 g1110 = vec4(gx10.w,gy10.w,gz10.w,gw10.w);\n vec4 g0001 = vec4(gx01.x,gy01.x,gz01.x,gw01.x);\n vec4 g1001 = vec4(gx01.y,gy01.y,gz01.y,gw01.y);\n vec4 g0101 = vec4(gx01.z,gy01.z,gz01.z,gw01.z);\n vec4 g1101 = vec4(gx01.w,gy01.w,gz01.w,gw01.w);\n vec4 g0011 = vec4(gx11.x,gy11.x,gz11.x,gw11.x);\n vec4 g1011 = vec4(gx11.y,gy11.y,gz11.y,gw11.y);\n vec4 g0111 = vec4(gx11.z,gy11.z,gz11.z,gw11.z);\n vec4 g1111 = vec4(gx11.w,gy11.w,gz11.w,gw11.w);\n\n vec4 norm00 = taylorInvSqrt(vec4(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100)));\n g0000 *= norm00.x;\n g0100 *= norm00.y;\n g1000 *= norm00.z;\n g1100 *= norm00.w;\n\n vec4 norm01 = taylorInvSqrt(vec4(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101)));\n g0001 *= norm01.x;\n g0101 *= norm01.y;\n g1001 *= norm01.z;\n g1101 *= norm01.w;\n\n vec4 norm10 = taylorInvSqrt(vec4(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110)));\n g0010 *= norm10.x;\n g0110 *= norm10.y;\n g1010 *= norm10.z;\n g1110 *= norm10.w;\n\n vec4 norm11 = taylorInvSqrt(vec4(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111)));\n g0011 *= norm11.x;\n g0111 *= norm11.y;\n g1011 *= norm11.z;\n g1111 *= norm11.w;\n\n float n0000 = dot(g0000, Pf0);\n float n1000 = dot(g1000, vec4(Pf1.x, Pf0.yzw));\n float n0100 = dot(g0100, vec4(Pf0.x, Pf1.y, Pf0.zw));\n float n1100 = dot(g1100, vec4(Pf1.xy, Pf0.zw));\n float n0010 = dot(g0010, vec4(Pf0.xy, Pf1.z, Pf0.w));\n float n1010 = dot(g1010, vec4(Pf1.x, Pf0.y, Pf1.z, Pf0.w));\n float n0110 = dot(g0110, vec4(Pf0.x, Pf1.yz, Pf0.w));\n float n1110 = dot(g1110, vec4(Pf1.xyz, Pf0.w));\n float n0001 = dot(g0001, vec4(Pf0.xyz, Pf1.w));\n float n1001 = dot(g1001, vec4(Pf1.x, Pf0.yz, Pf1.w));\n float n0101 = dot(g0101, vec4(Pf0.x, Pf1.y, Pf0.z, Pf1.w));\n float n1101 = dot(g1101, vec4(Pf1.xy, Pf0.z, Pf1.w));\n float n0011 = dot(g0011, vec4(Pf0.xy, Pf1.zw));\n float n1011 = dot(g1011, vec4(Pf1.x, Pf0.y, Pf1.zw));\n float n0111 = dot(g0111, vec4(Pf0.x, Pf1.yzw));\n float n1111 = dot(g1111, Pf1);\n\n vec4 fade_xyzw = fade(Pf0);\n vec4 n_0w = mix(vec4(n0000, n1000, n0100, n1100), vec4(n0001, n1001, n0101, n1101), fade_xyzw.w);\n vec4 n_1w = mix(vec4(n0010, n1010, n0110, n1110), vec4(n0011, n1011, n0111, n1111), fade_xyzw.w);\n vec4 n_zw = mix(n_0w, n_1w, fade_xyzw.z);\n vec2 n_yzw = mix(n_zw.xy, n_zw.zw, fade_xyzw.y);\n float n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x);\n return 2.2 * n_xyzw;\n}\n#endif\n'},6518:n=>{n.exports="/*\nauthor: Patricio Gonzalez Vivo\ndescription: pass a value and get some random normalize value between 0 and 1\nuse: float random[2|3](<float|vec2|vec3> value)\n*/\n\n#ifndef FNC_RANDOM\n#define FNC_RANDOM\nfloat random(in float x) {\n return fract(sin(x) * 43758.5453);\n}\n\nfloat random(in vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nfloat random(in vec3 pos) {\n return fract(sin(dot(pos.xyz, vec3(70.9898, 78.233, 32.4355))) * 43758.5453123);\n}\n\nfloat random(in vec4 pos) {\n float dot_product = dot(pos, vec4(12.9898,78.233,45.164,94.673));\n return fract(sin(dot_product) * 43758.5453);\n}\n\n// Hash function from https://www.shadertoy.com/view/4djSRW\n#ifndef RANDOM_SCALE3\n#define RANDOM_SCALE3 vec3(.1031, .1030, .0973)\n#endif\n\n#ifndef FANDOM_SCALE4\n#define FANDOM_SCALE4 vec4(1031, .1030, .0973, .1099)\n#endif\nvec2 random2(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec2 random2(in vec2 st) {\n const vec2 k = vec2(.3183099, .3678794);\n st = st * k + k.yx;\n return -1. + 2. * fract(16. * k * fract(st.x * st.y * (st.x + st.y)));\n}\n\nvec2 random2(vec3 p3) {\n p3 = fract(p3 * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec3 random3(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx); \n}\n\nvec3 random3(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yxz+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx);\n}\n\nvec3 random3(in vec3 p) {\n p = vec3( dot(p, vec3(127.1, 311.7, 74.7)),\n dot(p, vec3(269.5, 183.3, 246.1)),\n dot(p, vec3(113.5, 271.9, 124.6)));\n return -1. + 2. * fract(sin(p) * 43758.5453123);\n}\n\nvec4 random4(float p) {\n vec4 p4 = fract(vec4(p) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx); \n}\n\nvec4 random4(vec2 p) {\n vec4 p4 = fract(vec4(p.xyxy) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec3 p) {\n vec4 p4 = fract(vec4(p.xyzx) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec4 p4) {\n p4 = fract(p4 * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\n\n#endif\n"},6998:n=>{n.exports='/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: grad4, used for snoise(vec4 v)\nuse: grad4(<float> j, <vec4> ip)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_GRAD4\n#define FNC_GRAD4\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Simplex Noise https://github.com/ashima/webgl-noise\nuse: snoise(<vec2|vec3|vec4> pos)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n*/\n\n#ifndef FNC_SNOISE\n#define FNC_SNOISE\nfloat snoise(in vec2 v) {\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0\n //i1.y = 1.0 - i1.x;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n // x0 = x0 - 0.0 + 0.0 * C.xx ;\n // x1 = x0 - i1 + 1.0 * C.xx ;\n // x2 = x0 - 1.0 + 2.0 * C.xx ;\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\n\nfloat snoise(in vec3 v) {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n // Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients: 7x7 points over a square, mapped onto an octahedron.\n // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n //Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}\n\nfloat snoise(in vec4 v) {\n const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\n 0.276393202250021, // 2 * G4\n 0.414589803375032, // 3 * G4\n -0.447213595499958); // -1 + 4 * G4\n\n // First corner\n vec4 i = floor(v + dot(v, vec4(.309016994374947451)) ); // (sqrt(5) - 1)/4\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxxx\n // x1 = x0 - i1 + 1.0 * C.xxxx\n // x2 = x0 - i2 + 2.0 * C.xxxx\n // x3 = x0 - i3 + 3.0 * C.xxxx\n // x4 = x0 - 1.0 + 4.0 * C.xxxx\n vec4 x1 = x0 - i1 + C.xxxx;\n vec4 x2 = x0 - i2 + C.yyyy;\n vec4 x3 = x0 - i3 + C.zzzz;\n vec4 x4 = x0 + C.wwww;\n\n // Permutations\n i = mod289(i);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n}\n\nvec3 snoise3( vec3 x ){\n float s = snoise(vec3( x ));\n float s1 = snoise(vec3( x.y - 19.1 , x.z + 33.4 , x.x + 47.2 ));\n float s2 = snoise(vec3( x.z + 74.2 , x.x - 124.5 , x.y + 99.4 ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\nvec3 snoise3( vec4 x ){\n float s = snoise(vec4( x ));\n float s1 = snoise(vec4( x.y - 19.1 , x.z + 33.4 , x.x + 47.2, x.w ));\n float s2 = snoise(vec4( x.z + 74.2 , x.x - 124.5 , x.y + 99.4, x.w ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\n#endif\n'}},e={};function t(o){var i=e[o];if(void 0!==i)return i.exports;var c=e[o]={exports:{}};return n[o](c,c.exports,t),c.exports}t.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return t.d(e,{a:e}),e},t.d=(n,e)=>{for(var o in e)t.o(e,o)&&!t.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:e[o]})},t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var o={};(()=>{t.d(o,{Z:()=>y});var n=t(6998),e=t.n(n),i=t(678),c=t.n(i),r=t(4686),v=t.n(r),x=t(4401),a=t.n(x),s=t(6518),g=t.n(s),f=t(3700),d=t.n(f);const y={snoise:e(),cnoise:c(),fbm:v(),noised:a(),random:g(),pnoise:d()}})();var i=o.Z;export{i as default}; | ||
var n = { | ||
678: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: fade\nuse: fade(<vec2|vec3|vec4> t)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_FADE\n#define FNC_FADE\nfloat fade(in float t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec2 fade(in vec2 t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec3 fade(in vec3 t) {\n return t * t * t * (t * (t * 6. - 15. ) + 10.);\n}\n\nvec4 fade(vec4 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Classic Perlin Noise https://github.com/ashima/webgl-noise\nuse: cnoise(<vec2|vec3|vec4> pos)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef FNC_CNOISE\n#define FNC_CNOISE\n\nfloat cnoise(in vec2 P) {\n vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0);\n vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0);\n Pi = mod289(Pi); // To avoid truncation effects in permutation\n vec4 ix = Pi.xzxz;\n vec4 iy = Pi.yyww;\n vec4 fx = Pf.xzxz;\n vec4 fy = Pf.yyww;\n\n vec4 i = permute(permute(ix) + iy);\n\n vec4 gx = fract(i * (1.0 / 41.0)) * 2.0 - 1.0 ;\n vec4 gy = abs(gx) - 0.5 ;\n vec4 tx = floor(gx + 0.5);\n gx = gx - tx;\n\n vec2 g00 = vec2(gx.x,gy.x);\n vec2 g10 = vec2(gx.y,gy.y);\n vec2 g01 = vec2(gx.z,gy.z);\n vec2 g11 = vec2(gx.w,gy.w);\n\n vec4 norm = taylorInvSqrt(vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)));\n g00 *= norm.x;\n g01 *= norm.y;\n g10 *= norm.z;\n g11 *= norm.w;\n\n float n00 = dot(g00, vec2(fx.x, fy.x));\n float n10 = dot(g10, vec2(fx.y, fy.y));\n float n01 = dot(g01, vec2(fx.z, fy.z));\n float n11 = dot(g11, vec2(fx.w, fy.w));\n\n vec2 fade_xy = fade(Pf.xy);\n vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x);\n float n_xy = mix(n_x.x, n_x.y, fade_xy.y);\n return 2.3 * n_xy;\n}\n\nfloat cnoise(in vec3 P) {\n vec3 Pi0 = floor(P); // Integer part for indexing\n vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nfloat cnoise(in vec4 P) {\n vec4 Pi0 = floor(P); // Integer part for indexing\n vec4 Pi1 = Pi0 + 1.0; // Integer part + 1\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec4 Pf0 = fract(P); // Fractional part for interpolation\n vec4 Pf1 = Pf0 - 1.0; // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = vec4(Pi0.zzzz);\n vec4 iz1 = vec4(Pi1.zzzz);\n vec4 iw0 = vec4(Pi0.wwww);\n vec4 iw1 = vec4(Pi1.wwww);\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 ixy00 = permute(ixy0 + iw0);\n vec4 ixy01 = permute(ixy0 + iw1);\n vec4 ixy10 = permute(ixy1 + iw0);\n vec4 ixy11 = permute(ixy1 + iw1);\n\n vec4 gx00 = ixy00 * (1.0 / 7.0);\n vec4 gy00 = floor(gx00) * (1.0 / 7.0);\n vec4 gz00 = floor(gy00) * (1.0 / 6.0);\n gx00 = fract(gx00) - 0.5;\n gy00 = fract(gy00) - 0.5;\n gz00 = fract(gz00) - 0.5;\n vec4 gw00 = vec4(0.75) - abs(gx00) - abs(gy00) - abs(gz00);\n vec4 sw00 = step(gw00, vec4(0.0));\n gx00 -= sw00 * (step(0.0, gx00) - 0.5);\n gy00 -= sw00 * (step(0.0, gy00) - 0.5);\n\n vec4 gx01 = ixy01 * (1.0 / 7.0);\n vec4 gy01 = floor(gx01) * (1.0 / 7.0);\n vec4 gz01 = floor(gy01) * (1.0 / 6.0);\n gx01 = fract(gx01) - 0.5;\n gy01 = fract(gy01) - 0.5;\n gz01 = fract(gz01) - 0.5;\n vec4 gw01 = vec4(0.75) - abs(gx01) - abs(gy01) - abs(gz01);\n vec4 sw01 = step(gw01, vec4(0.0));\n gx01 -= sw01 * (step(0.0, gx01) - 0.5);\n gy01 -= sw01 * (step(0.0, gy01) - 0.5);\n\n vec4 gx10 = ixy10 * (1.0 / 7.0);\n vec4 gy10 = floor(gx10) * (1.0 / 7.0);\n vec4 gz10 = floor(gy10) * (1.0 / 6.0);\n gx10 = fract(gx10) - 0.5;\n gy10 = fract(gy10) - 0.5;\n gz10 = fract(gz10) - 0.5;\n vec4 gw10 = vec4(0.75) - abs(gx10) - abs(gy10) - abs(gz10);\n vec4 sw10 = step(gw10, vec4(0.0));\n gx10 -= sw10 * (step(0.0, gx10) - 0.5);\n gy10 -= sw10 * (step(0.0, gy10) - 0.5);\n\n vec4 gx11 = ixy11 * (1.0 / 7.0);\n vec4 gy11 = floor(gx11) * (1.0 / 7.0);\n vec4 gz11 = floor(gy11) * (1.0 / 6.0);\n gx11 = fract(gx11) - 0.5;\n gy11 = fract(gy11) - 0.5;\n gz11 = fract(gz11) - 0.5;\n vec4 gw11 = vec4(0.75) - abs(gx11) - abs(gy11) - abs(gz11);\n vec4 sw11 = step(gw11, vec4(0.0));\n gx11 -= sw11 * (step(0.0, gx11) - 0.5);\n gy11 -= sw11 * (step(0.0, gy11) - 0.5);\n\n vec4 g0000 = vec4(gx00.x,gy00.x,gz00.x,gw00.x);\n vec4 g1000 = vec4(gx00.y,gy00.y,gz00.y,gw00.y);\n vec4 g0100 = vec4(gx00.z,gy00.z,gz00.z,gw00.z);\n vec4 g1100 = vec4(gx00.w,gy00.w,gz00.w,gw00.w);\n vec4 g0010 = vec4(gx10.x,gy10.x,gz10.x,gw10.x);\n vec4 g1010 = vec4(gx10.y,gy10.y,gz10.y,gw10.y);\n vec4 g0110 = vec4(gx10.z,gy10.z,gz10.z,gw10.z);\n vec4 g1110 = vec4(gx10.w,gy10.w,gz10.w,gw10.w);\n vec4 g0001 = vec4(gx01.x,gy01.x,gz01.x,gw01.x);\n vec4 g1001 = vec4(gx01.y,gy01.y,gz01.y,gw01.y);\n vec4 g0101 = vec4(gx01.z,gy01.z,gz01.z,gw01.z);\n vec4 g1101 = vec4(gx01.w,gy01.w,gz01.w,gw01.w);\n vec4 g0011 = vec4(gx11.x,gy11.x,gz11.x,gw11.x);\n vec4 g1011 = vec4(gx11.y,gy11.y,gz11.y,gw11.y);\n vec4 g0111 = vec4(gx11.z,gy11.z,gz11.z,gw11.z);\n vec4 g1111 = vec4(gx11.w,gy11.w,gz11.w,gw11.w);\n\n vec4 norm00 = taylorInvSqrt(vec4(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100)));\n g0000 *= norm00.x;\n g0100 *= norm00.y;\n g1000 *= norm00.z;\n g1100 *= norm00.w;\n\n vec4 norm01 = taylorInvSqrt(vec4(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101)));\n g0001 *= norm01.x;\n g0101 *= norm01.y;\n g1001 *= norm01.z;\n g1101 *= norm01.w;\n\n vec4 norm10 = taylorInvSqrt(vec4(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110)));\n g0010 *= norm10.x;\n g0110 *= norm10.y;\n g1010 *= norm10.z;\n g1110 *= norm10.w;\n\n vec4 norm11 = taylorInvSqrt(vec4(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111)));\n g0011 *= norm11.x;\n g0111 *= norm11.y;\n g1011 *= norm11.z;\n g1111 *= norm11.w;\n\n float n0000 = dot(g0000, Pf0);\n float n1000 = dot(g1000, vec4(Pf1.x, Pf0.yzw));\n float n0100 = dot(g0100, vec4(Pf0.x, Pf1.y, Pf0.zw));\n float n1100 = dot(g1100, vec4(Pf1.xy, Pf0.zw));\n float n0010 = dot(g0010, vec4(Pf0.xy, Pf1.z, Pf0.w));\n float n1010 = dot(g1010, vec4(Pf1.x, Pf0.y, Pf1.z, Pf0.w));\n float n0110 = dot(g0110, vec4(Pf0.x, Pf1.yz, Pf0.w));\n float n1110 = dot(g1110, vec4(Pf1.xyz, Pf0.w));\n float n0001 = dot(g0001, vec4(Pf0.xyz, Pf1.w));\n float n1001 = dot(g1001, vec4(Pf1.x, Pf0.yz, Pf1.w));\n float n0101 = dot(g0101, vec4(Pf0.x, Pf1.y, Pf0.z, Pf1.w));\n float n1101 = dot(g1101, vec4(Pf1.xy, Pf0.z, Pf1.w));\n float n0011 = dot(g0011, vec4(Pf0.xy, Pf1.zw));\n float n1011 = dot(g1011, vec4(Pf1.x, Pf0.y, Pf1.zw));\n float n0111 = dot(g0111, vec4(Pf0.x, Pf1.yzw));\n float n1111 = dot(g1111, Pf1);\n\n vec4 fade_xyzw = fade(Pf0);\n vec4 n_0w = mix(vec4(n0000, n1000, n0100, n1100), vec4(n0001, n1001, n0101, n1101), fade_xyzw.w);\n vec4 n_1w = mix(vec4(n0010, n1010, n0110, n1110), vec4(n0011, n1011, n0111, n1111), fade_xyzw.w);\n vec4 n_zw = mix(n_0w, n_1w, fade_xyzw.z);\n vec2 n_yzw = mix(n_zw.xy, n_zw.zw, fade_xyzw.y);\n float n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x);\n return 2.2 * n_xyzw;\n}\n#endif\n' | ||
}, | ||
4686: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: grad4, used for snoise(vec4 v)\nuse: grad4(<float> j, <vec4> ip)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_GRAD4\n#define FNC_GRAD4\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Simplex Noise https://github.com/ashima/webgl-noise\nuse: snoise(<vec2|vec3|vec4> pos)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n*/\n\n#ifndef FNC_SNOISE\n#define FNC_SNOISE\nfloat snoise(in vec2 v) {\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0\n //i1.y = 1.0 - i1.x;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n // x0 = x0 - 0.0 + 0.0 * C.xx ;\n // x1 = x0 - i1 + 1.0 * C.xx ;\n // x2 = x0 - 1.0 + 2.0 * C.xx ;\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\n\nfloat snoise(in vec3 v) {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n // Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients: 7x7 points over a square, mapped onto an octahedron.\n // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n //Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}\n\nfloat snoise(in vec4 v) {\n const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\n 0.276393202250021, // 2 * G4\n 0.414589803375032, // 3 * G4\n -0.447213595499958); // -1 + 4 * G4\n\n // First corner\n vec4 i = floor(v + dot(v, vec4(.309016994374947451)) ); // (sqrt(5) - 1)/4\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxxx\n // x1 = x0 - i1 + 1.0 * C.xxxx\n // x2 = x0 - i2 + 2.0 * C.xxxx\n // x3 = x0 - i3 + 3.0 * C.xxxx\n // x4 = x0 - 1.0 + 4.0 * C.xxxx\n vec4 x1 = x0 - i1 + C.xxxx;\n vec4 x2 = x0 - i2 + C.yyyy;\n vec4 x3 = x0 - i3 + C.zzzz;\n vec4 x4 = x0 + C.wwww;\n\n // Permutations\n i = mod289(i);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n}\n\nvec3 snoise3( vec3 x ){\n float s = snoise(vec3( x ));\n float s1 = snoise(vec3( x.y - 19.1 , x.z + 33.4 , x.x + 47.2 ));\n float s2 = snoise(vec3( x.z + 74.2 , x.x - 124.5 , x.y + 99.4 ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\nvec3 snoise3( vec4 x ){\n float s = snoise(vec4( x ));\n float s1 = snoise(vec4( x.y - 19.1 , x.z + 33.4 , x.x + 47.2, x.w ));\n float s2 = snoise(vec4( x.z + 74.2 , x.x - 124.5 , x.y + 99.4, x.w ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Fractal Brownian Motion\nuse: fbm(<vec2> pos)\noptions:\n FBM_OCTAVES: numbers of octaves. Default is 4.\n FBM_NOISE_FNC(POS_UV): noise function to use Default \'snoise(POS_UV)\' (simplex noise)\n FBM_VALUE_INITIAL: initial value. Default is 0.\n FBM_SCALE_SCALAR: scalar. Defualt is 2.\n FBM_AMPLITUD_INITIAL: initial amplitud value. Default is 0.5\n FBM_AMPLITUD_SCALAR: amplitud scalar. Default is 0.5\n*/\n\n#ifndef FBM_OCTAVES\n#define FBM_OCTAVES 4\n#endif\n\n#ifndef FBM_NOISE_FNC\n#define FBM_NOISE_FNC(POS_UV) snoise(POS_UV)\n#endif\n\n#ifndef FBM_VALUE_INITIAL\n#define FBM_VALUE_INITIAL 0.0\n#endif\n\n#ifndef FBM_SCALE_SCALAR\n#define FBM_SCALE_SCALAR 2.0\n#endif\n\n#ifndef FBM_AMPLITUD_INITIAL\n#define FBM_AMPLITUD_INITIAL 0.5\n#endif\n\n#ifndef FBM_AMPLITUD_SCALAR\n#define FBM_AMPLITUD_SCALAR 0.5\n#endif\n\n#ifndef FNC_FBM\n#define FNC_FBM\nfloat fbm(in vec2 st) {\n // Initial values\n float value = FBM_VALUE_INITIAL;\n float amplitud = FBM_AMPLITUD_INITIAL;\n\n // Loop of octaves\n for (int i = 0; i < FBM_OCTAVES; i++) {\n value += amplitud * FBM_NOISE_FNC(st);\n st *= FBM_SCALE_SCALAR;\n amplitud *= FBM_AMPLITUD_SCALAR;\n }\n return value;\n}\n\nfloat fbm(in vec3 pos) {\n // Initial values\n float value = FBM_VALUE_INITIAL;\n float amplitud = FBM_AMPLITUD_INITIAL;\n\n // Loop of octaves\n for (int i = 0; i < FBM_OCTAVES; i++) {\n value += amplitud * FBM_NOISE_FNC(pos);\n pos *= FBM_SCALE_SCALAR;\n amplitud *= FBM_AMPLITUD_SCALAR;\n }\n return value;\n}\n#endif\n' | ||
}, | ||
4401: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: pass a value and get some random normalize value between 0 and 1\nuse: float random[2|3](<float|vec2|vec3> value)\n*/\n\n#ifndef FNC_RANDOM\n#define FNC_RANDOM\nfloat random(in float x) {\n return fract(sin(x) * 43758.5453);\n}\n\nfloat random(in vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nfloat random(in vec3 pos) {\n return fract(sin(dot(pos.xyz, vec3(70.9898, 78.233, 32.4355))) * 43758.5453123);\n}\n\nfloat random(in vec4 pos) {\n float dot_product = dot(pos, vec4(12.9898,78.233,45.164,94.673));\n return fract(sin(dot_product) * 43758.5453);\n}\n\n// Hash function from https://www.shadertoy.com/view/4djSRW\n#ifndef RANDOM_SCALE3\n#define RANDOM_SCALE3 vec3(.1031, .1030, .0973)\n#endif\n\n#ifndef FANDOM_SCALE4\n#define FANDOM_SCALE4 vec4(1031, .1030, .0973, .1099)\n#endif\nvec2 random2(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec2 random2(in vec2 st) {\n const vec2 k = vec2(.3183099, .3678794);\n st = st * k + k.yx;\n return -1. + 2. * fract(16. * k * fract(st.x * st.y * (st.x + st.y)));\n}\n\nvec2 random2(vec3 p3) {\n p3 = fract(p3 * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec3 random3(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx); \n}\n\nvec3 random3(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yxz+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx);\n}\n\nvec3 random3(in vec3 p) {\n p = vec3( dot(p, vec3(127.1, 311.7, 74.7)),\n dot(p, vec3(269.5, 183.3, 246.1)),\n dot(p, vec3(113.5, 271.9, 124.6)));\n return -1. + 2. * fract(sin(p) * 43758.5453123);\n}\n\nvec4 random4(float p) {\n vec4 p4 = fract(vec4(p) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx); \n}\n\nvec4 random4(vec2 p) {\n vec4 p4 = fract(vec4(p.xyxy) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec3 p) {\n vec4 p4 = fract(vec4(p.xyzx) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec4 p4) {\n p4 = fract(p4 * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\n\n#endif\n\n\n/*\nauthor: Inigo Quilez\ndescription: returns 2D/3D value noise in the first channel and in the rest the derivatives. For more details read this nice article http://www.iquilezles.org/www/articles/gradientnoise/gradientnoise.htm\nuse: noised(<vec2|vec3> space)\noptions:\n NOISED_QUINTIC_INTERPOLATION: Quintic interpolation on/off. Default is off.\nlicense: |\n Copyright © 2017 Inigo Quilez\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_NOISED\n#define FNC_NOISED\n\n// return gradient noise (in x) and its derivatives (in yz)\nvec3 noised (in vec2 p) {\n // grid\n vec2 i = floor( p );\n vec2 f = fract( p );\n\n#ifdef NOISED_QUINTIC_INTERPOLATION\n // quintic interpolation\n vec2 u = f * f * f * (f * (f * 6. - 15.) + 10.);\n vec2 du = 30. * f * f * (f * (f - 2.) + 1.);\n#else\n // cubic interpolation\n vec2 u = f * f * (3. - 2. * f);\n vec2 du = 6. * f * (1. - f);\n#endif\n\n vec2 ga = random2(i + vec2(0., 0.));\n vec2 gb = random2(i + vec2(1., 0.));\n vec2 gc = random2(i + vec2(0., 1.));\n vec2 gd = random2(i + vec2(1., 1.));\n\n float va = dot(ga, f - vec2(0., 0.));\n float vb = dot(gb, f - vec2(1., 0.));\n float vc = dot(gc, f - vec2(0., 1.));\n float vd = dot(gd, f - vec2(1., 1.));\n\n return vec3( va + u.x*(vb-va) + u.y*(vc-va) + u.x*u.y*(va-vb-vc+vd), // value\n ga + u.x*(gb-ga) + u.y*(gc-ga) + u.x*u.y*(ga-gb-gc+gd) + // derivatives\n du * (u.yx*(va-vb-vc+vd) + vec2(vb,vc) - va));\n}\n\n// returns 3D value noise (in .x) and its derivatives (in .yzw)\n// https://www.shadertoy.com/view/4dffRH\nvec4 noised (in vec3 pos) {\n // grid\n vec3 p = floor(pos);\n vec3 w = fract(pos);\n\n#ifdef NOISED_QUINTIC_INTERPOLATION\n // quintic interpolant\n vec3 u = w * w * w * ( w * (w * 6. - 15.) + 10. );\n vec3 du = 30.0 * w * w * ( w * (w - 2.) + 1.);\n#else\n // cubic interpolant\n vec3 u = w * w * (3. - 2. * w);\n vec3 du = 6. * w * (1. - w);\n#endif\n\n // gradients\n vec3 ga = random3(p + vec3(0., 0., 0.));\n vec3 gb = random3(p + vec3(1., 0., 0.));\n vec3 gc = random3(p + vec3(0., 1., 0.));\n vec3 gd = random3(p + vec3(1., 1., 0.));\n vec3 ge = random3(p + vec3(0., 0., 1.));\n vec3 gf = random3(p + vec3(1., 0., 1.));\n vec3 gg = random3(p + vec3(0., 1., 1.));\n vec3 gh = random3(p + vec3(1., 1., 1.));\n\n // projections\n float va = dot(ga, w - vec3(0., 0., 0.));\n float vb = dot(gb, w - vec3(1., 0., 0.));\n float vc = dot(gc, w - vec3(0., 1., 0.));\n float vd = dot(gd, w - vec3(1., 1., 0.));\n float ve = dot(ge, w - vec3(0., 0., 1.));\n float vf = dot(gf, w - vec3(1., 0., 1.));\n float vg = dot(gg, w - vec3(0., 1., 1.));\n float vh = dot(gh, w - vec3(1., 1., 1.));\n\n // interpolations\n return vec4( va + u.x*(vb-va) + u.y*(vc-va) + u.z*(ve-va) + u.x*u.y*(va-vb-vc+vd) + u.y*u.z*(va-vc-ve+vg) + u.z*u.x*(va-vb-ve+vf) + (-va+vb+vc-vd+ve-vf-vg+vh)*u.x*u.y*u.z, // value\n ga + u.x*(gb-ga) + u.y*(gc-ga) + u.z*(ge-ga) + u.x*u.y*(ga-gb-gc+gd) + u.y*u.z*(ga-gc-ge+gg) + u.z*u.x*(ga-gb-ge+gf) + (-ga+gb+gc-gd+ge-gf-gg+gh)*u.x*u.y*u.z + // derivatives\n du * (vec3(vb,vc,ve) - va + u.yzx*vec3(va-vb-vc+vd,va-vc-ve+vg,va-vb-ve+vf) + u.zxy*vec3(va-vb-ve+vf,va-vb-vc+vd,va-vc-ve+vg) + u.yzx*u.zxy*(-va+vb+vc-vd+ve-vf-vg+vh) ));\n}\n\n#endif\n' | ||
}, | ||
3700: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: fade\nuse: fade(<vec2|vec3|vec4> t)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_FADE\n#define FNC_FADE\nfloat fade(in float t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec2 fade(in vec2 t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec3 fade(in vec3 t) {\n return t * t * t * (t * (t * 6. - 15. ) + 10.);\n}\n\nvec4 fade(vec4 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Classic Perlin Noise with periodic variant https://github.com/ashima/webgl-noise\nuse: pnoise(<vec2|vec3|vec4> pos, <vec2|vec3|vec4> periodic)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n*/\n\n#ifndef FNC_PNOISE\n#define FNC_PNOISE\n// Classic Perlin noise, periodic variant\nfloat pnoise(in vec2 P, in vec2 rep) {\n vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0);\n vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0);\n Pi = mod(Pi, rep.xyxy); // To create noise with explicit period\n Pi = mod289(Pi); // To avoid truncation effects in permutation\n vec4 ix = Pi.xzxz;\n vec4 iy = Pi.yyww;\n vec4 fx = Pf.xzxz;\n vec4 fy = Pf.yyww;\n\n vec4 i = permute(permute(ix) + iy);\n\n vec4 gx = fract(i * (1.0 / 41.0)) * 2.0 - 1.0 ;\n vec4 gy = abs(gx) - 0.5 ;\n vec4 tx = floor(gx + 0.5);\n gx = gx - tx;\n\n vec2 g00 = vec2(gx.x,gy.x);\n vec2 g10 = vec2(gx.y,gy.y);\n vec2 g01 = vec2(gx.z,gy.z);\n vec2 g11 = vec2(gx.w,gy.w);\n\n vec4 norm = taylorInvSqrt(vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)));\n g00 *= norm.x;\n g01 *= norm.y;\n g10 *= norm.z;\n g11 *= norm.w;\n\n float n00 = dot(g00, vec2(fx.x, fy.x));\n float n10 = dot(g10, vec2(fx.y, fy.y));\n float n01 = dot(g01, vec2(fx.z, fy.z));\n float n11 = dot(g11, vec2(fx.w, fy.w));\n\n vec2 fade_xy = fade(Pf.xy);\n vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x);\n float n_xy = mix(n_x.x, n_x.y, fade_xy.y);\n return 2.3 * n_xy;\n}\n\nfloat pnoise(in vec3 P, in vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nfloat pnoise(in vec4 P, in vec4 rep) {\n vec4 Pi0 = mod(floor(P), rep); // Integer part modulo rep\n vec4 Pi1 = mod(Pi0 + 1.0, rep); // Integer part + 1 mod rep\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec4 Pf0 = fract(P); // Fractional part for interpolation\n vec4 Pf1 = Pf0 - 1.0; // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = vec4(Pi0.zzzz);\n vec4 iz1 = vec4(Pi1.zzzz);\n vec4 iw0 = vec4(Pi0.wwww);\n vec4 iw1 = vec4(Pi1.wwww);\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 ixy00 = permute(ixy0 + iw0);\n vec4 ixy01 = permute(ixy0 + iw1);\n vec4 ixy10 = permute(ixy1 + iw0);\n vec4 ixy11 = permute(ixy1 + iw1);\n\n vec4 gx00 = ixy00 * (1.0 / 7.0);\n vec4 gy00 = floor(gx00) * (1.0 / 7.0);\n vec4 gz00 = floor(gy00) * (1.0 / 6.0);\n gx00 = fract(gx00) - 0.5;\n gy00 = fract(gy00) - 0.5;\n gz00 = fract(gz00) - 0.5;\n vec4 gw00 = vec4(0.75) - abs(gx00) - abs(gy00) - abs(gz00);\n vec4 sw00 = step(gw00, vec4(0.0));\n gx00 -= sw00 * (step(0.0, gx00) - 0.5);\n gy00 -= sw00 * (step(0.0, gy00) - 0.5);\n\n vec4 gx01 = ixy01 * (1.0 / 7.0);\n vec4 gy01 = floor(gx01) * (1.0 / 7.0);\n vec4 gz01 = floor(gy01) * (1.0 / 6.0);\n gx01 = fract(gx01) - 0.5;\n gy01 = fract(gy01) - 0.5;\n gz01 = fract(gz01) - 0.5;\n vec4 gw01 = vec4(0.75) - abs(gx01) - abs(gy01) - abs(gz01);\n vec4 sw01 = step(gw01, vec4(0.0));\n gx01 -= sw01 * (step(0.0, gx01) - 0.5);\n gy01 -= sw01 * (step(0.0, gy01) - 0.5);\n\n vec4 gx10 = ixy10 * (1.0 / 7.0);\n vec4 gy10 = floor(gx10) * (1.0 / 7.0);\n vec4 gz10 = floor(gy10) * (1.0 / 6.0);\n gx10 = fract(gx10) - 0.5;\n gy10 = fract(gy10) - 0.5;\n gz10 = fract(gz10) - 0.5;\n vec4 gw10 = vec4(0.75) - abs(gx10) - abs(gy10) - abs(gz10);\n vec4 sw10 = step(gw10, vec4(0.0));\n gx10 -= sw10 * (step(0.0, gx10) - 0.5);\n gy10 -= sw10 * (step(0.0, gy10) - 0.5);\n\n vec4 gx11 = ixy11 * (1.0 / 7.0);\n vec4 gy11 = floor(gx11) * (1.0 / 7.0);\n vec4 gz11 = floor(gy11) * (1.0 / 6.0);\n gx11 = fract(gx11) - 0.5;\n gy11 = fract(gy11) - 0.5;\n gz11 = fract(gz11) - 0.5;\n vec4 gw11 = vec4(0.75) - abs(gx11) - abs(gy11) - abs(gz11);\n vec4 sw11 = step(gw11, vec4(0.0));\n gx11 -= sw11 * (step(0.0, gx11) - 0.5);\n gy11 -= sw11 * (step(0.0, gy11) - 0.5);\n\n vec4 g0000 = vec4(gx00.x,gy00.x,gz00.x,gw00.x);\n vec4 g1000 = vec4(gx00.y,gy00.y,gz00.y,gw00.y);\n vec4 g0100 = vec4(gx00.z,gy00.z,gz00.z,gw00.z);\n vec4 g1100 = vec4(gx00.w,gy00.w,gz00.w,gw00.w);\n vec4 g0010 = vec4(gx10.x,gy10.x,gz10.x,gw10.x);\n vec4 g1010 = vec4(gx10.y,gy10.y,gz10.y,gw10.y);\n vec4 g0110 = vec4(gx10.z,gy10.z,gz10.z,gw10.z);\n vec4 g1110 = vec4(gx10.w,gy10.w,gz10.w,gw10.w);\n vec4 g0001 = vec4(gx01.x,gy01.x,gz01.x,gw01.x);\n vec4 g1001 = vec4(gx01.y,gy01.y,gz01.y,gw01.y);\n vec4 g0101 = vec4(gx01.z,gy01.z,gz01.z,gw01.z);\n vec4 g1101 = vec4(gx01.w,gy01.w,gz01.w,gw01.w);\n vec4 g0011 = vec4(gx11.x,gy11.x,gz11.x,gw11.x);\n vec4 g1011 = vec4(gx11.y,gy11.y,gz11.y,gw11.y);\n vec4 g0111 = vec4(gx11.z,gy11.z,gz11.z,gw11.z);\n vec4 g1111 = vec4(gx11.w,gy11.w,gz11.w,gw11.w);\n\n vec4 norm00 = taylorInvSqrt(vec4(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100)));\n g0000 *= norm00.x;\n g0100 *= norm00.y;\n g1000 *= norm00.z;\n g1100 *= norm00.w;\n\n vec4 norm01 = taylorInvSqrt(vec4(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101)));\n g0001 *= norm01.x;\n g0101 *= norm01.y;\n g1001 *= norm01.z;\n g1101 *= norm01.w;\n\n vec4 norm10 = taylorInvSqrt(vec4(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110)));\n g0010 *= norm10.x;\n g0110 *= norm10.y;\n g1010 *= norm10.z;\n g1110 *= norm10.w;\n\n vec4 norm11 = taylorInvSqrt(vec4(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111)));\n g0011 *= norm11.x;\n g0111 *= norm11.y;\n g1011 *= norm11.z;\n g1111 *= norm11.w;\n\n float n0000 = dot(g0000, Pf0);\n float n1000 = dot(g1000, vec4(Pf1.x, Pf0.yzw));\n float n0100 = dot(g0100, vec4(Pf0.x, Pf1.y, Pf0.zw));\n float n1100 = dot(g1100, vec4(Pf1.xy, Pf0.zw));\n float n0010 = dot(g0010, vec4(Pf0.xy, Pf1.z, Pf0.w));\n float n1010 = dot(g1010, vec4(Pf1.x, Pf0.y, Pf1.z, Pf0.w));\n float n0110 = dot(g0110, vec4(Pf0.x, Pf1.yz, Pf0.w));\n float n1110 = dot(g1110, vec4(Pf1.xyz, Pf0.w));\n float n0001 = dot(g0001, vec4(Pf0.xyz, Pf1.w));\n float n1001 = dot(g1001, vec4(Pf1.x, Pf0.yz, Pf1.w));\n float n0101 = dot(g0101, vec4(Pf0.x, Pf1.y, Pf0.z, Pf1.w));\n float n1101 = dot(g1101, vec4(Pf1.xy, Pf0.z, Pf1.w));\n float n0011 = dot(g0011, vec4(Pf0.xy, Pf1.zw));\n float n1011 = dot(g1011, vec4(Pf1.x, Pf0.y, Pf1.zw));\n float n0111 = dot(g0111, vec4(Pf0.x, Pf1.yzw));\n float n1111 = dot(g1111, Pf1);\n\n vec4 fade_xyzw = fade(Pf0);\n vec4 n_0w = mix(vec4(n0000, n1000, n0100, n1100), vec4(n0001, n1001, n0101, n1101), fade_xyzw.w);\n vec4 n_1w = mix(vec4(n0010, n1010, n0110, n1110), vec4(n0011, n1011, n0111, n1111), fade_xyzw.w);\n vec4 n_zw = mix(n_0w, n_1w, fade_xyzw.z);\n vec2 n_yzw = mix(n_zw.xy, n_zw.zw, fade_xyzw.y);\n float n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x);\n return 2.2 * n_xyzw;\n}\n#endif\n' | ||
}, | ||
6518: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: pass a value and get some random normalize value between 0 and 1\nuse: float random[2|3](<float|vec2|vec3> value)\n*/\n\n#ifndef FNC_RANDOM\n#define FNC_RANDOM\nfloat random(in float x) {\n return fract(sin(x) * 43758.5453);\n}\n\nfloat random(in vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nfloat random(in vec3 pos) {\n return fract(sin(dot(pos.xyz, vec3(70.9898, 78.233, 32.4355))) * 43758.5453123);\n}\n\nfloat random(in vec4 pos) {\n float dot_product = dot(pos, vec4(12.9898,78.233,45.164,94.673));\n return fract(sin(dot_product) * 43758.5453);\n}\n\n// Hash function from https://www.shadertoy.com/view/4djSRW\n#ifndef RANDOM_SCALE3\n#define RANDOM_SCALE3 vec3(.1031, .1030, .0973)\n#endif\n\n#ifndef FANDOM_SCALE4\n#define FANDOM_SCALE4 vec4(1031, .1030, .0973, .1099)\n#endif\nvec2 random2(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec2 random2(in vec2 st) {\n const vec2 k = vec2(.3183099, .3678794);\n st = st * k + k.yx;\n return -1. + 2. * fract(16. * k * fract(st.x * st.y * (st.x + st.y)));\n}\n\nvec2 random2(vec3 p3) {\n p3 = fract(p3 * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec3 random3(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx); \n}\n\nvec3 random3(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yxz+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx);\n}\n\nvec3 random3(in vec3 p) {\n p = vec3( dot(p, vec3(127.1, 311.7, 74.7)),\n dot(p, vec3(269.5, 183.3, 246.1)),\n dot(p, vec3(113.5, 271.9, 124.6)));\n return -1. + 2. * fract(sin(p) * 43758.5453123);\n}\n\nvec4 random4(float p) {\n vec4 p4 = fract(vec4(p) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx); \n}\n\nvec4 random4(vec2 p) {\n vec4 p4 = fract(vec4(p.xyxy) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec3 p) {\n vec4 p4 = fract(vec4(p.xyzx) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec4 p4) {\n p4 = fract(p4 * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\n\n#endif\n' | ||
}, | ||
6998: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: grad4, used for snoise(vec4 v)\nuse: grad4(<float> j, <vec4> ip)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_GRAD4\n#define FNC_GRAD4\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Simplex Noise https://github.com/ashima/webgl-noise\nuse: snoise(<vec2|vec3|vec4> pos)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n*/\n\n#ifndef FNC_SNOISE\n#define FNC_SNOISE\nfloat snoise(in vec2 v) {\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0\n //i1.y = 1.0 - i1.x;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n // x0 = x0 - 0.0 + 0.0 * C.xx ;\n // x1 = x0 - i1 + 1.0 * C.xx ;\n // x2 = x0 - 1.0 + 2.0 * C.xx ;\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\n\nfloat snoise(in vec3 v) {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n // Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients: 7x7 points over a square, mapped onto an octahedron.\n // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n //Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}\n\nfloat snoise(in vec4 v) {\n const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\n 0.276393202250021, // 2 * G4\n 0.414589803375032, // 3 * G4\n -0.447213595499958); // -1 + 4 * G4\n\n // First corner\n vec4 i = floor(v + dot(v, vec4(.309016994374947451)) ); // (sqrt(5) - 1)/4\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxxx\n // x1 = x0 - i1 + 1.0 * C.xxxx\n // x2 = x0 - i2 + 2.0 * C.xxxx\n // x3 = x0 - i3 + 3.0 * C.xxxx\n // x4 = x0 - 1.0 + 4.0 * C.xxxx\n vec4 x1 = x0 - i1 + C.xxxx;\n vec4 x2 = x0 - i2 + C.yyyy;\n vec4 x3 = x0 - i3 + C.zzzz;\n vec4 x4 = x0 + C.wwww;\n\n // Permutations\n i = mod289(i);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n}\n\nvec3 snoise3( vec3 x ){\n float s = snoise(vec3( x ));\n float s1 = snoise(vec3( x.y - 19.1 , x.z + 33.4 , x.x + 47.2 ));\n float s2 = snoise(vec3( x.z + 74.2 , x.x - 124.5 , x.y + 99.4 ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\nvec3 snoise3( vec4 x ){\n float s = snoise(vec4( x ));\n float s1 = snoise(vec4( x.y - 19.1 , x.z + 33.4 , x.x + 47.2, x.w ));\n float s2 = snoise(vec4( x.z + 74.2 , x.x - 124.5 , x.y + 99.4, x.w ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\n#endif\n' | ||
}, | ||
}, | ||
e = {} | ||
function t(o) { | ||
var i = e[o] | ||
if (void 0 !== i) return i.exports | ||
var c = (e[o] = { exports: {} }) | ||
return n[o](c, c.exports, t), c.exports | ||
} | ||
;(t.d = (n, e) => { | ||
for (var o in e) | ||
t.o(e, o) && | ||
!t.o(n, o) && | ||
Object.defineProperty(n, o, { enumerable: !0, get: e[o] }) | ||
}), | ||
(t.o = (n, e) => Object.prototype.hasOwnProperty.call(n, e)) | ||
var o = {} | ||
;(() => { | ||
t.d(o, { Z: () => n }) | ||
const n = { | ||
snoise: t(6998), | ||
cnoise: t(678), | ||
fbm: t(4686), | ||
noised: t(4401), | ||
random: t(6518), | ||
pnoise: t(3700), | ||
} | ||
})() | ||
var i = o.Z | ||
export { i as default } |
@@ -1,1 +0,149 @@ | ||
var n={8236:n=>{n.exports='/*\nauthor: Brad Larson\ndescription: adaptive threshold from https://github.com/BradLarson/GPUImage/blob/master/framework/Source/GPUImageAdaptiveThresholdFilter.m\nuse: adaptiveThreshold(<float> value, <float> blur_value, <float> bias)\nlicense: |\n Copyright (c) 2012, Brad Larson, Ben Cochran, Hugues Lismonde, Keitaroh Kobayashi, Alaric Cole, Matthew Clark, Jacob Gundersen, Chris Williams.\n All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef FNC_ADAPTIVETHRESHOLD\n#define FNC_ADAPTIVETHRESHOLD\nfloat adaptiveThreshold(in float value, in float blur_value, in float bias) {\n return step(blur_value + bias, value);\n}\n\nfloat adaptiveThreshold(in float value, in float blur_value) {\n return step(blur_value - 0.05, value);\n}\n#endif\n'},6951:n=>{n.exports="#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n"},7877:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: decimate a value with an specific presicion \nuse: decimation(<float|vec2|vec3|vec4> value, <float|vec2|vec3|vec4> presicion)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_DECIMATION\n#define FNC_DECIMATION\n#define decimation(value, presicion) (floor(value * presicion)/presicion)\n#endif'},1496:n=>{n.exports="/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: fade\nuse: fade(<vec2|vec3|vec4> t)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_FADE\n#define FNC_FADE\nfloat fade(in float t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec2 fade(in vec2 t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec3 fade(in vec3 t) {\n return t * t * t * (t * (t * 6. - 15. ) + 10.);\n}\n\nvec4 fade(vec4 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n#endif\n"},2381:n=>{n.exports="/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: grad4, used for snoise(vec4 v)\nuse: grad4(<float> j, <vec4> ip)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_GRAD4\n#define FNC_GRAD4\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n#endif\n"},1056:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Squared length\nuse: lengthSq(<vec2|float2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LENGTHSQ\n#define FNC_LENGTHSQ\nfloat lengthSq(in vec2 st) {\n return dot(st, st);\n}\n\nfloat lengthSq(in vec3 pos) {\n return dot(pos, pos);\n}\n#endif\n'},1578:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: clamp a value between 0 and 1\nuse: saturation(<float|vec2|vec3|vec4> value)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_SATURATE\n#define FNC_SATURATE\n// #define saturate(x) clamp(x, 0.0, 1.0)\nfloat saturate( float x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec2 saturate( vec2 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec3 saturate( vec3 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec4 saturate( vec4 x) {\n return clamp(x, 0.0, 1.0);\n}\n#endif\n\n/*\nauthor: Johan Ismael\ndescription: Map a value between one range to another.\nuse: map(<float|vec2|vec3|vec4> value, <float|vec2|vec3|vec4> inMin, <float|vec2|vec3|vec4> inMax, <float|vec2|vec3|vec4> outMin, <float|vec2|vec3|vec4> outMax)\nlicense: |\n Copyright (c) 2017 Johan Ismael.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_MAP\n#define FNC_MAP\n\nfloat map( float value, float inMin, float inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nvec2 map( vec2 value, vec2 inMin, vec2 inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nvec3 map( vec3 value, vec3 inMin, vec3 inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nvec4 map( vec4 value, vec4 inMin, vec4 inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nfloat map(in float value, in float inMin, in float inMax, in float outMin, in float outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\nvec2 map(in vec2 value, in vec2 inMin, in vec2 inMax, in vec2 outMin, in vec2 outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\nvec3 map(in vec3 value, in vec3 inMin, in vec3 inMax, in vec3 outMin, in vec3 outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\nvec4 map(in vec4 value, in vec4 inMin, in vec4 inMax, in vec4 outMin, in vec4 outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\n#endif\n'},4688:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: extend GLSL Max function to add more arguments\nuse: \n - max(<float> A, <float> B, <float> C[, <float> D])\n - max(<vec2|vec3|vec4> A)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_MAX\n#define FNC_MAX\nfloat max(in float a, in float b, in float c) {\n return max(a, max(b, c));\n}\n\nfloat max(in float a, in float b, in float c, in float d) {\n return max(max(a, b), max(c, d));\n}\n\nfloat max(const vec2 v) {\n return max(v.x, v.y);\n}\n\nfloat max(const vec3 v) {\n return max(v.x, v.y, v.z);\n}\n\nfloat max(const vec4 v) {\n return max(v.x, v.y, v.z, v.w);\n}\n#endif\n'},254:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: extend GLSL min function to add more arguments\nuse: \n - min(<float> A, <float> B, <float> C[, <float> D])\n - min(<vec2|vec3|vec4> A)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_MIN\n#define FNC_MIN\nfloat min(in float a, in float b, in float c) {\n return min(a, min(b, c));\n}\n\nfloat min(in float a, in float b, in float c, in float d) {\n return min(min(a,b), min(c, d));\n}\n\nfloat min(const vec2 v) {\n return min(v.x, v.y);\n}\n\nfloat min(const vec3 v) {\n return min(v.x, v.y, v.z);\n}\n\nfloat min(const vec4 v) {\n return min(v.x, v.y, v.z, v.w);\n}\n#endif\n'},5824:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: expands mix to linearly mix more than two values\nuse: mix(<float|vec2|vec3|vec4> a, <float|vec2|vec3|vec4> b, <float|vec2|vec3|vec4> c [, <float|vec2|vec3|vec4> d], <float> pct)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_MIX\n#define FNC_MIX\nfloat mix(float a , float b, float c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec2 mix(vec2 a , vec2 b, vec2 c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec2 mix(vec2 a , vec2 b, vec2 c, vec2 pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec3 mix(vec3 a , vec3 b, vec3 c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec3 mix(vec3 a , vec3 b, vec3 c, vec3 pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec4 mix(vec4 a , vec4 b, vec4 c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec4 mix(vec4 a , vec4 b, vec4 c, vec4 pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nfloat mix(in float a , in float b, in float c, in float d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec2 mix(in vec2 a , in vec2 b, in vec2 c, in vec2 d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec2 mix(in vec2 a , in vec2 b, in vec2 c, in vec2 d, in vec2 pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec3 mix(in vec3 a , in vec3 b, in vec3 c, in vec3 d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec3 mix(in vec3 a , in vec3 b, in vec3 c, in vec3 d, in vec3 pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec4 mix(in vec4 a , in vec4 b, in vec4 c, in vec4 d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec4 mix(in vec4 a , in vec4 b, in vec4 c, in vec4 d, in vec4 pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n#endif\n'},7802:n=>{n.exports="/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n"},1:n=>{n.exports="/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n"},5661:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 2\nuse: pow2(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW2\n#define FNC_POW2\nfloat pow2(in float x) {\n return x * x;\n}\n\nvec2 pow2(in vec2 x) {\n return x * x;\n}\n\nvec3 pow2(in vec3 x) {\n return x * x;\n}\n\nvec4 pow2(in vec4 x) {\n return x * x;\n}\n#endif\n'},1759:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 3\nuse: pow3(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW3\n#define FNC_POW3\nfloat pow3(in float x) {\n return x * x * x;\n}\n\nvec2 pow3(in vec2 x) {\n return x * x * x;\n}\n\nvec3 pow3(in vec3 x) {\n return x * x * x;\n}\n\nvec4 pow3(in vec4 x) {\n return x * x * x;\n}\n#endif\n'},8029:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 5\nuse: pow5(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW5\n#define FNC_POW5\nfloat pow5(in float x) {\n float x2 = x * x;\n return x2 * x2 * x;\n}\n\nvec2 pow5(in vec2 x) {\n vec2 x2 = x * x;\n return x2 * x2 * x;\n}\n\nvec3 pow5(in vec3 x) {\n vec3 x2 = x * x;\n return x2 * x2 * x;\n}\n\nvec4 pow5(in vec4 x) {\n vec4 x2 = x * x;\n return x2 * x2 * x;\n}\n#endif\n'},2257:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 7\nuse: pow7(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW2\n#define FNC_POW2\nfloat pow7(in float x) {\n return x * x * x * x * x * x * x;\n}\n\nvec2 pow7(in vec2 x) {\n return x * x * x * x * x * x * x;\n}\n\nvec3 pow7(in vec3 x) {\n return x * x * x * x * x * x * x;\n}\n\nvec4 pow7(in vec4 x) {\n return x * x * x * x * x * x * x;\n}\n#endif\n'},6398:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: fast approximation to pow()\nuse: powFast(<float> x, <float> exp)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POWFAST\n#define FNC_POWFAST\n\nfloat powFast(float a, float b) {\n return a / ((1. - b) * a + b);\n}\n\n#endif'},2471:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 2x2 rotation matrix\nuse: rotate2d(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE2D\n#define FNC_ROTATE2D\nmat2 rotate2d(in float radians){\n float c = cos(radians);\n float s = sin(radians);\n return mat2(c, -s, s, c);\n}\n#endif\n'},5085:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4d(<vec3> axis, <float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE3D\n#define FNC_ROTATE3D\nmat3 rotate3d(in vec3 axis, in float radians) {\n axis = normalize(axis);\n float s = sin(radians);\n float c = cos(radians);\n float oc = 1.0 - c;\n\n return mat3(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s,\n oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s,\n oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c );\n}\n#endif\n'},3448:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4d(<vec3> axis, <float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4D\n#define FNC_ROTATE4D\nmat4 rotate4d(in vec3 axis, in float radians) {\n axis = normalize(axis);\n float s = sin(radians);\n float c = cos(radians);\n float oc = 1.0 - c;\n\n return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,\n oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,\n oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n#endif\n'},2109:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dX(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DX\n#define FNC_ROTATE4DX\nmat4 rotate4dX(in float phi){\n return mat4(\n vec4(1.,0.,0.,0),\n vec4(0.,cos(phi),-sin(phi),0.),\n vec4(0.,sin(phi),cos(phi),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n'},3538:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dY(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DY\n#define FNC_ROTATE4DY\nmat4 rotate4dY(in float theta){\n return mat4(\n vec4(cos(theta),0.,-sin(theta),0),\n vec4(0.,1.,0.,0.),\n vec4(sin(theta),0.,cos(theta),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n'},3553:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dZ(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DZ\n#define FNC_ROTATE4DZ\nmat4 rotate4dZ(in float psi){\n return mat4(\n vec4(cos(psi),-sin(psi),0.,0),\n vec4(sin(psi),cos(psi),0.,0.),\n vec4(0.,0.,1.,0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n'},4782:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: clamp a value between 0 and 1\nuse: saturation(<float|vec2|vec3|vec4> value)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_SATURATE\n#define FNC_SATURATE\n// #define saturate(x) clamp(x, 0.0, 1.0)\nfloat saturate( float x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec2 saturate( vec2 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec3 saturate( vec3 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec4 saturate( vec4 x) {\n return clamp(x, 0.0, 1.0);\n}\n#endif'},608:n=>{n.exports="/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif"}},e={};function t(i){var o=e[i];if(void 0!==o)return o.exports;var a=e[i]={exports:{}};return n[i](a,a.exports,t),a.exports}t.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return t.d(e,{a:e}),e},t.d=(n,e)=>{for(var i in e)t.o(e,i)&&!t.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:e[i]})},t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var i={};(()=>{t.d(i,{Z:()=>k});var n=t(8236),e=t.n(n),o=t(1056),a=t.n(o),r=t(7802),s=t.n(r),c=t(2257),T=t.n(c),E=t(2109),O=t.n(E),I=t(6951),R=t.n(I),N=t(1578),A=t.n(N),l=t(1),f=t.n(l),d=t(6398),S=t.n(d),h=t(3538),u=t.n(h),p=t(7877),v=t.n(p),x=t(4688),m=t.n(x),H=t(5661),L=t.n(H),C=t(2471),F=t.n(C),b=t(3553),w=t.n(b),D=t(1496),M=t.n(D),P=t(254),g=t.n(P),W=t(1759),U=t.n(W),y=t(5085),G=t.n(y),Y=t(4782),B=t.n(Y),z=t(2381),V=t.n(z),_=t(5824),X=t.n(_),j=t(8029),K=t.n(j),q=t(3448),Q=t.n(q),Z=t(608),J=t.n(Z);const k={adaptiveThreshold:e(),lengthSq:a(),mod289:s(),pow7:T(),rotate4dX:O(),consts:R(),map:A(),permute:f(),powFast:S(),rotate4dY:u(),decimation:v(),max:m(),pow2:L(),rotate2d:F(),rotate4dZ:w(),fade:M(),min:g(),pow3:U(),rotate3d:G(),saturate:B(),grad4:V(),mix:X(),pow5:K(),rotate4d:Q(),taylorInvSqrt:J()}})();var o=i.Z;export{o as default}; | ||
var n = { | ||
8236: (n) => { | ||
n.exports = | ||
'/*\nauthor: Brad Larson\ndescription: adaptive threshold from https://github.com/BradLarson/GPUImage/blob/master/framework/Source/GPUImageAdaptiveThresholdFilter.m\nuse: adaptiveThreshold(<float> value, <float> blur_value, <float> bias)\nlicense: |\n Copyright (c) 2012, Brad Larson, Ben Cochran, Hugues Lismonde, Keitaroh Kobayashi, Alaric Cole, Matthew Clark, Jacob Gundersen, Chris Williams.\n All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef FNC_ADAPTIVETHRESHOLD\n#define FNC_ADAPTIVETHRESHOLD\nfloat adaptiveThreshold(in float value, in float blur_value, in float bias) {\n return step(blur_value + bias, value);\n}\n\nfloat adaptiveThreshold(in float value, in float blur_value) {\n return step(blur_value - 0.05, value);\n}\n#endif\n' | ||
}, | ||
6951: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n' | ||
}, | ||
7877: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: decimate a value with an specific presicion \nuse: decimation(<float|vec2|vec3|vec4> value, <float|vec2|vec3|vec4> presicion)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_DECIMATION\n#define FNC_DECIMATION\n#define decimation(value, presicion) (floor(value * presicion)/presicion)\n#endif' | ||
}, | ||
1496: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: fade\nuse: fade(<vec2|vec3|vec4> t)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_FADE\n#define FNC_FADE\nfloat fade(in float t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec2 fade(in vec2 t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec3 fade(in vec3 t) {\n return t * t * t * (t * (t * 6. - 15. ) + 10.);\n}\n\nvec4 fade(vec4 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n#endif\n' | ||
}, | ||
2381: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: grad4, used for snoise(vec4 v)\nuse: grad4(<float> j, <vec4> ip)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_GRAD4\n#define FNC_GRAD4\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n#endif\n' | ||
}, | ||
1056: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Squared length\nuse: lengthSq(<vec2|float2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LENGTHSQ\n#define FNC_LENGTHSQ\nfloat lengthSq(in vec2 st) {\n return dot(st, st);\n}\n\nfloat lengthSq(in vec3 pos) {\n return dot(pos, pos);\n}\n#endif\n' | ||
}, | ||
1578: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: clamp a value between 0 and 1\nuse: saturation(<float|vec2|vec3|vec4> value)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_SATURATE\n#define FNC_SATURATE\n// #define saturate(x) clamp(x, 0.0, 1.0)\nfloat saturate( float x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec2 saturate( vec2 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec3 saturate( vec3 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec4 saturate( vec4 x) {\n return clamp(x, 0.0, 1.0);\n}\n#endif\n\n/*\nauthor: Johan Ismael\ndescription: Map a value between one range to another.\nuse: map(<float|vec2|vec3|vec4> value, <float|vec2|vec3|vec4> inMin, <float|vec2|vec3|vec4> inMax, <float|vec2|vec3|vec4> outMin, <float|vec2|vec3|vec4> outMax)\nlicense: |\n Copyright (c) 2017 Johan Ismael.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_MAP\n#define FNC_MAP\n\nfloat map( float value, float inMin, float inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nvec2 map( vec2 value, vec2 inMin, vec2 inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nvec3 map( vec3 value, vec3 inMin, vec3 inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nvec4 map( vec4 value, vec4 inMin, vec4 inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nfloat map(in float value, in float inMin, in float inMax, in float outMin, in float outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\nvec2 map(in vec2 value, in vec2 inMin, in vec2 inMax, in vec2 outMin, in vec2 outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\nvec3 map(in vec3 value, in vec3 inMin, in vec3 inMax, in vec3 outMin, in vec3 outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\nvec4 map(in vec4 value, in vec4 inMin, in vec4 inMax, in vec4 outMin, in vec4 outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\n#endif\n' | ||
}, | ||
4688: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: extend GLSL Max function to add more arguments\nuse: \n - max(<float> A, <float> B, <float> C[, <float> D])\n - max(<vec2|vec3|vec4> A)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_MAX\n#define FNC_MAX\nfloat max(in float a, in float b, in float c) {\n return max(a, max(b, c));\n}\n\nfloat max(in float a, in float b, in float c, in float d) {\n return max(max(a, b), max(c, d));\n}\n\nfloat max(const vec2 v) {\n return max(v.x, v.y);\n}\n\nfloat max(const vec3 v) {\n return max(v.x, v.y, v.z);\n}\n\nfloat max(const vec4 v) {\n return max(v.x, v.y, v.z, v.w);\n}\n#endif\n' | ||
}, | ||
254: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: extend GLSL min function to add more arguments\nuse: \n - min(<float> A, <float> B, <float> C[, <float> D])\n - min(<vec2|vec3|vec4> A)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_MIN\n#define FNC_MIN\nfloat min(in float a, in float b, in float c) {\n return min(a, min(b, c));\n}\n\nfloat min(in float a, in float b, in float c, in float d) {\n return min(min(a,b), min(c, d));\n}\n\nfloat min(const vec2 v) {\n return min(v.x, v.y);\n}\n\nfloat min(const vec3 v) {\n return min(v.x, v.y, v.z);\n}\n\nfloat min(const vec4 v) {\n return min(v.x, v.y, v.z, v.w);\n}\n#endif\n' | ||
}, | ||
5824: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: expands mix to linearly mix more than two values\nuse: mix(<float|vec2|vec3|vec4> a, <float|vec2|vec3|vec4> b, <float|vec2|vec3|vec4> c [, <float|vec2|vec3|vec4> d], <float> pct)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_MIX\n#define FNC_MIX\nfloat mix(float a , float b, float c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec2 mix(vec2 a , vec2 b, vec2 c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec2 mix(vec2 a , vec2 b, vec2 c, vec2 pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec3 mix(vec3 a , vec3 b, vec3 c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec3 mix(vec3 a , vec3 b, vec3 c, vec3 pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec4 mix(vec4 a , vec4 b, vec4 c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec4 mix(vec4 a , vec4 b, vec4 c, vec4 pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nfloat mix(in float a , in float b, in float c, in float d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec2 mix(in vec2 a , in vec2 b, in vec2 c, in vec2 d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec2 mix(in vec2 a , in vec2 b, in vec2 c, in vec2 d, in vec2 pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec3 mix(in vec3 a , in vec3 b, in vec3 c, in vec3 d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec3 mix(in vec3 a , in vec3 b, in vec3 c, in vec3 d, in vec3 pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec4 mix(in vec4 a , in vec4 b, in vec4 c, in vec4 d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec4 mix(in vec4 a , in vec4 b, in vec4 c, in vec4 d, in vec4 pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n#endif\n' | ||
}, | ||
7802: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n' | ||
}, | ||
1: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n' | ||
}, | ||
5661: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 2\nuse: pow2(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW2\n#define FNC_POW2\nfloat pow2(in float x) {\n return x * x;\n}\n\nvec2 pow2(in vec2 x) {\n return x * x;\n}\n\nvec3 pow2(in vec3 x) {\n return x * x;\n}\n\nvec4 pow2(in vec4 x) {\n return x * x;\n}\n#endif\n' | ||
}, | ||
1759: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 3\nuse: pow3(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW3\n#define FNC_POW3\nfloat pow3(in float x) {\n return x * x * x;\n}\n\nvec2 pow3(in vec2 x) {\n return x * x * x;\n}\n\nvec3 pow3(in vec3 x) {\n return x * x * x;\n}\n\nvec4 pow3(in vec4 x) {\n return x * x * x;\n}\n#endif\n' | ||
}, | ||
8029: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 5\nuse: pow5(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW5\n#define FNC_POW5\nfloat pow5(in float x) {\n float x2 = x * x;\n return x2 * x2 * x;\n}\n\nvec2 pow5(in vec2 x) {\n vec2 x2 = x * x;\n return x2 * x2 * x;\n}\n\nvec3 pow5(in vec3 x) {\n vec3 x2 = x * x;\n return x2 * x2 * x;\n}\n\nvec4 pow5(in vec4 x) {\n vec4 x2 = x * x;\n return x2 * x2 * x;\n}\n#endif\n' | ||
}, | ||
2257: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 7\nuse: pow7(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW2\n#define FNC_POW2\nfloat pow7(in float x) {\n return x * x * x * x * x * x * x;\n}\n\nvec2 pow7(in vec2 x) {\n return x * x * x * x * x * x * x;\n}\n\nvec3 pow7(in vec3 x) {\n return x * x * x * x * x * x * x;\n}\n\nvec4 pow7(in vec4 x) {\n return x * x * x * x * x * x * x;\n}\n#endif\n' | ||
}, | ||
6398: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: fast approximation to pow()\nuse: powFast(<float> x, <float> exp)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POWFAST\n#define FNC_POWFAST\n\nfloat powFast(float a, float b) {\n return a / ((1. - b) * a + b);\n}\n\n#endif' | ||
}, | ||
2471: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 2x2 rotation matrix\nuse: rotate2d(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE2D\n#define FNC_ROTATE2D\nmat2 rotate2d(in float radians){\n float c = cos(radians);\n float s = sin(radians);\n return mat2(c, -s, s, c);\n}\n#endif\n' | ||
}, | ||
5085: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4d(<vec3> axis, <float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE3D\n#define FNC_ROTATE3D\nmat3 rotate3d(in vec3 axis, in float radians) {\n axis = normalize(axis);\n float s = sin(radians);\n float c = cos(radians);\n float oc = 1.0 - c;\n\n return mat3(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s,\n oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s,\n oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c );\n}\n#endif\n' | ||
}, | ||
3448: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4d(<vec3> axis, <float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4D\n#define FNC_ROTATE4D\nmat4 rotate4d(in vec3 axis, in float radians) {\n axis = normalize(axis);\n float s = sin(radians);\n float c = cos(radians);\n float oc = 1.0 - c;\n\n return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,\n oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,\n oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n#endif\n' | ||
}, | ||
2109: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dX(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DX\n#define FNC_ROTATE4DX\nmat4 rotate4dX(in float phi){\n return mat4(\n vec4(1.,0.,0.,0),\n vec4(0.,cos(phi),-sin(phi),0.),\n vec4(0.,sin(phi),cos(phi),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n' | ||
}, | ||
3538: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dY(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DY\n#define FNC_ROTATE4DY\nmat4 rotate4dY(in float theta){\n return mat4(\n vec4(cos(theta),0.,-sin(theta),0),\n vec4(0.,1.,0.,0.),\n vec4(sin(theta),0.,cos(theta),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n' | ||
}, | ||
3553: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dZ(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DZ\n#define FNC_ROTATE4DZ\nmat4 rotate4dZ(in float psi){\n return mat4(\n vec4(cos(psi),-sin(psi),0.,0),\n vec4(sin(psi),cos(psi),0.,0.),\n vec4(0.,0.,1.,0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n' | ||
}, | ||
4782: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: clamp a value between 0 and 1\nuse: saturation(<float|vec2|vec3|vec4> value)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_SATURATE\n#define FNC_SATURATE\n// #define saturate(x) clamp(x, 0.0, 1.0)\nfloat saturate( float x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec2 saturate( vec2 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec3 saturate( vec3 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec4 saturate( vec4 x) {\n return clamp(x, 0.0, 1.0);\n}\n#endif' | ||
}, | ||
608: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif' | ||
}, | ||
}, | ||
e = {} | ||
function t(i) { | ||
var o = e[i] | ||
if (void 0 !== o) return o.exports | ||
var a = (e[i] = { exports: {} }) | ||
return n[i](a, a.exports, t), a.exports | ||
} | ||
;(t.d = (n, e) => { | ||
for (var i in e) | ||
t.o(e, i) && | ||
!t.o(n, i) && | ||
Object.defineProperty(n, i, { enumerable: !0, get: e[i] }) | ||
}), | ||
(t.o = (n, e) => Object.prototype.hasOwnProperty.call(n, e)) | ||
var i = {} | ||
;(() => { | ||
t.d(i, { Z: () => n }) | ||
const n = { | ||
adaptiveThreshold: t(8236), | ||
lengthSq: t(1056), | ||
mod289: t(7802), | ||
pow7: t(2257), | ||
rotate4dX: t(2109), | ||
consts: t(6951), | ||
map: t(1578), | ||
permute: t(1), | ||
powFast: t(6398), | ||
rotate4dY: t(3538), | ||
decimation: t(7877), | ||
max: t(4688), | ||
pow2: t(5661), | ||
rotate2d: t(2471), | ||
rotate4dZ: t(3553), | ||
fade: t(1496), | ||
min: t(254), | ||
pow3: t(1759), | ||
rotate3d: t(5085), | ||
saturate: t(4782), | ||
grad4: t(2381), | ||
mix: t(5824), | ||
pow5: t(8029), | ||
rotate4d: t(3448), | ||
taylorInvSqrt: t(608), | ||
} | ||
})() | ||
var o = i.Z | ||
export { o as default } |
@@ -1,1 +0,27 @@ | ||
var t={4324:t=>{t.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Converts a RGB normal map into normal vectors\nuse: normalMap(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n NORMALMAP_Z: Steepness of z before normalization, defaults to .01\n NORMALMAP_SAMPLER_FNC(POS_UV): Function used to sample into the normal map texture, defaults to texture2D(tex,POS_UV).r\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef NORMALMAP_Z\n#define NORMALMAP_Z .01\n#endif\n\n#ifndef NORMALMAP_SAMPLER_FNC\n#define NORMALMAP_SAMPLER_FNC(POS_UV) texture2D(tex,POS_UV).r\n#endif\n\n#ifndef FNC_NORMALMAP\n#define FNC_NORMALMAP\nvec3 normalMap(sampler2D tex, vec2 st, vec2 pixel) {\n float center = NORMALMAP_SAMPLER_FNC(st);\n float topLeft = NORMALMAP_SAMPLER_FNC(st - pixel);\n float left = NORMALMAP_SAMPLER_FNC(st - vec2(pixel.x, .0));\n float bottomLeft = NORMALMAP_SAMPLER_FNC(st + vec2(-pixel.x, pixel.y));\n float top = NORMALMAP_SAMPLER_FNC(st - vec2(.0, pixel.y));\n float bottom = NORMALMAP_SAMPLER_FNC(st + vec2(.0, pixel.y));\n float topRight = NORMALMAP_SAMPLER_FNC(st + vec2(pixel.x, -pixel.y));\n float right = NORMALMAP_SAMPLER_FNC(st + vec2(pixel.x, .0));\n float bottomRight = NORMALMAP_SAMPLER_FNC(st + pixel);\n \n float dX = topRight + 2. * right + bottomRight - topLeft - 2. * left - bottomLeft;\n float dY = bottomLeft + 2. * bottom + bottomRight - topLeft - 2. * top - topRight;\n\n return normalize(vec3(dX, dY, NORMALMAP_Z) );\n}\n#endif'}},e={};function o(n){var i=e[n];if(void 0!==i)return i.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,o),r.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};(()=>{o.d(n,{Z:()=>e});var t=o(4324);const e={normalMap:o.n(t)()}})();var i=n.Z;export{i as default}; | ||
var t = { | ||
4324: (t) => { | ||
t.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Converts a RGB normal map into normal vectors\nuse: normalMap(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n NORMALMAP_Z: Steepness of z before normalization, defaults to .01\n NORMALMAP_SAMPLER_FNC(POS_UV): Function used to sample into the normal map texture, defaults to texture2D(tex,POS_UV).r\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef NORMALMAP_Z\n#define NORMALMAP_Z .01\n#endif\n\n#ifndef NORMALMAP_SAMPLER_FNC\n#define NORMALMAP_SAMPLER_FNC(POS_UV) texture2D(tex,POS_UV).r\n#endif\n\n#ifndef FNC_NORMALMAP\n#define FNC_NORMALMAP\nvec3 normalMap(sampler2D tex, vec2 st, vec2 pixel) {\n float center = NORMALMAP_SAMPLER_FNC(st);\n float topLeft = NORMALMAP_SAMPLER_FNC(st - pixel);\n float left = NORMALMAP_SAMPLER_FNC(st - vec2(pixel.x, .0));\n float bottomLeft = NORMALMAP_SAMPLER_FNC(st + vec2(-pixel.x, pixel.y));\n float top = NORMALMAP_SAMPLER_FNC(st - vec2(.0, pixel.y));\n float bottom = NORMALMAP_SAMPLER_FNC(st + vec2(.0, pixel.y));\n float topRight = NORMALMAP_SAMPLER_FNC(st + vec2(pixel.x, -pixel.y));\n float right = NORMALMAP_SAMPLER_FNC(st + vec2(pixel.x, .0));\n float bottomRight = NORMALMAP_SAMPLER_FNC(st + pixel);\n \n float dX = topRight + 2. * right + bottomRight - topLeft - 2. * left - bottomLeft;\n float dY = bottomLeft + 2. * bottom + bottomRight - topLeft - 2. * top - topRight;\n\n return normalize(vec3(dX, dY, NORMALMAP_Z) );\n}\n#endif' | ||
}, | ||
}, | ||
e = {} | ||
function o(n) { | ||
var i = e[n] | ||
if (void 0 !== i) return i.exports | ||
var r = (e[n] = { exports: {} }) | ||
return t[n](r, r.exports, o), r.exports | ||
} | ||
;(o.d = (t, e) => { | ||
for (var n in e) | ||
o.o(e, n) && | ||
!o.o(t, n) && | ||
Object.defineProperty(t, n, { enumerable: !0, get: e[n] }) | ||
}), | ||
(o.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e)) | ||
var n = {} | ||
;(() => { | ||
o.d(n, { Z: () => t }) | ||
const t = { normalMap: o(4324) } | ||
})() | ||
var i = n.Z | ||
export { i as default } |
@@ -1,1 +0,84 @@ | ||
var n={7899:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a circle-shaped SDF.\nuse: circleSDF(vec2 st[, vec2 center])\noptions:\n CIRCLESDF_FNC(POS_UV) : function used to calculate the SDF, defaults to GLSL length function, use lengthSq for a different slope\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef CIRCLESDF_FNC\n#define CIRCLESDF_FNC(POS_UV) length(POS_UV)\n#endif\n\n#ifndef FNC_CIRCLESDF\n#define FNC_CIRCLESDF\n\nfloat circleSDF(in vec2 st, in vec2 center) {\n return CIRCLESDF_FNC(st - center) * 2.;\n}\n\nfloat circleSDF(in vec2 st) {\n return circleSDF(st, vec2(.5));\n}\n\n#endif\n'},2092:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a rectangular SDF\nuse: rectSDF(<vec2> st, <vec2> size)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_RECTSDF\n#define FNC_RECTSDF\nfloat rectSDF(in vec2 st, in vec2 s) {\n st = st * 2. - 1.;\n return max( abs(st.x / s.x),\n abs(st.y / s.y) );\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a cross-shaped SDF\nuse: crossSDF(<vec2> st, size s)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_CROSSSDF\n#define FNC_CROSSSDF\nfloat crossSDF(in vec2 st, in float s) {\n vec2 size = vec2(.25, s);\n return min(rectSDF(st.xy, size.xy),\n rectSDF(st.xy, size.yx));\n}\n#endif\n'},9023:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a flower shaped SDF\nuse: flowerSDF(<vec2> st, <int> n_sides)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_FLOWERSDF\n#define FNC_FLOWERSDF\nfloat flowerSDF(vec2 st, int N) {\n st = st * 2.0 - 1.0;\n float r = length(st) * 2.0;\n float a = atan(st.y, st.x);\n float v = float(N) * 0.5;\n return 1.0 - (abs(cos(a * v)) * 0.5 + 0.5) / r;\n}\n#endif'},6881:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a heart shaped SDF\nuse: heartSDF(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_HEARTSDF\n#define FNC_HEARTSDF\nfloat heartSDF(vec2 st) {\n st -= vec2(0.5, 0.8);\n float r = length(st) * 5.0;\n st = normalize(st);\n return r - ((st.y * pow(abs(st.x), 0.67)) / (st.y + 1.5) - (2.0) * st.y + 1.26);\n}\n#endif'},9455:n=>{n.exports='/*\\\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a hexagon-shaped SDF\nuse: hexSDF(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_HEXSDF\n#define FNC_HEXSDF\nfloat hexSDF(in vec2 st) {\n st = abs(st * 2. - 1.);\n return max(abs(st.y), st.x * .866025 + st.y * .5);\n}\n#endif\n'},6223:n=>{n.exports='#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a sdf for a regular polygon with V sides.\nuse: polySDF(<vec2> st, int V)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_POLYSDF\n#define FNC_POLYSDF\nfloat polySDF(in vec2 st, in int V) {\n st = st * 2. - 1.;\n float a = atan(st.x, st.y) + PI;\n float r = length(st);\n float v = TAU / float(V);\n return cos(floor(.5 + a / v) * v - a ) * r;\n}\n#endif\n'},122:n=>{n.exports='#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a sdf for rays with N branches\nuse: raysSDF(<vec2> st, <int> N)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_RAYSSDF\n#define FNC_RAYSSDF\nfloat raysSDF(in vec2 st, in int N) {\n st -= .5;\n return fract(atan(st.y, st.x) / TAU * float(N));\n}\n#endif\n'},2704:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a rectangular SDF\nuse: rectSDF(<vec2> st, <vec2> size)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_RECTSDF\n#define FNC_RECTSDF\nfloat rectSDF(in vec2 st, in vec2 s) {\n st = st * 2. - 1.;\n return max( abs(st.x / s.x),\n abs(st.y / s.y) );\n}\n#endif\n'},4260:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a spiral SDF\nuse: spiralSDF(<vec2> st, <float> turns)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_SPIRALSDF\n#define FNC_SPIRALSDF\nfloat spiralSDF(vec2 st, float t) {\n st -= 0.5;\n float r = dot(st, st);\n float a = atan(st.y, st.x);\n return abs(sin(fract(log(r) * t + a * 0.159)));\n}\n#endif'},3433:n=>{n.exports='#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a star-shaped sdf with V branches\nuse: starSDF(<vec2> st, <int> V, <float> scale)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_STARSDF\n#define FNC_STARSDF\nfloat starSDF(in vec2 st, in int V, in float s) {\n st = st * 4. - 2.;\n float a = atan(st.y, st.x) / TAU;\n float seg = a * float(V);\n a = ((floor(seg) + .5) / float(V) +\n mix(s, -s, step(.5, fract(seg))))\n * TAU;\n return abs(dot(vec2(cos(a), sin(a)),\n st));\n}\n#endif\n'},5866:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a triangle-shaped sdf\nuse: triSDF(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_TRISDF\n#define FNC_TRISDF\nfloat triSDF(in vec2 st) {\n st = (st * 2. - 1.) * 2.;\n return max(abs(st.x) * .866025 + st.y * .5, -st.y * .5);\n}\n#endif\n'},2838:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a circle-shaped SDF.\nuse: circleSDF(vec2 st[, vec2 center])\noptions:\n CIRCLESDF_FNC(POS_UV) : function used to calculate the SDF, defaults to GLSL length function, use lengthSq for a different slope\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef CIRCLESDF_FNC\n#define CIRCLESDF_FNC(POS_UV) length(POS_UV)\n#endif\n\n#ifndef FNC_CIRCLESDF\n#define FNC_CIRCLESDF\n\nfloat circleSDF(in vec2 st, in vec2 center) {\n return CIRCLESDF_FNC(st - center) * 2.;\n}\n\nfloat circleSDF(in vec2 st) {\n return circleSDF(st, vec2(.5));\n}\n\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns an almond-shaped sdf\nuse: vesicaSDF(<vec2> st, <float> w)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_VESICASDF\n#define FNC_VESICASDF\nfloat vesicaSDF(in vec2 st, in float w) {\n vec2 offset = vec2(w*.5,0.);\n return max( circleSDF(st-offset),\n circleSDF(st+offset));\n}\n#endif\n'}},e={};function i(t){var s=e[t];if(void 0!==s)return s.exports;var r=e[t]={exports:{}};return n[t](r,r.exports,i),r.exports}i.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return i.d(e,{a:e}),e},i.d=(n,e)=>{for(var t in e)i.o(e,t)&&!i.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},i.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var t={};(()=>{i.d(t,{Z:()=>L});var n=i(7899),e=i.n(n),s=i(9023),r=i.n(s),o=i(9455),a=i.n(o),f=i(122),c=i.n(f),d=i(4260),l=i.n(d),S=i(5866),D=i.n(S),v=i(2092),F=i.n(v),u=i(6881),p=i.n(u),N=i(6223),h=i.n(N),C=i(2704),E=i.n(C),P=i(3433),_=i.n(P),z=i(2838),I=i.n(z);const L={circleSDF:e(),flowerSDF:r(),hexSDF:a(),raysSDF:c(),spiralSDF:l(),triSDF:D(),crossSDF:F(),heartSDF:p(),polySDF:h(),rectSDF:E(),starSDF:_(),vesicaSDF:I()}})();var s=t.Z;export{s as default}; | ||
var n = { | ||
7899: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a circle-shaped SDF.\nuse: circleSDF(vec2 st[, vec2 center])\noptions:\n CIRCLESDF_FNC(POS_UV) : function used to calculate the SDF, defaults to GLSL length function, use lengthSq for a different slope\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef CIRCLESDF_FNC\n#define CIRCLESDF_FNC(POS_UV) length(POS_UV)\n#endif\n\n#ifndef FNC_CIRCLESDF\n#define FNC_CIRCLESDF\n\nfloat circleSDF(in vec2 st, in vec2 center) {\n return CIRCLESDF_FNC(st - center) * 2.;\n}\n\nfloat circleSDF(in vec2 st) {\n return circleSDF(st, vec2(.5));\n}\n\n#endif\n' | ||
}, | ||
2092: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a rectangular SDF\nuse: rectSDF(<vec2> st, <vec2> size)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_RECTSDF\n#define FNC_RECTSDF\nfloat rectSDF(in vec2 st, in vec2 s) {\n st = st * 2. - 1.;\n return max( abs(st.x / s.x),\n abs(st.y / s.y) );\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a cross-shaped SDF\nuse: crossSDF(<vec2> st, size s)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_CROSSSDF\n#define FNC_CROSSSDF\nfloat crossSDF(in vec2 st, in float s) {\n vec2 size = vec2(.25, s);\n return min(rectSDF(st.xy, size.xy),\n rectSDF(st.xy, size.yx));\n}\n#endif\n' | ||
}, | ||
9023: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a flower shaped SDF\nuse: flowerSDF(<vec2> st, <int> n_sides)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_FLOWERSDF\n#define FNC_FLOWERSDF\nfloat flowerSDF(vec2 st, int N) {\n st = st * 2.0 - 1.0;\n float r = length(st) * 2.0;\n float a = atan(st.y, st.x);\n float v = float(N) * 0.5;\n return 1.0 - (abs(cos(a * v)) * 0.5 + 0.5) / r;\n}\n#endif' | ||
}, | ||
6881: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a heart shaped SDF\nuse: heartSDF(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_HEARTSDF\n#define FNC_HEARTSDF\nfloat heartSDF(vec2 st) {\n st -= vec2(0.5, 0.8);\n float r = length(st) * 5.0;\n st = normalize(st);\n return r - ((st.y * pow(abs(st.x), 0.67)) / (st.y + 1.5) - (2.0) * st.y + 1.26);\n}\n#endif' | ||
}, | ||
9455: (n) => { | ||
n.exports = | ||
'/*\\\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a hexagon-shaped SDF\nuse: hexSDF(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_HEXSDF\n#define FNC_HEXSDF\nfloat hexSDF(in vec2 st) {\n st = abs(st * 2. - 1.);\n return max(abs(st.y), st.x * .866025 + st.y * .5);\n}\n#endif\n' | ||
}, | ||
6223: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a sdf for a regular polygon with V sides.\nuse: polySDF(<vec2> st, int V)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_POLYSDF\n#define FNC_POLYSDF\nfloat polySDF(in vec2 st, in int V) {\n st = st * 2. - 1.;\n float a = atan(st.x, st.y) + PI;\n float r = length(st);\n float v = TAU / float(V);\n return cos(floor(.5 + a / v) * v - a ) * r;\n}\n#endif\n' | ||
}, | ||
122: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a sdf for rays with N branches\nuse: raysSDF(<vec2> st, <int> N)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_RAYSSDF\n#define FNC_RAYSSDF\nfloat raysSDF(in vec2 st, in int N) {\n st -= .5;\n return fract(atan(st.y, st.x) / TAU * float(N));\n}\n#endif\n' | ||
}, | ||
2704: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a rectangular SDF\nuse: rectSDF(<vec2> st, <vec2> size)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_RECTSDF\n#define FNC_RECTSDF\nfloat rectSDF(in vec2 st, in vec2 s) {\n st = st * 2. - 1.;\n return max( abs(st.x / s.x),\n abs(st.y / s.y) );\n}\n#endif\n' | ||
}, | ||
4260: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a spiral SDF\nuse: spiralSDF(<vec2> st, <float> turns)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_SPIRALSDF\n#define FNC_SPIRALSDF\nfloat spiralSDF(vec2 st, float t) {\n st -= 0.5;\n float r = dot(st, st);\n float a = atan(st.y, st.x);\n return abs(sin(fract(log(r) * t + a * 0.159)));\n}\n#endif' | ||
}, | ||
3433: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a star-shaped sdf with V branches\nuse: starSDF(<vec2> st, <int> V, <float> scale)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_STARSDF\n#define FNC_STARSDF\nfloat starSDF(in vec2 st, in int V, in float s) {\n st = st * 4. - 2.;\n float a = atan(st.y, st.x) / TAU;\n float seg = a * float(V);\n a = ((floor(seg) + .5) / float(V) +\n mix(s, -s, step(.5, fract(seg))))\n * TAU;\n return abs(dot(vec2(cos(a), sin(a)),\n st));\n}\n#endif\n' | ||
}, | ||
5866: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a triangle-shaped sdf\nuse: triSDF(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_TRISDF\n#define FNC_TRISDF\nfloat triSDF(in vec2 st) {\n st = (st * 2. - 1.) * 2.;\n return max(abs(st.x) * .866025 + st.y * .5, -st.y * .5);\n}\n#endif\n' | ||
}, | ||
2838: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a circle-shaped SDF.\nuse: circleSDF(vec2 st[, vec2 center])\noptions:\n CIRCLESDF_FNC(POS_UV) : function used to calculate the SDF, defaults to GLSL length function, use lengthSq for a different slope\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef CIRCLESDF_FNC\n#define CIRCLESDF_FNC(POS_UV) length(POS_UV)\n#endif\n\n#ifndef FNC_CIRCLESDF\n#define FNC_CIRCLESDF\n\nfloat circleSDF(in vec2 st, in vec2 center) {\n return CIRCLESDF_FNC(st - center) * 2.;\n}\n\nfloat circleSDF(in vec2 st) {\n return circleSDF(st, vec2(.5));\n}\n\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns an almond-shaped sdf\nuse: vesicaSDF(<vec2> st, <float> w)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_VESICASDF\n#define FNC_VESICASDF\nfloat vesicaSDF(in vec2 st, in float w) {\n vec2 offset = vec2(w*.5,0.);\n return max( circleSDF(st-offset),\n circleSDF(st+offset));\n}\n#endif\n' | ||
}, | ||
}, | ||
e = {} | ||
function i(t) { | ||
var s = e[t] | ||
if (void 0 !== s) return s.exports | ||
var r = (e[t] = { exports: {} }) | ||
return n[t](r, r.exports, i), r.exports | ||
} | ||
;(i.d = (n, e) => { | ||
for (var t in e) | ||
i.o(e, t) && | ||
!i.o(n, t) && | ||
Object.defineProperty(n, t, { enumerable: !0, get: e[t] }) | ||
}), | ||
(i.o = (n, e) => Object.prototype.hasOwnProperty.call(n, e)) | ||
var t = {} | ||
;(() => { | ||
i.d(t, { Z: () => n }) | ||
const n = { | ||
circleSDF: i(7899), | ||
flowerSDF: i(9023), | ||
hexSDF: i(9455), | ||
raysSDF: i(122), | ||
spiralSDF: i(4260), | ||
triSDF: i(5866), | ||
crossSDF: i(2092), | ||
heartSDF: i(6881), | ||
polySDF: i(6223), | ||
rectSDF: i(2704), | ||
starSDF: i(3433), | ||
vesicaSDF: i(2838), | ||
} | ||
})() | ||
var s = t.Z | ||
export { s as default } |
@@ -1,1 +0,64 @@ | ||
var e={7225:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Flip Y axis\nuse: flipY(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_FLIPY\n#define FNC_FLIPY\nvec2 flipY(in vec2 st) {\n return vec2(st.x, 1. - st.y);\n}\n#endif\n'},7358:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: linearize depth\nuse: linearizeDepth(<float> depth, <float> near, <float> far)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LINEARIZE_DEPTH\n#define FNC_LINEARIZE_DEPTH\n\nfloat linearizeDepth(float depth, float near, float far) {\n depth = 2.0 * depth - 1.0;\n return (2.0 * near) / (far + near - depth * (far - near));\n}\n\n#endif'},9357:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Fix the aspect ratio of a space keeping things squared for you.\nuse: ratio(vec2 st, vec2 st_size)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_RATIO\n#define FNC_RATIO\nvec2 ratio(in vec2 st, in vec2 s) {\n return mix( vec2((st.x*s.x/s.y)-(s.x*.5-s.y*.5)/s.y,st.y),\n vec2(st.x,st.y*(s.y/s.x)-(s.y*.5-s.x*.5)/s.x),\n step(s.x,s.y));\n}\n#endif\n'},1904:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 2x2 rotation matrix\nuse: rotate2d(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE2D\n#define FNC_ROTATE2D\nmat2 rotate2d(in float radians){\n float c = cos(radians);\n float s = sin(radians);\n return mat2(c, -s, s, c);\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4d(<vec3> axis, <float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4D\n#define FNC_ROTATE4D\nmat4 rotate4d(in vec3 axis, in float radians) {\n axis = normalize(axis);\n float s = sin(radians);\n float c = cos(radians);\n float oc = 1.0 - c;\n\n return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,\n oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,\n oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian radians\nuse: rotate(<vec3|vec2> st, float radians [, vec2 center])\noptions:\n - CENTER_2D\n - CENTER_3D\n - CENTER_4D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATE\n#define FNC_ROTATE\nvec2 rotate(in vec2 st, in float radians, in vec2 center) {\n return rotate2d(radians) * (st - center) + center;\n}\n\nvec2 rotate(in vec2 st, in float radians) {\n #ifdef CENTER_2D\n return rotate(st, radians, CENTER_2D);\n #else\n return rotate(st, radians, vec2(.5));\n #endif\n}\n\nvec3 rotate(in vec3 xyz, in float radians, in vec3 axis, in vec3 center) {\n return (rotate4d(axis, radians) * vec4(xyz - center, 1.)).xyz + center;\n}\n\nvec3 rotate(in vec3 xyz, in float radians, in vec3 axis) {\n #ifdef CENTER_3D\n return rotate(xyz, radians, axis, CENTER_3D);\n #else\n return rotate(xyz, radians, axis, vec3(0.));\n #endif\n}\n\nvec4 rotate(in vec4 xyzw, in float radians, in vec3 axis, in vec4 center) {\n return rotate4d(axis, radians) * (xyzw - center) + center;\n}\n\nvec4 rotate(in vec4 xyzw, in float radians, in vec3 axis) {\n #ifdef CENTER_4D\n return rotate(xyzw, radians, axis, CENTER_4D);\n #else\n return rotate(xyzw, radians, axis, vec4(0.));\n #endif\n}\n#endif\n'},8535:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dX(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DX\n#define FNC_ROTATE4DX\nmat4 rotate4dX(in float phi){\n return mat4(\n vec4(1.,0.,0.,0),\n vec4(0.,cos(phi),-sin(phi),0.),\n vec4(0.,sin(phi),cos(phi),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian angle\nuse: rotateX(<vec3|vec4> pos, float radian [, vec3 center])\noptions:\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATEX\n#define FNC_ROTATEX\nvec3 rotateX(in vec3 pos, in float radian, in vec3 center) {\n return (rotate4dX(radian) * vec4(pos - center, 1.)).xyz + center;\n}\n\nvec3 rotateX(in vec3 pos, in float radian) {\n #ifdef CENTER_3D\n return rotateX(pos, radian, CENTER_3D);\n #else\n return rotateX(pos, radian, vec3(.0));\n #endif\n}\n#endif\n'},5422:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dY(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DY\n#define FNC_ROTATE4DY\nmat4 rotate4dY(in float theta){\n return mat4(\n vec4(cos(theta),0.,-sin(theta),0),\n vec4(0.,1.,0.,0.),\n vec4(sin(theta),0.,cos(theta),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian angle\nuse: rotateY(<vec3> pos, float radian [, vec4 center])\noptions:\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATEY\n#define FNC_ROTATEY\nvec3 rotateY(in vec3 pos, in float radian, in vec3 center) {\n return (rotate4dY(radian) * vec4((pos - center), 1.)).xyz + center;\n}\n\nvec3 rotateY(in vec3 pos, in float radian) {\n #ifdef CENTER_3D\n return rotateY(pos, radian, CENTER_3D);\n #else\n return rotateY(pos, radian, vec3(.0));\n #endif\n}\n#endif\n'},9174:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dZ(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DZ\n#define FNC_ROTATE4DZ\nmat4 rotate4dZ(in float psi){\n return mat4(\n vec4(cos(psi),-sin(psi),0.,0),\n vec4(sin(psi),cos(psi),0.,0.),\n vec4(0.,0.,1.,0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n\n\n/*\nfunction: rotateZ\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian angle\nuse: rotateZ(<vec3|vec4> pos, float radian [, vec3 center])\noptions:\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATEZ\n#define FNC_ROTATEZ\nvec3 rotateZ(in vec3 pos, in float radian, in vec3 center) {\n return (rotate4dZ(radian) * vec4(pos - center, 0.) ).xyz + center;\n}\n\nvec3 rotateZ(in vec3 pos, in float radian) {\n #ifdef CENTER_3D\n return rotateZ(pos, radian, CENTER_3D);\n #else\n return rotateZ(pos, radian, vec3(.0));\n #endif\n}\n#endif\n'},8457:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: scale a 2D space variable\nuse: scale(<vec2> st, <vec2|float> scale_factor [, <vec2> center])\noptions:\n - CENTER\n - CENTER_2D\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_SCALE\n#define FNC_SCALE\nfloat scale(in float st, in float s, in float center) {\n return (st - center) * s + center;\n}\n\nfloat scale(in float st, in float s) {\n #ifdef CENTER_2D\n return scale(st, s, CENTER);\n #else\n return scale(st, s, .5);\n #endif\n}\n\n\nvec2 scale(in vec2 st, in vec2 s, in vec2 center) {\n return (st - center) * s + center;\n}\n\nvec2 scale(in vec2 st, in float value, in vec2 center) {\n return scale(st, vec2(value), center);\n}\n\nvec2 scale(in vec2 st, in vec2 s) {\n #ifdef CENTER_2D\n return scale(st, s, CENTER_2D);\n #else\n return scale(st, s, vec2(.5));\n #endif\n}\n\nvec2 scale(in vec2 st, in float value) {\n return scale(st, vec2(value));\n}\n\nvec3 scale(in vec3 st, in vec3 s, in vec3 center) {\n return (st - center) * s + center;\n}\n\nvec3 scale(in vec3 st, in float value, in vec3 center) {\n return scale(st, vec3(value), center);\n}\n\nvec3 scale(in vec3 st, in vec3 s) {\n #ifdef CENTER_3D\n return scale(st, s, CENTER_3D);\n #else\n return scale(st, s, vec3(.5));\n #endif\n}\n\nvec3 scale(in vec3 st, in float value) {\n return scale(st, vec3(value));\n}\n#endif\n'}},n={};function t(i){var o=n[i];if(void 0!==o)return o.exports;var a=n[i]={exports:{}};return e[i](a,a.exports,t),a.exports}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var i={};(()=>{t.d(i,{Z:()=>f});var e=t(7225),n=t.n(e),o=t(9357),a=t.n(o),s=t(1904),r=t.n(s),T=t(8535),E=t.n(T),O=t(5422),R=t.n(O),c=t(9174),I=t.n(c),N=t(8457),A=t.n(N),d=t(7358),l=t.n(d);const f={flipY:n(),ratio:a(),rotate:r(),rotateX:E(),rotateY:R(),rotateZ:I(),scale:A(),linearizeDepth:l()}})();var o=i.Z;export{o as default}; | ||
var e = { | ||
7225: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Flip Y axis\nuse: flipY(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_FLIPY\n#define FNC_FLIPY\nvec2 flipY(in vec2 st) {\n return vec2(st.x, 1. - st.y);\n}\n#endif\n' | ||
}, | ||
7358: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: linearize depth\nuse: linearizeDepth(<float> depth, <float> near, <float> far)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LINEARIZE_DEPTH\n#define FNC_LINEARIZE_DEPTH\n\nfloat linearizeDepth(float depth, float near, float far) {\n depth = 2.0 * depth - 1.0;\n return (2.0 * near) / (far + near - depth * (far - near));\n}\n\n#endif' | ||
}, | ||
9357: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Fix the aspect ratio of a space keeping things squared for you.\nuse: ratio(vec2 st, vec2 st_size)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_RATIO\n#define FNC_RATIO\nvec2 ratio(in vec2 st, in vec2 s) {\n return mix( vec2((st.x*s.x/s.y)-(s.x*.5-s.y*.5)/s.y,st.y),\n vec2(st.x,st.y*(s.y/s.x)-(s.y*.5-s.x*.5)/s.x),\n step(s.x,s.y));\n}\n#endif\n' | ||
}, | ||
1904: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 2x2 rotation matrix\nuse: rotate2d(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE2D\n#define FNC_ROTATE2D\nmat2 rotate2d(in float radians){\n float c = cos(radians);\n float s = sin(radians);\n return mat2(c, -s, s, c);\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4d(<vec3> axis, <float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4D\n#define FNC_ROTATE4D\nmat4 rotate4d(in vec3 axis, in float radians) {\n axis = normalize(axis);\n float s = sin(radians);\n float c = cos(radians);\n float oc = 1.0 - c;\n\n return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,\n oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,\n oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian radians\nuse: rotate(<vec3|vec2> st, float radians [, vec2 center])\noptions:\n - CENTER_2D\n - CENTER_3D\n - CENTER_4D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATE\n#define FNC_ROTATE\nvec2 rotate(in vec2 st, in float radians, in vec2 center) {\n return rotate2d(radians) * (st - center) + center;\n}\n\nvec2 rotate(in vec2 st, in float radians) {\n #ifdef CENTER_2D\n return rotate(st, radians, CENTER_2D);\n #else\n return rotate(st, radians, vec2(.5));\n #endif\n}\n\nvec3 rotate(in vec3 xyz, in float radians, in vec3 axis, in vec3 center) {\n return (rotate4d(axis, radians) * vec4(xyz - center, 1.)).xyz + center;\n}\n\nvec3 rotate(in vec3 xyz, in float radians, in vec3 axis) {\n #ifdef CENTER_3D\n return rotate(xyz, radians, axis, CENTER_3D);\n #else\n return rotate(xyz, radians, axis, vec3(0.));\n #endif\n}\n\nvec4 rotate(in vec4 xyzw, in float radians, in vec3 axis, in vec4 center) {\n return rotate4d(axis, radians) * (xyzw - center) + center;\n}\n\nvec4 rotate(in vec4 xyzw, in float radians, in vec3 axis) {\n #ifdef CENTER_4D\n return rotate(xyzw, radians, axis, CENTER_4D);\n #else\n return rotate(xyzw, radians, axis, vec4(0.));\n #endif\n}\n#endif\n' | ||
}, | ||
8535: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dX(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DX\n#define FNC_ROTATE4DX\nmat4 rotate4dX(in float phi){\n return mat4(\n vec4(1.,0.,0.,0),\n vec4(0.,cos(phi),-sin(phi),0.),\n vec4(0.,sin(phi),cos(phi),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian angle\nuse: rotateX(<vec3|vec4> pos, float radian [, vec3 center])\noptions:\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATEX\n#define FNC_ROTATEX\nvec3 rotateX(in vec3 pos, in float radian, in vec3 center) {\n return (rotate4dX(radian) * vec4(pos - center, 1.)).xyz + center;\n}\n\nvec3 rotateX(in vec3 pos, in float radian) {\n #ifdef CENTER_3D\n return rotateX(pos, radian, CENTER_3D);\n #else\n return rotateX(pos, radian, vec3(.0));\n #endif\n}\n#endif\n' | ||
}, | ||
5422: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dY(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DY\n#define FNC_ROTATE4DY\nmat4 rotate4dY(in float theta){\n return mat4(\n vec4(cos(theta),0.,-sin(theta),0),\n vec4(0.,1.,0.,0.),\n vec4(sin(theta),0.,cos(theta),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian angle\nuse: rotateY(<vec3> pos, float radian [, vec4 center])\noptions:\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATEY\n#define FNC_ROTATEY\nvec3 rotateY(in vec3 pos, in float radian, in vec3 center) {\n return (rotate4dY(radian) * vec4((pos - center), 1.)).xyz + center;\n}\n\nvec3 rotateY(in vec3 pos, in float radian) {\n #ifdef CENTER_3D\n return rotateY(pos, radian, CENTER_3D);\n #else\n return rotateY(pos, radian, vec3(.0));\n #endif\n}\n#endif\n' | ||
}, | ||
9174: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dZ(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DZ\n#define FNC_ROTATE4DZ\nmat4 rotate4dZ(in float psi){\n return mat4(\n vec4(cos(psi),-sin(psi),0.,0),\n vec4(sin(psi),cos(psi),0.,0.),\n vec4(0.,0.,1.,0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n\n\n/*\nfunction: rotateZ\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian angle\nuse: rotateZ(<vec3|vec4> pos, float radian [, vec3 center])\noptions:\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATEZ\n#define FNC_ROTATEZ\nvec3 rotateZ(in vec3 pos, in float radian, in vec3 center) {\n return (rotate4dZ(radian) * vec4(pos - center, 0.) ).xyz + center;\n}\n\nvec3 rotateZ(in vec3 pos, in float radian) {\n #ifdef CENTER_3D\n return rotateZ(pos, radian, CENTER_3D);\n #else\n return rotateZ(pos, radian, vec3(.0));\n #endif\n}\n#endif\n' | ||
}, | ||
8457: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: scale a 2D space variable\nuse: scale(<vec2> st, <vec2|float> scale_factor [, <vec2> center])\noptions:\n - CENTER\n - CENTER_2D\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_SCALE\n#define FNC_SCALE\nfloat scale(in float st, in float s, in float center) {\n return (st - center) * s + center;\n}\n\nfloat scale(in float st, in float s) {\n #ifdef CENTER_2D\n return scale(st, s, CENTER);\n #else\n return scale(st, s, .5);\n #endif\n}\n\n\nvec2 scale(in vec2 st, in vec2 s, in vec2 center) {\n return (st - center) * s + center;\n}\n\nvec2 scale(in vec2 st, in float value, in vec2 center) {\n return scale(st, vec2(value), center);\n}\n\nvec2 scale(in vec2 st, in vec2 s) {\n #ifdef CENTER_2D\n return scale(st, s, CENTER_2D);\n #else\n return scale(st, s, vec2(.5));\n #endif\n}\n\nvec2 scale(in vec2 st, in float value) {\n return scale(st, vec2(value));\n}\n\nvec3 scale(in vec3 st, in vec3 s, in vec3 center) {\n return (st - center) * s + center;\n}\n\nvec3 scale(in vec3 st, in float value, in vec3 center) {\n return scale(st, vec3(value), center);\n}\n\nvec3 scale(in vec3 st, in vec3 s) {\n #ifdef CENTER_3D\n return scale(st, s, CENTER_3D);\n #else\n return scale(st, s, vec3(.5));\n #endif\n}\n\nvec3 scale(in vec3 st, in float value) {\n return scale(st, vec3(value));\n}\n#endif\n' | ||
}, | ||
}, | ||
n = {} | ||
function t(i) { | ||
var o = n[i] | ||
if (void 0 !== o) return o.exports | ||
var a = (n[i] = { exports: {} }) | ||
return e[i](a, a.exports, t), a.exports | ||
} | ||
;(t.d = (e, n) => { | ||
for (var i in n) | ||
t.o(n, i) && | ||
!t.o(e, i) && | ||
Object.defineProperty(e, i, { enumerable: !0, get: n[i] }) | ||
}), | ||
(t.o = (e, n) => Object.prototype.hasOwnProperty.call(e, n)) | ||
var i = {} | ||
;(() => { | ||
t.d(i, { Z: () => e }) | ||
const e = { | ||
flipY: t(7225), | ||
ratio: t(9357), | ||
rotate: t(1904), | ||
rotateX: t(8535), | ||
rotateY: t(5422), | ||
rotateZ: t(9174), | ||
scale: t(8457), | ||
linearizeDepth: t(7358), | ||
} | ||
})() | ||
var o = i.Z | ||
export { o as default } |
@@ -1,1 +0,105 @@ | ||
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.lygia=e():n.Lygia=e()}(self,(function(){return(()=>{var n={4912:n=>{n.exports='/*\ndescription: Include all available easing animations\n*/\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Back easing. From https://github.com/stackgl/glsl-easings\nuse: back<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BACKIN\n#define FNC_BACKIN\nfloat backIn(in float t) {\n return pow(t, 3.) - t * sin(t * PI);\n}\n#endif\n\n#ifndef FNC_BACKOUT\n#define FNC_BACKOUT\nfloat backOut(in float t) {\n return 1. - backIn(1. - t);\n}\n#endif\n\n#ifndef FNC_BACKINOUT\n#define FNC_BACKINOUT\nfloat backInOut(in float t) {\n float f = t < .5\n ? 2.0 * t\n : 1.0 - (2.0 * t - 1.0);\n\n float g = backIn(f);\n\n return t < 0.5\n ? 0.5 * g\n : 0.5 * (1.0 - g) + 0.5;\n}\n#endif\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: bounce easing. From https://github.com/stackgl/glsl-easings\nuse: bounce<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BOUNCEOUT\n#define FNC_BOUNCEOUT\nfloat bounceOut(in float t) {\n const float a = 4.0 / 11.0;\n const float b = 8.0 / 11.0;\n const float c = 9.0 / 10.0;\n\n const float ca = 4356.0 / 361.0;\n const float cb = 35442.0 / 1805.0;\n const float cc = 16061.0 / 1805.0;\n\n float t2 = t * t;\n\n return t < a\n ? 7.5625 * t2\n : t < b\n ? 9.075 * t2 - 9.9 * t + 3.4\n : t < c\n ? ca * t2 - cb * t + cc\n : 10.8 * t * t - 20.52 * t + 10.72;\n}\n#endif\n\n#ifndef FNC_BOUNCEIN\n#define FNC_BOUNCEIN\nfloat bounceIn(in float t) {\n return 1.0 - bounceOut(1.0 - t);\n}\n#endif\n\n#ifndef FNC_BOUNCEINOUT\n#define FNC_BOUNCEINOUT\nfloat bounceInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0))\n : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: circular easing. From https://github.com/stackgl/glsl-easings\nuse: circular<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CIRCULARIN\n#define FNC_CIRCULARIN\nfloat circularIn(in float t) {\n return 1.0 - sqrt(1.0 - t * t);\n}\n#endif\n\n#ifndef FNC_CIRCULAROUT\n#define FNC_CIRCULAROUT\nfloat circularOut(in float t) {\n return sqrt((2.0 - t) * t);\n}\n#endif\n\n#ifndef FNC_CIRCULARINOUT\n#define FNC_CIRCULARINOUT\nfloat circularInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - sqrt(1.0 - 4.0 * t * t))\n : 0.5 * (sqrt((3.0 - 2.0 * t) * (2.0 * t - 1.0)) + 1.0);\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: cubic easing. From https://github.com/stackgl/glsl-easings\nuse: cubic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CUBICIN\n#define FNC_CUBICIN\nfloat cubicIn(in float t) {\n return t * t * t;\n}\n#endif\n\n#ifndef FNC_CUBICOUT\n#define FNC_CUBICOUT\nfloat cubicOut(in float t) {\n float f = t - 1.0;\n return f * f * f + 1.0;\n}\n#endif\n\n#ifndef FNC_CUBICINOUT\n#define FNC_CUBICINOUT\nfloat cubicInOut(in float t) {\n return t < 0.5\n ? 4.0 * t * t * t\n : 0.5 * pow(2.0 * t - 2.0, 3.0) + 1.0;\n}\n#endif\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: elastic easing. From https://github.com/stackgl/glsl-easings\nuse: elastic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_ELASTICIN\n#define FNC_ELASTICIN\nfloat elasticIn(in float t) {\n return sin(13.0 * t * HALF_PI) * pow(2.0, 10.0 * (t - 1.0));\n}\n#endif \n\n#ifndef FNC_ELASTICOUT\n#define FNC_ELASTICOUT\nfloat elasticOut(in float t) {\n return sin(-13.0 * (t + 1.0) * HALF_PI) * pow(2.0, -10.0 * t) + 1.0;\n}\n#endif\n\n#ifndef FNC_ELASTICINOUT\n#define FNC_ELASTICINOUT\nfloat elasticInOut(in float t) {\n return t < 0.5\n ? 0.5 * sin(+13.0 * HALF_PI * 2.0 * t) * pow(2.0, 10.0 * (2.0 * t - 1.0))\n : 0.5 * sin(-13.0 * HALF_PI * ((2.0 * t - 1.0) + 1.0)) * pow(2.0, -10.0 * (2.0 * t - 1.0)) + 1.0;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: exponential easing. From https://github.com/stackgl/glsl-easings\nuse: exponential<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_EXPONENTIALIN\n#define FNC_EXPONENTIALIN\nfloat exponentialIn(in float t) {\n return t == 0.0 ? t : pow(2.0, 10.0 * (t - 1.0));\n}\n#endif\n\n#ifndef FNC_EXPONENTIALOUT\n#define FNC_EXPONENTIALOUT\nfloat exponentialOut(in float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n#endif\n\n#ifndef FNC_EXPONENTIALINOUT\n#define FNC_EXPONENTIALINOUT\nfloat exponentialInOut(in float t) {\n return t == 0.0 || t == 1.0\n ? t\n : t < 0.5\n ? +0.5 * pow(2.0, (20.0 * t) - 10.0)\n : -0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0;\n}\n#endif\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Linear easing. From https://github.com/stackgl/glsl-easings\nuse: linear(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_LINEAR\n#define FNC_LINEAR\nfloat linear(in float t) {\n return t;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quadrtic easing. From https://github.com/stackgl/glsl-easings\nuse: quadratic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUADRATICIN\n#define FNC_QUADRATICIN\nfloat quadraticIn(in float t) {\n return t * t;\n}\n#endif\n\n#ifndef FNC_QUADRATICOUT\n#define FNC_QUADRATICOUT\nfloat quadraticOut(in float t) {\n return -t * (t - 2.0);\n}\n#endif\n\n#ifndef FNC_QUADRATICINOUT\n#define FNC_QUADRATICINOUT\nfloat quadraticInOut(in float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quintic easing. From https://github.com/stackgl/glsl-easings\nuse: quintic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUINTICIN\n#define FNC_QUINTICIN\nfloat quinticIn(in float t) {\n return pow(t, 5.0);\n}\n#endif\n\n#ifndef FNC_QUINTICOUT\n#define FNC_QUINTICOUT\nfloat quinticOut(in float t) {\n return 1.0 - (pow(t - 1.0, 5.0));\n}\n#endif\n\n#ifndef FNC_QUINTICINOUT\n#define FNC_QUINTICINOUT\nfloat quinticInOut(in float t) {\n return t < 0.5\n ? +16.0 * pow(t, 5.0)\n : -0.5 * pow(2.0 * t - 2.0, 5.0) + 1.0;\n}\n#endif\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: sine easing. From https://github.com/stackgl/glsl-easings\nuse: sine<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QINTICIN\n#define FNC_QINTICIN\nfloat sineIn(in float t) {\n return sin((t - 1.0) * HALF_PI) + 1.0;\n}\n#endif\n\n#ifndef FNC_QINTICOUT\n#define FNC_QINTICOUT\nfloat sineOut(in float t) {\n return sin(t * HALF_PI);\n}\n#endif\n\n#ifndef FNC_QINTICINOUT\n#define FNC_QINTICINOUT\nfloat sineInOut(in float t) {\n return -0.5 * (cos(PI * t) - 1.0);\n}\n#endif\n'},1198:n=>{n.exports='#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Back easing. From https://github.com/stackgl/glsl-easings\nuse: back<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BACKIN\n#define FNC_BACKIN\nfloat backIn(in float t) {\n return pow(t, 3.) - t * sin(t * PI);\n}\n#endif\n\n#ifndef FNC_BACKOUT\n#define FNC_BACKOUT\nfloat backOut(in float t) {\n return 1. - backIn(1. - t);\n}\n#endif\n\n#ifndef FNC_BACKINOUT\n#define FNC_BACKINOUT\nfloat backInOut(in float t) {\n float f = t < .5\n ? 2.0 * t\n : 1.0 - (2.0 * t - 1.0);\n\n float g = backIn(f);\n\n return t < 0.5\n ? 0.5 * g\n : 0.5 * (1.0 - g) + 0.5;\n}\n#endif\n'},6788:n=>{n.exports='#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: bounce easing. From https://github.com/stackgl/glsl-easings\nuse: bounce<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BOUNCEOUT\n#define FNC_BOUNCEOUT\nfloat bounceOut(in float t) {\n const float a = 4.0 / 11.0;\n const float b = 8.0 / 11.0;\n const float c = 9.0 / 10.0;\n\n const float ca = 4356.0 / 361.0;\n const float cb = 35442.0 / 1805.0;\n const float cc = 16061.0 / 1805.0;\n\n float t2 = t * t;\n\n return t < a\n ? 7.5625 * t2\n : t < b\n ? 9.075 * t2 - 9.9 * t + 3.4\n : t < c\n ? ca * t2 - cb * t + cc\n : 10.8 * t * t - 20.52 * t + 10.72;\n}\n#endif\n\n#ifndef FNC_BOUNCEIN\n#define FNC_BOUNCEIN\nfloat bounceIn(in float t) {\n return 1.0 - bounceOut(1.0 - t);\n}\n#endif\n\n#ifndef FNC_BOUNCEINOUT\n#define FNC_BOUNCEINOUT\nfloat bounceInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0))\n : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;\n}\n#endif\n'},4477:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: circular easing. From https://github.com/stackgl/glsl-easings\nuse: circular<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CIRCULARIN\n#define FNC_CIRCULARIN\nfloat circularIn(in float t) {\n return 1.0 - sqrt(1.0 - t * t);\n}\n#endif\n\n#ifndef FNC_CIRCULAROUT\n#define FNC_CIRCULAROUT\nfloat circularOut(in float t) {\n return sqrt((2.0 - t) * t);\n}\n#endif\n\n#ifndef FNC_CIRCULARINOUT\n#define FNC_CIRCULARINOUT\nfloat circularInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - sqrt(1.0 - 4.0 * t * t))\n : 0.5 * (sqrt((3.0 - 2.0 * t) * (2.0 * t - 1.0)) + 1.0);\n}\n#endif\n'},134:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: cubic easing. From https://github.com/stackgl/glsl-easings\nuse: cubic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CUBICIN\n#define FNC_CUBICIN\nfloat cubicIn(in float t) {\n return t * t * t;\n}\n#endif\n\n#ifndef FNC_CUBICOUT\n#define FNC_CUBICOUT\nfloat cubicOut(in float t) {\n float f = t - 1.0;\n return f * f * f + 1.0;\n}\n#endif\n\n#ifndef FNC_CUBICINOUT\n#define FNC_CUBICINOUT\nfloat cubicInOut(in float t) {\n return t < 0.5\n ? 4.0 * t * t * t\n : 0.5 * pow(2.0 * t - 2.0, 3.0) + 1.0;\n}\n#endif\n'},4621:n=>{n.exports='#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: elastic easing. From https://github.com/stackgl/glsl-easings\nuse: elastic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_ELASTICIN\n#define FNC_ELASTICIN\nfloat elasticIn(in float t) {\n return sin(13.0 * t * HALF_PI) * pow(2.0, 10.0 * (t - 1.0));\n}\n#endif \n\n#ifndef FNC_ELASTICOUT\n#define FNC_ELASTICOUT\nfloat elasticOut(in float t) {\n return sin(-13.0 * (t + 1.0) * HALF_PI) * pow(2.0, -10.0 * t) + 1.0;\n}\n#endif\n\n#ifndef FNC_ELASTICINOUT\n#define FNC_ELASTICINOUT\nfloat elasticInOut(in float t) {\n return t < 0.5\n ? 0.5 * sin(+13.0 * HALF_PI * 2.0 * t) * pow(2.0, 10.0 * (2.0 * t - 1.0))\n : 0.5 * sin(-13.0 * HALF_PI * ((2.0 * t - 1.0) + 1.0)) * pow(2.0, -10.0 * (2.0 * t - 1.0)) + 1.0;\n}\n#endif\n'},3814:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: exponential easing. From https://github.com/stackgl/glsl-easings\nuse: exponential<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_EXPONENTIALIN\n#define FNC_EXPONENTIALIN\nfloat exponentialIn(in float t) {\n return t == 0.0 ? t : pow(2.0, 10.0 * (t - 1.0));\n}\n#endif\n\n#ifndef FNC_EXPONENTIALOUT\n#define FNC_EXPONENTIALOUT\nfloat exponentialOut(in float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n#endif\n\n#ifndef FNC_EXPONENTIALINOUT\n#define FNC_EXPONENTIALINOUT\nfloat exponentialInOut(in float t) {\n return t == 0.0 || t == 1.0\n ? t\n : t < 0.5\n ? +0.5 * pow(2.0, (20.0 * t) - 10.0)\n : -0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0;\n}\n#endif'},406:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Linear easing. From https://github.com/stackgl/glsl-easings\nuse: linear(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_LINEAR\n#define FNC_LINEAR\nfloat linear(in float t) {\n return t;\n}\n#endif\n'},6463:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quadrtic easing. From https://github.com/stackgl/glsl-easings\nuse: quadratic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUADRATICIN\n#define FNC_QUADRATICIN\nfloat quadraticIn(in float t) {\n return t * t;\n}\n#endif\n\n#ifndef FNC_QUADRATICOUT\n#define FNC_QUADRATICOUT\nfloat quadraticOut(in float t) {\n return -t * (t - 2.0);\n}\n#endif\n\n#ifndef FNC_QUADRATICINOUT\n#define FNC_QUADRATICINOUT\nfloat quadraticInOut(in float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n#endif\n'},7549:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quartic easing. From https://github.com/stackgl/glsl-easings\nuse: quartic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUARTICIN\n#define FNC_QUARTICIN\nfloat quarticIn(in float t) {\n return pow(t, 4.0);\n}\n#endif\n\n#ifndef FNC_QUARTICOUT\n#define FNC_QUARTICOUT\nfloat quarticOut(in float t) {\n return pow(t - 1.0, 3.0) * (1.0 - t) + 1.0;\n}\n#endif\n\n#ifndef FNC_QUARTICINOUT\n#define FNC_QUARTICINOUT\nfloat quarticInOut(in float t) {\n return t < 0.5\n ? +8.0 * pow(t, 4.0)\n : -8.0 * pow(t - 1.0, 4.0) + 1.0;\n}\n#endif\n'},173:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quintic easing. From https://github.com/stackgl/glsl-easings\nuse: quintic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUINTICIN\n#define FNC_QUINTICIN\nfloat quinticIn(in float t) {\n return pow(t, 5.0);\n}\n#endif\n\n#ifndef FNC_QUINTICOUT\n#define FNC_QUINTICOUT\nfloat quinticOut(in float t) {\n return 1.0 - (pow(t - 1.0, 5.0));\n}\n#endif\n\n#ifndef FNC_QUINTICINOUT\n#define FNC_QUINTICINOUT\nfloat quinticInOut(in float t) {\n return t < 0.5\n ? +16.0 * pow(t, 5.0)\n : -0.5 * pow(2.0 * t - 2.0, 5.0) + 1.0;\n}\n#endif\n'},3241:n=>{n.exports='#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: sine easing. From https://github.com/stackgl/glsl-easings\nuse: sine<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QINTICIN\n#define FNC_QINTICIN\nfloat sineIn(in float t) {\n return sin((t - 1.0) * HALF_PI) + 1.0;\n}\n#endif\n\n#ifndef FNC_QINTICOUT\n#define FNC_QINTICOUT\nfloat sineOut(in float t) {\n return sin(t * HALF_PI);\n}\n#endif\n\n#ifndef FNC_QINTICINOUT\n#define FNC_QINTICINOUT\nfloat sineInOut(in float t) {\n return -0.5 * (cos(PI * t) - 1.0);\n}\n#endif'}},e={};function t(i){var o=e[i];if(void 0!==o)return o.exports;var I=e[i]={exports:{}};return n[i](I,I.exports,t),I.exports}t.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return t.d(e,{a:e}),e},t.d=(n,e)=>{for(var i in e)t.o(e,i)&&!t.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:e[i]})},t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),t.r=n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var i={};return(()=>{"use strict";t.r(i),t.d(i,{default:()=>g});var n=t(4912),e=t.n(n),o=t(1198),I=t.n(o),s=t(4477),f=t.n(s),O=t(4621),T=t.n(O),N=t(406),a=t.n(N),E=t(7549),d=t.n(E),r=t(3241),R=t.n(r),A=t(6788),l=t.n(A),h=t(134),u=t.n(h),c=t(3814),S=t.n(c),C=t(6463),L=t.n(C),H=t(173),F=t.n(H);const p={back:I(),circular:f(),elastic:T(),linear:a(),quartic:d(),sine:R(),bounce:l(),cubic:u(),exponential:S(),quadratic:L(),quintic:F()},g={easing:Object.assign(e(),p)}})(),i})()})); | ||
!(function (n, e) { | ||
'object' == typeof exports && 'object' == typeof module | ||
? (module.exports = e()) | ||
: 'function' == typeof define && define.amd | ||
? define([], e) | ||
: 'object' == typeof exports | ||
? (exports.lygia = e()) | ||
: (n.Lygia = e()) | ||
})(self, function () { | ||
return (() => { | ||
var n = { | ||
4912: (n) => { | ||
n.exports = | ||
'/*\ndescription: Include all available easing animations\n*/\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Back easing. From https://github.com/stackgl/glsl-easings\nuse: back<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BACKIN\n#define FNC_BACKIN\nfloat backIn(in float t) {\n return pow(t, 3.) - t * sin(t * PI);\n}\n#endif\n\n#ifndef FNC_BACKOUT\n#define FNC_BACKOUT\nfloat backOut(in float t) {\n return 1. - backIn(1. - t);\n}\n#endif\n\n#ifndef FNC_BACKINOUT\n#define FNC_BACKINOUT\nfloat backInOut(in float t) {\n float f = t < .5\n ? 2.0 * t\n : 1.0 - (2.0 * t - 1.0);\n\n float g = backIn(f);\n\n return t < 0.5\n ? 0.5 * g\n : 0.5 * (1.0 - g) + 0.5;\n}\n#endif\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: bounce easing. From https://github.com/stackgl/glsl-easings\nuse: bounce<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BOUNCEOUT\n#define FNC_BOUNCEOUT\nfloat bounceOut(in float t) {\n const float a = 4.0 / 11.0;\n const float b = 8.0 / 11.0;\n const float c = 9.0 / 10.0;\n\n const float ca = 4356.0 / 361.0;\n const float cb = 35442.0 / 1805.0;\n const float cc = 16061.0 / 1805.0;\n\n float t2 = t * t;\n\n return t < a\n ? 7.5625 * t2\n : t < b\n ? 9.075 * t2 - 9.9 * t + 3.4\n : t < c\n ? ca * t2 - cb * t + cc\n : 10.8 * t * t - 20.52 * t + 10.72;\n}\n#endif\n\n#ifndef FNC_BOUNCEIN\n#define FNC_BOUNCEIN\nfloat bounceIn(in float t) {\n return 1.0 - bounceOut(1.0 - t);\n}\n#endif\n\n#ifndef FNC_BOUNCEINOUT\n#define FNC_BOUNCEINOUT\nfloat bounceInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0))\n : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: circular easing. From https://github.com/stackgl/glsl-easings\nuse: circular<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CIRCULARIN\n#define FNC_CIRCULARIN\nfloat circularIn(in float t) {\n return 1.0 - sqrt(1.0 - t * t);\n}\n#endif\n\n#ifndef FNC_CIRCULAROUT\n#define FNC_CIRCULAROUT\nfloat circularOut(in float t) {\n return sqrt((2.0 - t) * t);\n}\n#endif\n\n#ifndef FNC_CIRCULARINOUT\n#define FNC_CIRCULARINOUT\nfloat circularInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - sqrt(1.0 - 4.0 * t * t))\n : 0.5 * (sqrt((3.0 - 2.0 * t) * (2.0 * t - 1.0)) + 1.0);\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: cubic easing. From https://github.com/stackgl/glsl-easings\nuse: cubic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CUBICIN\n#define FNC_CUBICIN\nfloat cubicIn(in float t) {\n return t * t * t;\n}\n#endif\n\n#ifndef FNC_CUBICOUT\n#define FNC_CUBICOUT\nfloat cubicOut(in float t) {\n float f = t - 1.0;\n return f * f * f + 1.0;\n}\n#endif\n\n#ifndef FNC_CUBICINOUT\n#define FNC_CUBICINOUT\nfloat cubicInOut(in float t) {\n return t < 0.5\n ? 4.0 * t * t * t\n : 0.5 * pow(2.0 * t - 2.0, 3.0) + 1.0;\n}\n#endif\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: elastic easing. From https://github.com/stackgl/glsl-easings\nuse: elastic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_ELASTICIN\n#define FNC_ELASTICIN\nfloat elasticIn(in float t) {\n return sin(13.0 * t * HALF_PI) * pow(2.0, 10.0 * (t - 1.0));\n}\n#endif \n\n#ifndef FNC_ELASTICOUT\n#define FNC_ELASTICOUT\nfloat elasticOut(in float t) {\n return sin(-13.0 * (t + 1.0) * HALF_PI) * pow(2.0, -10.0 * t) + 1.0;\n}\n#endif\n\n#ifndef FNC_ELASTICINOUT\n#define FNC_ELASTICINOUT\nfloat elasticInOut(in float t) {\n return t < 0.5\n ? 0.5 * sin(+13.0 * HALF_PI * 2.0 * t) * pow(2.0, 10.0 * (2.0 * t - 1.0))\n : 0.5 * sin(-13.0 * HALF_PI * ((2.0 * t - 1.0) + 1.0)) * pow(2.0, -10.0 * (2.0 * t - 1.0)) + 1.0;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: exponential easing. From https://github.com/stackgl/glsl-easings\nuse: exponential<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_EXPONENTIALIN\n#define FNC_EXPONENTIALIN\nfloat exponentialIn(in float t) {\n return t == 0.0 ? t : pow(2.0, 10.0 * (t - 1.0));\n}\n#endif\n\n#ifndef FNC_EXPONENTIALOUT\n#define FNC_EXPONENTIALOUT\nfloat exponentialOut(in float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n#endif\n\n#ifndef FNC_EXPONENTIALINOUT\n#define FNC_EXPONENTIALINOUT\nfloat exponentialInOut(in float t) {\n return t == 0.0 || t == 1.0\n ? t\n : t < 0.5\n ? +0.5 * pow(2.0, (20.0 * t) - 10.0)\n : -0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0;\n}\n#endif\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Linear easing. From https://github.com/stackgl/glsl-easings\nuse: linear(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_LINEAR\n#define FNC_LINEAR\nfloat linear(in float t) {\n return t;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quadrtic easing. From https://github.com/stackgl/glsl-easings\nuse: quadratic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUADRATICIN\n#define FNC_QUADRATICIN\nfloat quadraticIn(in float t) {\n return t * t;\n}\n#endif\n\n#ifndef FNC_QUADRATICOUT\n#define FNC_QUADRATICOUT\nfloat quadraticOut(in float t) {\n return -t * (t - 2.0);\n}\n#endif\n\n#ifndef FNC_QUADRATICINOUT\n#define FNC_QUADRATICINOUT\nfloat quadraticInOut(in float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quintic easing. From https://github.com/stackgl/glsl-easings\nuse: quintic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUINTICIN\n#define FNC_QUINTICIN\nfloat quinticIn(in float t) {\n return pow(t, 5.0);\n}\n#endif\n\n#ifndef FNC_QUINTICOUT\n#define FNC_QUINTICOUT\nfloat quinticOut(in float t) {\n return 1.0 - (pow(t - 1.0, 5.0));\n}\n#endif\n\n#ifndef FNC_QUINTICINOUT\n#define FNC_QUINTICINOUT\nfloat quinticInOut(in float t) {\n return t < 0.5\n ? +16.0 * pow(t, 5.0)\n : -0.5 * pow(2.0 * t - 2.0, 5.0) + 1.0;\n}\n#endif\n\n#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: sine easing. From https://github.com/stackgl/glsl-easings\nuse: sine<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_SINEIN\n#define FNC_SINEIN\nfloat sineIn(in float t) {\n return sin((t - 1.0) * HALF_PI) + 1.0;\n}\n#endif\n\n#ifndef FNC_SINEOUT\n#define FNC_SINEOUT\nfloat sineOut(in float t) {\n return sin(t * HALF_PI);\n}\n#endif\n\n#ifndef FNC_SINEINOUT\n#define FNC_SINEINOUT\nfloat sineInOut(in float t) {\n return -0.5 * (cos(PI * t) - 1.0);\n}\n#endif\n\n' | ||
}, | ||
1198: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Back easing. From https://github.com/stackgl/glsl-easings\nuse: back<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BACKIN\n#define FNC_BACKIN\nfloat backIn(in float t) {\n return pow(t, 3.) - t * sin(t * PI);\n}\n#endif\n\n#ifndef FNC_BACKOUT\n#define FNC_BACKOUT\nfloat backOut(in float t) {\n return 1. - backIn(1. - t);\n}\n#endif\n\n#ifndef FNC_BACKINOUT\n#define FNC_BACKINOUT\nfloat backInOut(in float t) {\n float f = t < .5\n ? 2.0 * t\n : 1.0 - (2.0 * t - 1.0);\n\n float g = backIn(f);\n\n return t < 0.5\n ? 0.5 * g\n : 0.5 * (1.0 - g) + 0.5;\n}\n#endif\n' | ||
}, | ||
6788: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: bounce easing. From https://github.com/stackgl/glsl-easings\nuse: bounce<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_BOUNCEOUT\n#define FNC_BOUNCEOUT\nfloat bounceOut(in float t) {\n const float a = 4.0 / 11.0;\n const float b = 8.0 / 11.0;\n const float c = 9.0 / 10.0;\n\n const float ca = 4356.0 / 361.0;\n const float cb = 35442.0 / 1805.0;\n const float cc = 16061.0 / 1805.0;\n\n float t2 = t * t;\n\n return t < a\n ? 7.5625 * t2\n : t < b\n ? 9.075 * t2 - 9.9 * t + 3.4\n : t < c\n ? ca * t2 - cb * t + cc\n : 10.8 * t * t - 20.52 * t + 10.72;\n}\n#endif\n\n#ifndef FNC_BOUNCEIN\n#define FNC_BOUNCEIN\nfloat bounceIn(in float t) {\n return 1.0 - bounceOut(1.0 - t);\n}\n#endif\n\n#ifndef FNC_BOUNCEINOUT\n#define FNC_BOUNCEINOUT\nfloat bounceInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0))\n : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;\n}\n#endif\n' | ||
}, | ||
4477: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: circular easing. From https://github.com/stackgl/glsl-easings\nuse: circular<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CIRCULARIN\n#define FNC_CIRCULARIN\nfloat circularIn(in float t) {\n return 1.0 - sqrt(1.0 - t * t);\n}\n#endif\n\n#ifndef FNC_CIRCULAROUT\n#define FNC_CIRCULAROUT\nfloat circularOut(in float t) {\n return sqrt((2.0 - t) * t);\n}\n#endif\n\n#ifndef FNC_CIRCULARINOUT\n#define FNC_CIRCULARINOUT\nfloat circularInOut(in float t) {\n return t < 0.5\n ? 0.5 * (1.0 - sqrt(1.0 - 4.0 * t * t))\n : 0.5 * (sqrt((3.0 - 2.0 * t) * (2.0 * t - 1.0)) + 1.0);\n}\n#endif\n' | ||
}, | ||
134: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: cubic easing. From https://github.com/stackgl/glsl-easings\nuse: cubic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_CUBICIN\n#define FNC_CUBICIN\nfloat cubicIn(in float t) {\n return t * t * t;\n}\n#endif\n\n#ifndef FNC_CUBICOUT\n#define FNC_CUBICOUT\nfloat cubicOut(in float t) {\n float f = t - 1.0;\n return f * f * f + 1.0;\n}\n#endif\n\n#ifndef FNC_CUBICINOUT\n#define FNC_CUBICINOUT\nfloat cubicInOut(in float t) {\n return t < 0.5\n ? 4.0 * t * t * t\n : 0.5 * pow(2.0 * t - 2.0, 3.0) + 1.0;\n}\n#endif\n' | ||
}, | ||
4621: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: elastic easing. From https://github.com/stackgl/glsl-easings\nuse: elastic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_ELASTICIN\n#define FNC_ELASTICIN\nfloat elasticIn(in float t) {\n return sin(13.0 * t * HALF_PI) * pow(2.0, 10.0 * (t - 1.0));\n}\n#endif \n\n#ifndef FNC_ELASTICOUT\n#define FNC_ELASTICOUT\nfloat elasticOut(in float t) {\n return sin(-13.0 * (t + 1.0) * HALF_PI) * pow(2.0, -10.0 * t) + 1.0;\n}\n#endif\n\n#ifndef FNC_ELASTICINOUT\n#define FNC_ELASTICINOUT\nfloat elasticInOut(in float t) {\n return t < 0.5\n ? 0.5 * sin(+13.0 * HALF_PI * 2.0 * t) * pow(2.0, 10.0 * (2.0 * t - 1.0))\n : 0.5 * sin(-13.0 * HALF_PI * ((2.0 * t - 1.0) + 1.0)) * pow(2.0, -10.0 * (2.0 * t - 1.0)) + 1.0;\n}\n#endif\n' | ||
}, | ||
3814: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: exponential easing. From https://github.com/stackgl/glsl-easings\nuse: exponential<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_EXPONENTIALIN\n#define FNC_EXPONENTIALIN\nfloat exponentialIn(in float t) {\n return t == 0.0 ? t : pow(2.0, 10.0 * (t - 1.0));\n}\n#endif\n\n#ifndef FNC_EXPONENTIALOUT\n#define FNC_EXPONENTIALOUT\nfloat exponentialOut(in float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n#endif\n\n#ifndef FNC_EXPONENTIALINOUT\n#define FNC_EXPONENTIALINOUT\nfloat exponentialInOut(in float t) {\n return t == 0.0 || t == 1.0\n ? t\n : t < 0.5\n ? +0.5 * pow(2.0, (20.0 * t) - 10.0)\n : -0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0;\n}\n#endif' | ||
}, | ||
406: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: Linear easing. From https://github.com/stackgl/glsl-easings\nuse: linear(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_LINEAR\n#define FNC_LINEAR\nfloat linear(in float t) {\n return t;\n}\n#endif\n' | ||
}, | ||
6463: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quadrtic easing. From https://github.com/stackgl/glsl-easings\nuse: quadratic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUADRATICIN\n#define FNC_QUADRATICIN\nfloat quadraticIn(in float t) {\n return t * t;\n}\n#endif\n\n#ifndef FNC_QUADRATICOUT\n#define FNC_QUADRATICOUT\nfloat quadraticOut(in float t) {\n return -t * (t - 2.0);\n}\n#endif\n\n#ifndef FNC_QUADRATICINOUT\n#define FNC_QUADRATICINOUT\nfloat quadraticInOut(in float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n#endif\n' | ||
}, | ||
7549: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quartic easing. From https://github.com/stackgl/glsl-easings\nuse: quartic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUARTICIN\n#define FNC_QUARTICIN\nfloat quarticIn(in float t) {\n return pow(t, 4.0);\n}\n#endif\n\n#ifndef FNC_QUARTICOUT\n#define FNC_QUARTICOUT\nfloat quarticOut(in float t) {\n return pow(t - 1.0, 3.0) * (1.0 - t) + 1.0;\n}\n#endif\n\n#ifndef FNC_QUARTICINOUT\n#define FNC_QUARTICINOUT\nfloat quarticInOut(in float t) {\n return t < 0.5\n ? +8.0 * pow(t, 4.0)\n : -8.0 * pow(t - 1.0, 4.0) + 1.0;\n}\n#endif\n' | ||
}, | ||
173: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: quintic easing. From https://github.com/stackgl/glsl-easings\nuse: quintic<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_QUINTICIN\n#define FNC_QUINTICIN\nfloat quinticIn(in float t) {\n return pow(t, 5.0);\n}\n#endif\n\n#ifndef FNC_QUINTICOUT\n#define FNC_QUINTICOUT\nfloat quinticOut(in float t) {\n return 1.0 - (pow(t - 1.0, 5.0));\n}\n#endif\n\n#ifndef FNC_QUINTICINOUT\n#define FNC_QUINTICINOUT\nfloat quinticInOut(in float t) {\n return t < 0.5\n ? +16.0 * pow(t, 5.0)\n : -0.5 * pow(2.0 * t - 2.0, 5.0) + 1.0;\n}\n#endif\n' | ||
}, | ||
3241: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: sine easing. From https://github.com/stackgl/glsl-easings\nuse: sine<In|Out|InOut>(<float> x)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_SINEIN\n#define FNC_SINEIN\nfloat sineIn(in float t) {\n return sin((t - 1.0) * HALF_PI) + 1.0;\n}\n#endif\n\n#ifndef FNC_SINEOUT\n#define FNC_SINEOUT\nfloat sineOut(in float t) {\n return sin(t * HALF_PI);\n}\n#endif\n\n#ifndef FNC_SINEINOUT\n#define FNC_SINEINOUT\nfloat sineInOut(in float t) {\n return -0.5 * (cos(PI * t) - 1.0);\n}\n#endif\n' | ||
}, | ||
}, | ||
e = {} | ||
function t(i) { | ||
var o = e[i] | ||
if (void 0 !== o) return o.exports | ||
var I = (e[i] = { exports: {} }) | ||
return n[i](I, I.exports, t), I.exports | ||
} | ||
;(t.d = (n, e) => { | ||
for (var i in e) | ||
t.o(e, i) && | ||
!t.o(n, i) && | ||
Object.defineProperty(n, i, { enumerable: !0, get: e[i] }) | ||
}), | ||
(t.o = (n, e) => Object.prototype.hasOwnProperty.call(n, e)), | ||
(t.r = (n) => { | ||
'undefined' != typeof Symbol && | ||
Symbol.toStringTag && | ||
Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' }), | ||
Object.defineProperty(n, '__esModule', { value: !0 }) | ||
}) | ||
var i = {} | ||
return ( | ||
(() => { | ||
'use strict' | ||
t.r(i), t.d(i, { default: () => o }) | ||
var n = t(4912) | ||
const e = { | ||
back: t(1198), | ||
circular: t(4477), | ||
elastic: t(4621), | ||
linear: t(406), | ||
quartic: t(7549), | ||
sine: t(3241), | ||
bounce: t(6788), | ||
cubic: t(134), | ||
exponential: t(3814), | ||
quadratic: t(6463), | ||
quintic: t(173), | ||
}, | ||
o = { easing: Object.assign(n, e) } | ||
})(), | ||
i | ||
) | ||
})() | ||
}) |
@@ -1,1 +0,64 @@ | ||
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.lygia=e():n.Lygia=e()}(self,(function(){return(()=>{var n={4249:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Squared length\nuse: lengthSq(<vec2|float2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LENGTHSQ\n#define FNC_LENGTHSQ\nfloat lengthSq(in vec2 st) {\n return dot(st, st);\n}\n\nfloat lengthSq(in vec3 pos) {\n return dot(pos, pos);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Barrel distortion\nuse: barrel(sampler2D tex, <vec2> st, [, <vec2|float> sdf])\noptions:\n BARREL_DISTANCE: function used to shape the distortion, defaults to radial shape with lengthSq\n BARREL_TYPE: return type, defaults to vec3\n BARREL_SAMPLER_FNC: function used to sample the input texture, defaults to texture2D(tex, POS_UV).rgb\n BARREL_OCT_1: one octave of distortion\n BARREL_OCT_2: two octaves of distortion\n BARREL_OCT_3: three octaves of distortion\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef BARREL_DISTANCE\n#define BARREL_DISTANCE dist\n#endif\n\n#ifndef BARREL_TYPE\n#define BARREL_TYPE vec3\n#endif\n\n#ifndef BARREL_SAMPLER_FNC\n#define BARREL_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV).rgb\n#endif\n\n#ifndef FNC_BARREL\n#define FNC_BARREL\nvec2 barrel(vec2 st, float amt, float dist) {\n return st + (st-.5) * (BARREL_DISTANCE) * amt;\n}\n\nvec2 barrel(vec2 st, float amt) {\n return barrel(st, amt, lengthSq(st-.5));\n}\n\nBARREL_TYPE barrel(in sampler2D tex, in vec2 st, float offset) {\n BARREL_TYPE a1 = BARREL_SAMPLER_FNC( barrel(st, .0, offset));\n BARREL_TYPE a2 = BARREL_SAMPLER_FNC( barrel(st, .2, offset));\n BARREL_TYPE a3 = BARREL_SAMPLER_FNC( barrel(st, .4, offset));\n BARREL_TYPE a4 = BARREL_SAMPLER_FNC( barrel(st, .6, offset));\n#ifdef BARREL_OCT_1\n return (a1+a2+a3+a4)/4.;\n#endif\n BARREL_TYPE a5 = BARREL_SAMPLER_FNC( barrel(st, .8, offset));\n BARREL_TYPE a6 = BARREL_SAMPLER_FNC( barrel(st, 1.0, offset));\n BARREL_TYPE a7 = BARREL_SAMPLER_FNC( barrel(st, 1.2, offset));\n BARREL_TYPE a8 = BARREL_SAMPLER_FNC( barrel(st, 1.4, offset));\n#ifdef BARREL_OCT_2\n return (a1+a2+a3+a4+a5+a6+a7+a8)/8.;\n#endif\n BARREL_TYPE a9 = BARREL_SAMPLER_FNC( barrel(st, 1.6, offset));\n BARREL_TYPE a10 = BARREL_SAMPLER_FNC( barrel(st, 1.8, offset));\n BARREL_TYPE a11 = BARREL_SAMPLER_FNC( barrel(st, 2.0, offset));\n BARREL_TYPE a12 = BARREL_SAMPLER_FNC( barrel(st, 2.2, offset));\n return (a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12)/12.;\n}\n\nBARREL_TYPE barrel(in sampler2D tex, in vec2 st, in vec2 offset) {\n return barrel(tex, st, dot(vec2(.5), offset));\n}\n\nBARREL_TYPE barrel(in sampler2D tex, in vec2 st) {\n return barrel(tex, st, lengthSq(st-.5));\n}\n\n#endif\n'},3886:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Squared length\nuse: lengthSq(<vec2|float2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LENGTHSQ\n#define FNC_LENGTHSQ\nfloat lengthSq(in vec2 st) {\n return dot(st, st);\n}\n\nfloat lengthSq(in vec3 pos) {\n return dot(pos, pos);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo, Johan Ismael\ndescription: Chroma Aberration inspired by https://www.shadertoy.com/view/4sX3z4\nuse: chromaAB(<sampler2D> texture, <vec2> st [, <float|vec2> sdf|offset, <float> pct])\noptions:\n CHROMAAB_TYPE: return type, defauls to vec3\n CHROMAAB_PCT: amount of aberration, defaults to 1.5\n CHROMAAB_SAMPLER_FNC: function used to sample the input texture, defaults to texture2D(tex, POS_UV)\n CHROMAAB_CENTER_BUFFER: scalar to attenuate the sdf passed in \nlicense: |\n Copyright (c) 2021 Patricio Gonzalez Vivo and Johan Ismael\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef CHROMAAB_PCT\n#define CHROMAAB_PCT 1.5\n#endif\n\n#ifndef CHROMAAB_TYPE\n#define CHROMAAB_TYPE vec3\n#endif\n\n#ifndef CHROMAAB_SAMPLER_FNC\n#define CHROMAAB_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_CHROMAAB\n#define FNC_CHROMAAB\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in vec2 direction, in vec3 distortion ) {\n vec2 offset = vec2(0.0);\n CHROMAAB_TYPE c = CHROMAAB_TYPE(1.);\n c.r = CHROMAAB_SAMPLER_FNC(st + direction * distortion.r).r;\n c.g = CHROMAAB_SAMPLER_FNC(st + direction * distortion.g).g;\n c.b = CHROMAAB_SAMPLER_FNC(st + direction * distortion.b).b;\n return c;\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in vec2 offset, in float pct) {\n\n #ifdef CHROMAAB_CENTER_BUFFER\n // modify the distance from the center, so that only the edges are affected\n offset = max(offset - CHROMAAB_CENTER_BUFFER, 0.);\n #endif\n\n // Distort the UVs\n vec2 stR = st * (1.0 + offset * 0.02 * pct),\n stB = st * (1.0 - offset * 0.02 * pct);\n\n // Get the individual channels using the modified UVs\n CHROMAAB_TYPE c = CHROMAAB_TYPE(1.);\n c.r = CHROMAAB_SAMPLER_FNC(stR).r;\n c.g = CHROMAAB_SAMPLER_FNC(st).g;\n c.b = CHROMAAB_SAMPLER_FNC(stB).b;\n return c;\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in float sdf, in float pct) {\n return chromaAB(tex, st, vec2(sdf), pct);\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in float sdf) {\n return chromaAB(tex, st, sdf, CHROMAAB_PCT);\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in vec2 offset) {\n return chromaAB(tex, st, offset, CHROMAAB_PCT);\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st) {\n return chromaAB(tex, st, lengthSq(st - .5), CHROMAAB_PCT);\n}\n\n#endif\n'},4775:n=>{n.exports='/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: grad4, used for snoise(vec4 v)\nuse: grad4(<float> j, <vec4> ip)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_GRAD4\n#define FNC_GRAD4\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Simplex Noise https://github.com/ashima/webgl-noise\nuse: snoise(<vec2|vec3|vec4> pos)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n*/\n\n#ifndef FNC_SNOISE\n#define FNC_SNOISE\nfloat snoise(in vec2 v) {\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0\n //i1.y = 1.0 - i1.x;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n // x0 = x0 - 0.0 + 0.0 * C.xx ;\n // x1 = x0 - i1 + 1.0 * C.xx ;\n // x2 = x0 - 1.0 + 2.0 * C.xx ;\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\n\nfloat snoise(in vec3 v) {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n // Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients: 7x7 points over a square, mapped onto an octahedron.\n // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n //Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}\n\nfloat snoise(in vec4 v) {\n const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\n 0.276393202250021, // 2 * G4\n 0.414589803375032, // 3 * G4\n -0.447213595499958); // -1 + 4 * G4\n\n // First corner\n vec4 i = floor(v + dot(v, vec4(.309016994374947451)) ); // (sqrt(5) - 1)/4\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxxx\n // x1 = x0 - i1 + 1.0 * C.xxxx\n // x2 = x0 - i2 + 2.0 * C.xxxx\n // x3 = x0 - i3 + 3.0 * C.xxxx\n // x4 = x0 - 1.0 + 4.0 * C.xxxx\n vec4 x1 = x0 - i1 + C.xxxx;\n vec4 x2 = x0 - i2 + C.yyyy;\n vec4 x3 = x0 - i3 + C.zzzz;\n vec4 x4 = x0 + C.wwww;\n\n // Permutations\n i = mod289(i);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n}\n\nvec3 snoise3( vec3 x ){\n float s = snoise(vec3( x ));\n float s1 = snoise(vec3( x.y - 19.1 , x.z + 33.4 , x.x + 47.2 ));\n float s2 = snoise(vec3( x.z + 74.2 , x.x - 124.5 , x.y + 99.4 ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\nvec3 snoise3( vec4 x ){\n float s = snoise(vec4( x ));\n float s1 = snoise(vec4( x.y - 19.1 , x.z + 33.4 , x.x + 47.2, x.w ));\n float s2 = snoise(vec4( x.z + 74.2 , x.x - 124.5 , x.y + 99.4, x.w ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: fade\nuse: fade(<vec2|vec3|vec4> t)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_FADE\n#define FNC_FADE\nfloat fade(in float t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec2 fade(in vec2 t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec3 fade(in vec3 t) {\n return t * t * t * (t * (t * 6. - 15. ) + 10.);\n}\n\nvec4 fade(vec4 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Classic Perlin Noise with periodic variant https://github.com/ashima/webgl-noise\nuse: pnoise(<vec2|vec3|vec4> pos, <vec2|vec3|vec4> periodic)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n*/\n\n#ifndef FNC_PNOISE\n#define FNC_PNOISE\n// Classic Perlin noise, periodic variant\nfloat pnoise(in vec2 P, in vec2 rep) {\n vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0);\n vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0);\n Pi = mod(Pi, rep.xyxy); // To create noise with explicit period\n Pi = mod289(Pi); // To avoid truncation effects in permutation\n vec4 ix = Pi.xzxz;\n vec4 iy = Pi.yyww;\n vec4 fx = Pf.xzxz;\n vec4 fy = Pf.yyww;\n\n vec4 i = permute(permute(ix) + iy);\n\n vec4 gx = fract(i * (1.0 / 41.0)) * 2.0 - 1.0 ;\n vec4 gy = abs(gx) - 0.5 ;\n vec4 tx = floor(gx + 0.5);\n gx = gx - tx;\n\n vec2 g00 = vec2(gx.x,gy.x);\n vec2 g10 = vec2(gx.y,gy.y);\n vec2 g01 = vec2(gx.z,gy.z);\n vec2 g11 = vec2(gx.w,gy.w);\n\n vec4 norm = taylorInvSqrt(vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)));\n g00 *= norm.x;\n g01 *= norm.y;\n g10 *= norm.z;\n g11 *= norm.w;\n\n float n00 = dot(g00, vec2(fx.x, fy.x));\n float n10 = dot(g10, vec2(fx.y, fy.y));\n float n01 = dot(g01, vec2(fx.z, fy.z));\n float n11 = dot(g11, vec2(fx.w, fy.w));\n\n vec2 fade_xy = fade(Pf.xy);\n vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x);\n float n_xy = mix(n_x.x, n_x.y, fade_xy.y);\n return 2.3 * n_xy;\n}\n\nfloat pnoise(in vec3 P, in vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nfloat pnoise(in vec4 P, in vec4 rep) {\n vec4 Pi0 = mod(floor(P), rep); // Integer part modulo rep\n vec4 Pi1 = mod(Pi0 + 1.0, rep); // Integer part + 1 mod rep\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec4 Pf0 = fract(P); // Fractional part for interpolation\n vec4 Pf1 = Pf0 - 1.0; // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = vec4(Pi0.zzzz);\n vec4 iz1 = vec4(Pi1.zzzz);\n vec4 iw0 = vec4(Pi0.wwww);\n vec4 iw1 = vec4(Pi1.wwww);\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 ixy00 = permute(ixy0 + iw0);\n vec4 ixy01 = permute(ixy0 + iw1);\n vec4 ixy10 = permute(ixy1 + iw0);\n vec4 ixy11 = permute(ixy1 + iw1);\n\n vec4 gx00 = ixy00 * (1.0 / 7.0);\n vec4 gy00 = floor(gx00) * (1.0 / 7.0);\n vec4 gz00 = floor(gy00) * (1.0 / 6.0);\n gx00 = fract(gx00) - 0.5;\n gy00 = fract(gy00) - 0.5;\n gz00 = fract(gz00) - 0.5;\n vec4 gw00 = vec4(0.75) - abs(gx00) - abs(gy00) - abs(gz00);\n vec4 sw00 = step(gw00, vec4(0.0));\n gx00 -= sw00 * (step(0.0, gx00) - 0.5);\n gy00 -= sw00 * (step(0.0, gy00) - 0.5);\n\n vec4 gx01 = ixy01 * (1.0 / 7.0);\n vec4 gy01 = floor(gx01) * (1.0 / 7.0);\n vec4 gz01 = floor(gy01) * (1.0 / 6.0);\n gx01 = fract(gx01) - 0.5;\n gy01 = fract(gy01) - 0.5;\n gz01 = fract(gz01) - 0.5;\n vec4 gw01 = vec4(0.75) - abs(gx01) - abs(gy01) - abs(gz01);\n vec4 sw01 = step(gw01, vec4(0.0));\n gx01 -= sw01 * (step(0.0, gx01) - 0.5);\n gy01 -= sw01 * (step(0.0, gy01) - 0.5);\n\n vec4 gx10 = ixy10 * (1.0 / 7.0);\n vec4 gy10 = floor(gx10) * (1.0 / 7.0);\n vec4 gz10 = floor(gy10) * (1.0 / 6.0);\n gx10 = fract(gx10) - 0.5;\n gy10 = fract(gy10) - 0.5;\n gz10 = fract(gz10) - 0.5;\n vec4 gw10 = vec4(0.75) - abs(gx10) - abs(gy10) - abs(gz10);\n vec4 sw10 = step(gw10, vec4(0.0));\n gx10 -= sw10 * (step(0.0, gx10) - 0.5);\n gy10 -= sw10 * (step(0.0, gy10) - 0.5);\n\n vec4 gx11 = ixy11 * (1.0 / 7.0);\n vec4 gy11 = floor(gx11) * (1.0 / 7.0);\n vec4 gz11 = floor(gy11) * (1.0 / 6.0);\n gx11 = fract(gx11) - 0.5;\n gy11 = fract(gy11) - 0.5;\n gz11 = fract(gz11) - 0.5;\n vec4 gw11 = vec4(0.75) - abs(gx11) - abs(gy11) - abs(gz11);\n vec4 sw11 = step(gw11, vec4(0.0));\n gx11 -= sw11 * (step(0.0, gx11) - 0.5);\n gy11 -= sw11 * (step(0.0, gy11) - 0.5);\n\n vec4 g0000 = vec4(gx00.x,gy00.x,gz00.x,gw00.x);\n vec4 g1000 = vec4(gx00.y,gy00.y,gz00.y,gw00.y);\n vec4 g0100 = vec4(gx00.z,gy00.z,gz00.z,gw00.z);\n vec4 g1100 = vec4(gx00.w,gy00.w,gz00.w,gw00.w);\n vec4 g0010 = vec4(gx10.x,gy10.x,gz10.x,gw10.x);\n vec4 g1010 = vec4(gx10.y,gy10.y,gz10.y,gw10.y);\n vec4 g0110 = vec4(gx10.z,gy10.z,gz10.z,gw10.z);\n vec4 g1110 = vec4(gx10.w,gy10.w,gz10.w,gw10.w);\n vec4 g0001 = vec4(gx01.x,gy01.x,gz01.x,gw01.x);\n vec4 g1001 = vec4(gx01.y,gy01.y,gz01.y,gw01.y);\n vec4 g0101 = vec4(gx01.z,gy01.z,gz01.z,gw01.z);\n vec4 g1101 = vec4(gx01.w,gy01.w,gz01.w,gw01.w);\n vec4 g0011 = vec4(gx11.x,gy11.x,gz11.x,gw11.x);\n vec4 g1011 = vec4(gx11.y,gy11.y,gz11.y,gw11.y);\n vec4 g0111 = vec4(gx11.z,gy11.z,gz11.z,gw11.z);\n vec4 g1111 = vec4(gx11.w,gy11.w,gz11.w,gw11.w);\n\n vec4 norm00 = taylorInvSqrt(vec4(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100)));\n g0000 *= norm00.x;\n g0100 *= norm00.y;\n g1000 *= norm00.z;\n g1100 *= norm00.w;\n\n vec4 norm01 = taylorInvSqrt(vec4(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101)));\n g0001 *= norm01.x;\n g0101 *= norm01.y;\n g1001 *= norm01.z;\n g1101 *= norm01.w;\n\n vec4 norm10 = taylorInvSqrt(vec4(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110)));\n g0010 *= norm10.x;\n g0110 *= norm10.y;\n g1010 *= norm10.z;\n g1110 *= norm10.w;\n\n vec4 norm11 = taylorInvSqrt(vec4(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111)));\n g0011 *= norm11.x;\n g0111 *= norm11.y;\n g1011 *= norm11.z;\n g1111 *= norm11.w;\n\n float n0000 = dot(g0000, Pf0);\n float n1000 = dot(g1000, vec4(Pf1.x, Pf0.yzw));\n float n0100 = dot(g0100, vec4(Pf0.x, Pf1.y, Pf0.zw));\n float n1100 = dot(g1100, vec4(Pf1.xy, Pf0.zw));\n float n0010 = dot(g0010, vec4(Pf0.xy, Pf1.z, Pf0.w));\n float n1010 = dot(g1010, vec4(Pf1.x, Pf0.y, Pf1.z, Pf0.w));\n float n0110 = dot(g0110, vec4(Pf0.x, Pf1.yz, Pf0.w));\n float n1110 = dot(g1110, vec4(Pf1.xyz, Pf0.w));\n float n0001 = dot(g0001, vec4(Pf0.xyz, Pf1.w));\n float n1001 = dot(g1001, vec4(Pf1.x, Pf0.yz, Pf1.w));\n float n0101 = dot(g0101, vec4(Pf0.x, Pf1.y, Pf0.z, Pf1.w));\n float n1101 = dot(g1101, vec4(Pf1.xy, Pf0.z, Pf1.w));\n float n0011 = dot(g0011, vec4(Pf0.xy, Pf1.zw));\n float n1011 = dot(g1011, vec4(Pf1.x, Pf0.y, Pf1.zw));\n float n0111 = dot(g0111, vec4(Pf0.x, Pf1.yzw));\n float n1111 = dot(g1111, Pf1);\n\n vec4 fade_xyzw = fade(Pf0);\n vec4 n_0w = mix(vec4(n0000, n1000, n0100, n1100), vec4(n0001, n1001, n0101, n1101), fade_xyzw.w);\n vec4 n_1w = mix(vec4(n0010, n1010, n0110, n1110), vec4(n0011, n1011, n0111, n1111), fade_xyzw.w);\n vec4 n_zw = mix(n_0w, n_1w, fade_xyzw.z);\n vec2 n_yzw = mix(n_zw.xy, n_zw.zw, fade_xyzw.y);\n float n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x);\n return 2.2 * n_xyzw;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get\'s the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: rgb2luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_RGB2LUMA\n#define FNC_RGB2LUMA\nfloat rgb2luma(in vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\nfloat rgb2luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_LUMA\n#define FNC_LUMA\nfloat luma(float color) {\n return color;\n}\n\nfloat luma(in vec3 color) {\n return rgb2luma(color);\n}\n\nfloat luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n/*\nauthor: Jamie Owen\ndescription: Photoshop Soft Light blend mode mplementations sourced from this article on https://mouaif.wordpress.com/2009/01/05/photoshop-math-with-glsl-shaders/\nuse: blendSoftLight(<float|vec3> base, <float|vec3> blend [, <float> opacity])\nlicence: TODO\n*/\n\n#ifndef FNC_BLENDSOFTLIGHT\n#define FNC_BLENDSOFTLIGHT\nfloat blendSoftLight(in float base, in float blend) {\n return (blend < .5)? (2. * base * blend + base * base * (1. - 2.*blend)): (sqrt(base) * (2. * blend - 1.) + 2. * base * (1. - blend));\n}\n\nvec3 blendSoftLight(in vec3 base, in vec3 blend) {\n return vec3(blendSoftLight(base.r, blend.r),\n blendSoftLight(base.g, blend.g),\n blendSoftLight(base.b, blend.b));\n}\n\nvec4 blendSoftLight(in vec4 base, in vec4 blend) {\n return vec4(blendSoftLight( base.r, blend.r ),\n blendSoftLight( base.g, blend.g ),\n blendSoftLight( base.b, blend.b ),\n blendSoftLight( base.a, blend.a )\n );\n}\n\nvec3 blendSoftLight(in vec3 base, in vec3 blend, in float opacity) {\n return (blendSoftLight(base, blend) * opacity + base * (1. - opacity));\n}\n#endif\n\n\n/*\nauthor: Matt DesLauriers\ndescription: Natural looking film grain using 3D noise functions (original source: https://github.com/mattdesl/glsl-film-grain). Inspired by [Martins Upitis](http://devlog-martinsh.blogspot.com/2013/05/image-imperfections-and-film-grain-post.html).\nuse: \n - grain(<vec2> texCoord, <vec2> resolution [, <float> t, <float> multiplier])\n - grain(<sampler2D> texture, <vec2> texCoord, <float|vec2> resolution [, <float> t, <float> multiplier])\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Matt DesLauriers\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef GRAIN_TYPE\n#define GRAIN_TYPE vec3\n#endif\n\n#ifndef GRAIN_SAMPLER_FNC\n#define GRAIN_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV).rgb\n#endif\n\n#ifndef FNC_GRAIN\n#define FNC_GRAIN\nfloat grain(vec2 texCoord, vec2 resolution, float t, float multiplier) {\n vec2 mult = texCoord * resolution;\n float offset = snoise(vec3(mult / multiplier, t));\n float n1 = pnoise(vec3(mult, offset), vec3(1. / texCoord * resolution, 1.));\n return n1 / 2. + .5;\n}\n\nfloat grain(vec2 texCoord, vec2 resolution, float t) {\n return grain(texCoord, resolution, t, 2.5);\n}\n\nfloat grain(vec2 texCoord, vec2 resolution) {\n return grain(texCoord, resolution, 0.);\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, vec2 resolution, float t, float multiplier ) {\n GRAIN_TYPE org = GRAIN_SAMPLER_FNC(st);\n\n float g = grain(st, resolution, t, multiplier);\n\n //get the luminance of the background\n float luminance = luma(org);\n \n //reduce the noise based on some \n //threshold of the background luminance\n float response = smoothstep(0.05, 0.5, luminance);\n return mix( blendSoftLight(org, GRAIN_TYPE(g)), \n org, \n response * response);\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, vec2 resolution, float t ) {\n return grain(tex, st, resolution, t, 2.5 );\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, vec2 resolution) {\n return grain(tex, st, resolution, 0.);\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, float resolution, float t, float multiplier ) {\n return grain(tex, st, vec2(resolution), t, multiplier );\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, float resolution, float t ) {\n return grain(tex, st, resolution, t, 2.5 );\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, float resolution) {\n return grain(tex, st, resolution, 0.);\n}\n\n#endif'},8249:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo, Johan Ismael\ndescription: Samples multiple times a texture in the specified direction\nuse: stretch(<sampler2D> tex, <vec2> st, <vec2> direction [, int samples])\noptions:\n STRETCH_SAMPLES: number of samples taken, defaults to 20\n STRETCH_TYPE: return type, defauls to vec4\n STRETCH_SAMPLER_FNC(POS_UV): function used to sample the input texture, defaults to texture2D(tex, POS_UV)\n STRETCH_WEIGHT: shaping equation to multiply the sample weight.\nlicense: |\n Copyright (c) 2021 Patricio Gonzalez Vivo and Johan Ismael\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOF\n*/\n\n#ifndef STRETCH_SAMPLES\n#define STRETCH_SAMPLES 20\n#endif\n\n#ifndef STRETCH_TYPE\n#define STRETCH_TYPE vec4\n#endif\n\n#ifndef STRETCH_SAMPLER_FNC\n#define STRETCH_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_STRETCH\n#define FNC_STRETCH\nSTRETCH_TYPE stretch(in sampler2D tex, in vec2 st, in vec2 direction, const int i_samples) {\n float f_samples = float(i_samples);\n STRETCH_TYPE color = STRETCH_TYPE(0.);\n\n #ifdef PLATFORM_WEBGL\n for (int i = 0; i < 50; i++) {\n if (i == i_samples) break;\n #else\n for (int i = 0; i < i_samples; i++) {\n #endif\n\n float f_sample = float(i);\n STRETCH_TYPE tx = STRETCH_SAMPLER_FNC(st + direction * f_sample);\n #ifdef STRETCH_WEIGHT\n tx *= STRETCH_WEIGHT;\n #endif\n color += tx;\n }\n return color / f_samples;\n}\n\nSTRETCH_TYPE stretch(in sampler2D tex, in vec2 st, in vec2 direction) {\n float f_samples = float(STRETCH_SAMPLES); \n STRETCH_TYPE color = STRETCH_TYPE(0.);\n for (int i = 0; i < STRETCH_SAMPLES; i++) {\n float f_sample = float(i); \n STRETCH_TYPE tx = STRETCH_SAMPLER_FNC(st + direction * f_sample);\n #ifdef STRETCH_WEIGHT\n tx *= STRETCH_WEIGHT; \n #endif\n color += tx;\n }\n return color / f_samples;\n}\n#endif\n'}},e={};function t(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return n[o](r,r.exports,t),r.exports}t.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return t.d(e,{a:e}),e},t.d=(n,e)=>{for(var o in e)t.o(e,o)&&!t.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:e[o]})},t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),t.r=n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var o={};return(()=>{"use strict";t.r(o),t.d(o,{default:()=>l});var n=t(4249),e=t.n(n),i=t(3886),r=t.n(i),s=t(4775),a=t.n(s),c=t(8249),f=t.n(c);const l={barrel:e(),chromaAB:r(),grain:a(),stretch:f()}})(),o})()})); | ||
!(function (n, e) { | ||
'object' == typeof exports && 'object' == typeof module | ||
? (module.exports = e()) | ||
: 'function' == typeof define && define.amd | ||
? define([], e) | ||
: 'object' == typeof exports | ||
? (exports.lygia = e()) | ||
: (n.Lygia = e()) | ||
})(self, function () { | ||
return (() => { | ||
var n = { | ||
4249: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Squared length\nuse: lengthSq(<vec2|float2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LENGTHSQ\n#define FNC_LENGTHSQ\nfloat lengthSq(in vec2 st) {\n return dot(st, st);\n}\n\nfloat lengthSq(in vec3 pos) {\n return dot(pos, pos);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Barrel distortion\nuse: barrel(sampler2D tex, <vec2> st, [, <vec2|float> sdf])\noptions:\n BARREL_DISTANCE: function used to shape the distortion, defaults to radial shape with lengthSq\n BARREL_TYPE: return type, defaults to vec3\n BARREL_SAMPLER_FNC: function used to sample the input texture, defaults to texture2D(tex, POS_UV).rgb\n BARREL_OCT_1: one octave of distortion\n BARREL_OCT_2: two octaves of distortion\n BARREL_OCT_3: three octaves of distortion\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef BARREL_DISTANCE\n#define BARREL_DISTANCE dist\n#endif\n\n#ifndef BARREL_TYPE\n#define BARREL_TYPE vec3\n#endif\n\n#ifndef BARREL_SAMPLER_FNC\n#define BARREL_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV).rgb\n#endif\n\n#ifndef FNC_BARREL\n#define FNC_BARREL\nvec2 barrel(vec2 st, float amt, float dist) {\n return st + (st-.5) * (BARREL_DISTANCE) * amt;\n}\n\nvec2 barrel(vec2 st, float amt) {\n return barrel(st, amt, lengthSq(st-.5));\n}\n\nBARREL_TYPE barrel(in sampler2D tex, in vec2 st, float offset) {\n BARREL_TYPE a1 = BARREL_SAMPLER_FNC( barrel(st, .0, offset));\n BARREL_TYPE a2 = BARREL_SAMPLER_FNC( barrel(st, .2, offset));\n BARREL_TYPE a3 = BARREL_SAMPLER_FNC( barrel(st, .4, offset));\n BARREL_TYPE a4 = BARREL_SAMPLER_FNC( barrel(st, .6, offset));\n#ifdef BARREL_OCT_1\n return (a1+a2+a3+a4)/4.;\n#endif\n BARREL_TYPE a5 = BARREL_SAMPLER_FNC( barrel(st, .8, offset));\n BARREL_TYPE a6 = BARREL_SAMPLER_FNC( barrel(st, 1.0, offset));\n BARREL_TYPE a7 = BARREL_SAMPLER_FNC( barrel(st, 1.2, offset));\n BARREL_TYPE a8 = BARREL_SAMPLER_FNC( barrel(st, 1.4, offset));\n#ifdef BARREL_OCT_2\n return (a1+a2+a3+a4+a5+a6+a7+a8)/8.;\n#endif\n BARREL_TYPE a9 = BARREL_SAMPLER_FNC( barrel(st, 1.6, offset));\n BARREL_TYPE a10 = BARREL_SAMPLER_FNC( barrel(st, 1.8, offset));\n BARREL_TYPE a11 = BARREL_SAMPLER_FNC( barrel(st, 2.0, offset));\n BARREL_TYPE a12 = BARREL_SAMPLER_FNC( barrel(st, 2.2, offset));\n return (a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12)/12.;\n}\n\nBARREL_TYPE barrel(in sampler2D tex, in vec2 st, in vec2 offset) {\n return barrel(tex, st, dot(vec2(.5), offset));\n}\n\nBARREL_TYPE barrel(in sampler2D tex, in vec2 st) {\n return barrel(tex, st, lengthSq(st-.5));\n}\n\n#endif\n' | ||
}, | ||
3886: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Squared length\nuse: lengthSq(<vec2|float2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LENGTHSQ\n#define FNC_LENGTHSQ\nfloat lengthSq(in vec2 st) {\n return dot(st, st);\n}\n\nfloat lengthSq(in vec3 pos) {\n return dot(pos, pos);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo, Johan Ismael\ndescription: Chroma Aberration inspired by https://www.shadertoy.com/view/4sX3z4\nuse: chromaAB(<sampler2D> texture, <vec2> st [, <float|vec2> sdf|offset, <float> pct])\noptions:\n CHROMAAB_TYPE: return type, defauls to vec3\n CHROMAAB_PCT: amount of aberration, defaults to 1.5\n CHROMAAB_SAMPLER_FNC: function used to sample the input texture, defaults to texture2D(tex, POS_UV)\n CHROMAAB_CENTER_BUFFER: scalar to attenuate the sdf passed in \nlicense: |\n Copyright (c) 2021 Patricio Gonzalez Vivo and Johan Ismael\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef CHROMAAB_PCT\n#define CHROMAAB_PCT 1.5\n#endif\n\n#ifndef CHROMAAB_TYPE\n#define CHROMAAB_TYPE vec3\n#endif\n\n#ifndef CHROMAAB_SAMPLER_FNC\n#define CHROMAAB_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_CHROMAAB\n#define FNC_CHROMAAB\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in vec2 direction, in vec3 distortion ) {\n vec2 offset = vec2(0.0);\n CHROMAAB_TYPE c = CHROMAAB_TYPE(1.);\n c.r = CHROMAAB_SAMPLER_FNC(st + direction * distortion.r).r;\n c.g = CHROMAAB_SAMPLER_FNC(st + direction * distortion.g).g;\n c.b = CHROMAAB_SAMPLER_FNC(st + direction * distortion.b).b;\n return c;\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in vec2 offset, in float pct) {\n\n #ifdef CHROMAAB_CENTER_BUFFER\n // modify the distance from the center, so that only the edges are affected\n offset = max(offset - CHROMAAB_CENTER_BUFFER, 0.);\n #endif\n\n // Distort the UVs\n vec2 stR = st * (1.0 + offset * 0.02 * pct),\n stB = st * (1.0 - offset * 0.02 * pct);\n\n // Get the individual channels using the modified UVs\n CHROMAAB_TYPE c = CHROMAAB_TYPE(1.);\n c.r = CHROMAAB_SAMPLER_FNC(stR).r;\n c.g = CHROMAAB_SAMPLER_FNC(st).g;\n c.b = CHROMAAB_SAMPLER_FNC(stB).b;\n return c;\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in float sdf, in float pct) {\n return chromaAB(tex, st, vec2(sdf), pct);\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in float sdf) {\n return chromaAB(tex, st, sdf, CHROMAAB_PCT);\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st, in vec2 offset) {\n return chromaAB(tex, st, offset, CHROMAAB_PCT);\n}\n\nCHROMAAB_TYPE chromaAB(in sampler2D tex, in vec2 st) {\n return chromaAB(tex, st, lengthSq(st - .5), CHROMAAB_PCT);\n}\n\n#endif\n' | ||
}, | ||
4775: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: grad4, used for snoise(vec4 v)\nuse: grad4(<float> j, <vec4> ip)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_GRAD4\n#define FNC_GRAD4\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Simplex Noise https://github.com/ashima/webgl-noise\nuse: snoise(<vec2|vec3|vec4> pos)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n*/\n\n#ifndef FNC_SNOISE\n#define FNC_SNOISE\nfloat snoise(in vec2 v) {\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0\n //i1.y = 1.0 - i1.x;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n // x0 = x0 - 0.0 + 0.0 * C.xx ;\n // x1 = x0 - i1 + 1.0 * C.xx ;\n // x2 = x0 - 1.0 + 2.0 * C.xx ;\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\n\nfloat snoise(in vec3 v) {\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n // Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients: 7x7 points over a square, mapped onto an octahedron.\n // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n //Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}\n\nfloat snoise(in vec4 v) {\n const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\n 0.276393202250021, // 2 * G4\n 0.414589803375032, // 3 * G4\n -0.447213595499958); // -1 + 4 * G4\n\n // First corner\n vec4 i = floor(v + dot(v, vec4(.309016994374947451)) ); // (sqrt(5) - 1)/4\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxxx\n // x1 = x0 - i1 + 1.0 * C.xxxx\n // x2 = x0 - i2 + 2.0 * C.xxxx\n // x3 = x0 - i3 + 3.0 * C.xxxx\n // x4 = x0 - 1.0 + 4.0 * C.xxxx\n vec4 x1 = x0 - i1 + C.xxxx;\n vec4 x2 = x0 - i2 + C.yyyy;\n vec4 x3 = x0 - i3 + C.zzzz;\n vec4 x4 = x0 + C.wwww;\n\n // Permutations\n i = mod289(i);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n}\n\nvec3 snoise3( vec3 x ){\n float s = snoise(vec3( x ));\n float s1 = snoise(vec3( x.y - 19.1 , x.z + 33.4 , x.x + 47.2 ));\n float s2 = snoise(vec3( x.z + 74.2 , x.x - 124.5 , x.y + 99.4 ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\nvec3 snoise3( vec4 x ){\n float s = snoise(vec4( x ));\n float s1 = snoise(vec4( x.y - 19.1 , x.z + 33.4 , x.x + 47.2, x.w ));\n float s2 = snoise(vec4( x.z + 74.2 , x.x - 124.5 , x.y + 99.4, x.w ));\n vec3 c = vec3( s , s1 , s2 );\n return c;\n}\n\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: fade\nuse: fade(<vec2|vec3|vec4> t)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_FADE\n#define FNC_FADE\nfloat fade(in float t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec2 fade(in vec2 t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec3 fade(in vec3 t) {\n return t * t * t * (t * (t * 6. - 15. ) + 10.);\n}\n\nvec4 fade(vec4 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: Classic Perlin Noise with periodic variant https://github.com/ashima/webgl-noise\nuse: pnoise(<vec2|vec3|vec4> pos, <vec2|vec3|vec4> periodic)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Copyright (C) 2011-2016 by Stefan Gustavson (Classic noise and others)\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n*/\n\n#ifndef FNC_PNOISE\n#define FNC_PNOISE\n// Classic Perlin noise, periodic variant\nfloat pnoise(in vec2 P, in vec2 rep) {\n vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0);\n vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0);\n Pi = mod(Pi, rep.xyxy); // To create noise with explicit period\n Pi = mod289(Pi); // To avoid truncation effects in permutation\n vec4 ix = Pi.xzxz;\n vec4 iy = Pi.yyww;\n vec4 fx = Pf.xzxz;\n vec4 fy = Pf.yyww;\n\n vec4 i = permute(permute(ix) + iy);\n\n vec4 gx = fract(i * (1.0 / 41.0)) * 2.0 - 1.0 ;\n vec4 gy = abs(gx) - 0.5 ;\n vec4 tx = floor(gx + 0.5);\n gx = gx - tx;\n\n vec2 g00 = vec2(gx.x,gy.x);\n vec2 g10 = vec2(gx.y,gy.y);\n vec2 g01 = vec2(gx.z,gy.z);\n vec2 g11 = vec2(gx.w,gy.w);\n\n vec4 norm = taylorInvSqrt(vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)));\n g00 *= norm.x;\n g01 *= norm.y;\n g10 *= norm.z;\n g11 *= norm.w;\n\n float n00 = dot(g00, vec2(fx.x, fy.x));\n float n10 = dot(g10, vec2(fx.y, fy.y));\n float n01 = dot(g01, vec2(fx.z, fy.z));\n float n11 = dot(g11, vec2(fx.w, fy.w));\n\n vec2 fade_xy = fade(Pf.xy);\n vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x);\n float n_xy = mix(n_x.x, n_x.y, fade_xy.y);\n return 2.3 * n_xy;\n}\n\nfloat pnoise(in vec3 P, in vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n\nfloat pnoise(in vec4 P, in vec4 rep) {\n vec4 Pi0 = mod(floor(P), rep); // Integer part modulo rep\n vec4 Pi1 = mod(Pi0 + 1.0, rep); // Integer part + 1 mod rep\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec4 Pf0 = fract(P); // Fractional part for interpolation\n vec4 Pf1 = Pf0 - 1.0; // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = vec4(Pi0.zzzz);\n vec4 iz1 = vec4(Pi1.zzzz);\n vec4 iw0 = vec4(Pi0.wwww);\n vec4 iw1 = vec4(Pi1.wwww);\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 ixy00 = permute(ixy0 + iw0);\n vec4 ixy01 = permute(ixy0 + iw1);\n vec4 ixy10 = permute(ixy1 + iw0);\n vec4 ixy11 = permute(ixy1 + iw1);\n\n vec4 gx00 = ixy00 * (1.0 / 7.0);\n vec4 gy00 = floor(gx00) * (1.0 / 7.0);\n vec4 gz00 = floor(gy00) * (1.0 / 6.0);\n gx00 = fract(gx00) - 0.5;\n gy00 = fract(gy00) - 0.5;\n gz00 = fract(gz00) - 0.5;\n vec4 gw00 = vec4(0.75) - abs(gx00) - abs(gy00) - abs(gz00);\n vec4 sw00 = step(gw00, vec4(0.0));\n gx00 -= sw00 * (step(0.0, gx00) - 0.5);\n gy00 -= sw00 * (step(0.0, gy00) - 0.5);\n\n vec4 gx01 = ixy01 * (1.0 / 7.0);\n vec4 gy01 = floor(gx01) * (1.0 / 7.0);\n vec4 gz01 = floor(gy01) * (1.0 / 6.0);\n gx01 = fract(gx01) - 0.5;\n gy01 = fract(gy01) - 0.5;\n gz01 = fract(gz01) - 0.5;\n vec4 gw01 = vec4(0.75) - abs(gx01) - abs(gy01) - abs(gz01);\n vec4 sw01 = step(gw01, vec4(0.0));\n gx01 -= sw01 * (step(0.0, gx01) - 0.5);\n gy01 -= sw01 * (step(0.0, gy01) - 0.5);\n\n vec4 gx10 = ixy10 * (1.0 / 7.0);\n vec4 gy10 = floor(gx10) * (1.0 / 7.0);\n vec4 gz10 = floor(gy10) * (1.0 / 6.0);\n gx10 = fract(gx10) - 0.5;\n gy10 = fract(gy10) - 0.5;\n gz10 = fract(gz10) - 0.5;\n vec4 gw10 = vec4(0.75) - abs(gx10) - abs(gy10) - abs(gz10);\n vec4 sw10 = step(gw10, vec4(0.0));\n gx10 -= sw10 * (step(0.0, gx10) - 0.5);\n gy10 -= sw10 * (step(0.0, gy10) - 0.5);\n\n vec4 gx11 = ixy11 * (1.0 / 7.0);\n vec4 gy11 = floor(gx11) * (1.0 / 7.0);\n vec4 gz11 = floor(gy11) * (1.0 / 6.0);\n gx11 = fract(gx11) - 0.5;\n gy11 = fract(gy11) - 0.5;\n gz11 = fract(gz11) - 0.5;\n vec4 gw11 = vec4(0.75) - abs(gx11) - abs(gy11) - abs(gz11);\n vec4 sw11 = step(gw11, vec4(0.0));\n gx11 -= sw11 * (step(0.0, gx11) - 0.5);\n gy11 -= sw11 * (step(0.0, gy11) - 0.5);\n\n vec4 g0000 = vec4(gx00.x,gy00.x,gz00.x,gw00.x);\n vec4 g1000 = vec4(gx00.y,gy00.y,gz00.y,gw00.y);\n vec4 g0100 = vec4(gx00.z,gy00.z,gz00.z,gw00.z);\n vec4 g1100 = vec4(gx00.w,gy00.w,gz00.w,gw00.w);\n vec4 g0010 = vec4(gx10.x,gy10.x,gz10.x,gw10.x);\n vec4 g1010 = vec4(gx10.y,gy10.y,gz10.y,gw10.y);\n vec4 g0110 = vec4(gx10.z,gy10.z,gz10.z,gw10.z);\n vec4 g1110 = vec4(gx10.w,gy10.w,gz10.w,gw10.w);\n vec4 g0001 = vec4(gx01.x,gy01.x,gz01.x,gw01.x);\n vec4 g1001 = vec4(gx01.y,gy01.y,gz01.y,gw01.y);\n vec4 g0101 = vec4(gx01.z,gy01.z,gz01.z,gw01.z);\n vec4 g1101 = vec4(gx01.w,gy01.w,gz01.w,gw01.w);\n vec4 g0011 = vec4(gx11.x,gy11.x,gz11.x,gw11.x);\n vec4 g1011 = vec4(gx11.y,gy11.y,gz11.y,gw11.y);\n vec4 g0111 = vec4(gx11.z,gy11.z,gz11.z,gw11.z);\n vec4 g1111 = vec4(gx11.w,gy11.w,gz11.w,gw11.w);\n\n vec4 norm00 = taylorInvSqrt(vec4(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100)));\n g0000 *= norm00.x;\n g0100 *= norm00.y;\n g1000 *= norm00.z;\n g1100 *= norm00.w;\n\n vec4 norm01 = taylorInvSqrt(vec4(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101)));\n g0001 *= norm01.x;\n g0101 *= norm01.y;\n g1001 *= norm01.z;\n g1101 *= norm01.w;\n\n vec4 norm10 = taylorInvSqrt(vec4(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110)));\n g0010 *= norm10.x;\n g0110 *= norm10.y;\n g1010 *= norm10.z;\n g1110 *= norm10.w;\n\n vec4 norm11 = taylorInvSqrt(vec4(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111)));\n g0011 *= norm11.x;\n g0111 *= norm11.y;\n g1011 *= norm11.z;\n g1111 *= norm11.w;\n\n float n0000 = dot(g0000, Pf0);\n float n1000 = dot(g1000, vec4(Pf1.x, Pf0.yzw));\n float n0100 = dot(g0100, vec4(Pf0.x, Pf1.y, Pf0.zw));\n float n1100 = dot(g1100, vec4(Pf1.xy, Pf0.zw));\n float n0010 = dot(g0010, vec4(Pf0.xy, Pf1.z, Pf0.w));\n float n1010 = dot(g1010, vec4(Pf1.x, Pf0.y, Pf1.z, Pf0.w));\n float n0110 = dot(g0110, vec4(Pf0.x, Pf1.yz, Pf0.w));\n float n1110 = dot(g1110, vec4(Pf1.xyz, Pf0.w));\n float n0001 = dot(g0001, vec4(Pf0.xyz, Pf1.w));\n float n1001 = dot(g1001, vec4(Pf1.x, Pf0.yz, Pf1.w));\n float n0101 = dot(g0101, vec4(Pf0.x, Pf1.y, Pf0.z, Pf1.w));\n float n1101 = dot(g1101, vec4(Pf1.xy, Pf0.z, Pf1.w));\n float n0011 = dot(g0011, vec4(Pf0.xy, Pf1.zw));\n float n1011 = dot(g1011, vec4(Pf1.x, Pf0.y, Pf1.zw));\n float n0111 = dot(g0111, vec4(Pf0.x, Pf1.yzw));\n float n1111 = dot(g1111, Pf1);\n\n vec4 fade_xyzw = fade(Pf0);\n vec4 n_0w = mix(vec4(n0000, n1000, n0100, n1100), vec4(n0001, n1001, n0101, n1101), fade_xyzw.w);\n vec4 n_1w = mix(vec4(n0010, n1010, n0110, n1110), vec4(n0011, n1011, n0111, n1111), fade_xyzw.w);\n vec4 n_zw = mix(n_0w, n_1w, fade_xyzw.z);\n vec2 n_yzw = mix(n_zw.xy, n_zw.zw, fade_xyzw.y);\n float n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x);\n return 2.2 * n_xyzw;\n}\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get\'s the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: rgb2luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_RGB2LUMA\n#define FNC_RGB2LUMA\nfloat rgb2luma(in vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\nfloat rgb2luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_LUMA\n#define FNC_LUMA\nfloat luma(float color) {\n return color;\n}\n\nfloat luma(in vec3 color) {\n return rgb2luma(color);\n}\n\nfloat luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n/*\nauthor: Jamie Owen\ndescription: Photoshop Soft Light blend mode mplementations sourced from this article on https://mouaif.wordpress.com/2009/01/05/photoshop-math-with-glsl-shaders/\nuse: blendSoftLight(<float|vec3> base, <float|vec3> blend [, <float> opacity])\nlicence: TODO\n*/\n\n#ifndef FNC_BLENDSOFTLIGHT\n#define FNC_BLENDSOFTLIGHT\nfloat blendSoftLight(in float base, in float blend) {\n return (blend < .5)? (2. * base * blend + base * base * (1. - 2.*blend)): (sqrt(base) * (2. * blend - 1.) + 2. * base * (1. - blend));\n}\n\nvec3 blendSoftLight(in vec3 base, in vec3 blend) {\n return vec3(blendSoftLight(base.r, blend.r),\n blendSoftLight(base.g, blend.g),\n blendSoftLight(base.b, blend.b));\n}\n\nvec4 blendSoftLight(in vec4 base, in vec4 blend) {\n return vec4(blendSoftLight( base.r, blend.r ),\n blendSoftLight( base.g, blend.g ),\n blendSoftLight( base.b, blend.b ),\n blendSoftLight( base.a, blend.a )\n );\n}\n\nvec3 blendSoftLight(in vec3 base, in vec3 blend, in float opacity) {\n return (blendSoftLight(base, blend) * opacity + base * (1. - opacity));\n}\n#endif\n\n\n/*\nauthor: Matt DesLauriers\ndescription: Natural looking film grain using 3D noise functions (original source: https://github.com/mattdesl/glsl-film-grain). Inspired by [Martins Upitis](http://devlog-martinsh.blogspot.com/2013/05/image-imperfections-and-film-grain-post.html).\nuse: \n - grain(<vec2> texCoord, <vec2> resolution [, <float> t, <float> multiplier])\n - grain(<sampler2D> texture, <vec2> texCoord, <float|vec2> resolution [, <float> t, <float> multiplier])\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Matt DesLauriers\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef GRAIN_TYPE\n#define GRAIN_TYPE vec3\n#endif\n\n#ifndef GRAIN_SAMPLER_FNC\n#define GRAIN_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV).rgb\n#endif\n\n#ifndef FNC_GRAIN\n#define FNC_GRAIN\nfloat grain(vec2 texCoord, vec2 resolution, float t, float multiplier) {\n vec2 mult = texCoord * resolution;\n float offset = snoise(vec3(mult / multiplier, t));\n float n1 = pnoise(vec3(mult, offset), vec3(1. / texCoord * resolution, 1.));\n return n1 / 2. + .5;\n}\n\nfloat grain(vec2 texCoord, vec2 resolution, float t) {\n return grain(texCoord, resolution, t, 2.5);\n}\n\nfloat grain(vec2 texCoord, vec2 resolution) {\n return grain(texCoord, resolution, 0.);\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, vec2 resolution, float t, float multiplier ) {\n GRAIN_TYPE org = GRAIN_SAMPLER_FNC(st);\n\n float g = grain(st, resolution, t, multiplier);\n\n //get the luminance of the background\n float luminance = luma(org);\n \n //reduce the noise based on some \n //threshold of the background luminance\n float response = smoothstep(0.05, 0.5, luminance);\n return mix( blendSoftLight(org, GRAIN_TYPE(g)), \n org, \n response * response);\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, vec2 resolution, float t ) {\n return grain(tex, st, resolution, t, 2.5 );\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, vec2 resolution) {\n return grain(tex, st, resolution, 0.);\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, float resolution, float t, float multiplier ) {\n return grain(tex, st, vec2(resolution), t, multiplier );\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, float resolution, float t ) {\n return grain(tex, st, resolution, t, 2.5 );\n}\n\nGRAIN_TYPE grain(sampler2D tex, vec2 st, float resolution) {\n return grain(tex, st, resolution, 0.);\n}\n\n#endif' | ||
}, | ||
8249: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo, Johan Ismael\ndescription: Samples multiple times a texture in the specified direction\nuse: stretch(<sampler2D> tex, <vec2> st, <vec2> direction [, int samples])\noptions:\n STRETCH_SAMPLES: number of samples taken, defaults to 20\n STRETCH_TYPE: return type, defauls to vec4\n STRETCH_SAMPLER_FNC(POS_UV): function used to sample the input texture, defaults to texture2D(tex, POS_UV)\n STRETCH_WEIGHT: shaping equation to multiply the sample weight.\nlicense: |\n Copyright (c) 2021 Patricio Gonzalez Vivo and Johan Ismael\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOF\n*/\n\n#ifndef STRETCH_SAMPLES\n#define STRETCH_SAMPLES 20\n#endif\n\n#ifndef STRETCH_TYPE\n#define STRETCH_TYPE vec4\n#endif\n\n#ifndef STRETCH_SAMPLER_FNC\n#define STRETCH_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_STRETCH\n#define FNC_STRETCH\nSTRETCH_TYPE stretch(in sampler2D tex, in vec2 st, in vec2 direction, const int i_samples) {\n float f_samples = float(i_samples);\n STRETCH_TYPE color = STRETCH_TYPE(0.);\n\n #ifdef PLATFORM_WEBGL\n for (int i = 0; i < 50; i++) {\n if (i == i_samples) break;\n #else\n for (int i = 0; i < i_samples; i++) {\n #endif\n\n float f_sample = float(i);\n STRETCH_TYPE tx = STRETCH_SAMPLER_FNC(st + direction * f_sample);\n #ifdef STRETCH_WEIGHT\n tx *= STRETCH_WEIGHT;\n #endif\n color += tx;\n }\n return color / f_samples;\n}\n\nSTRETCH_TYPE stretch(in sampler2D tex, in vec2 st, in vec2 direction) {\n float f_samples = float(STRETCH_SAMPLES); \n STRETCH_TYPE color = STRETCH_TYPE(0.);\n for (int i = 0; i < STRETCH_SAMPLES; i++) {\n float f_sample = float(i); \n STRETCH_TYPE tx = STRETCH_SAMPLER_FNC(st + direction * f_sample);\n #ifdef STRETCH_WEIGHT\n tx *= STRETCH_WEIGHT; \n #endif\n color += tx;\n }\n return color / f_samples;\n}\n#endif\n' | ||
}, | ||
}, | ||
e = {} | ||
function t(o) { | ||
var i = e[o] | ||
if (void 0 !== i) return i.exports | ||
var r = (e[o] = { exports: {} }) | ||
return n[o](r, r.exports, t), r.exports | ||
} | ||
;(t.d = (n, e) => { | ||
for (var o in e) | ||
t.o(e, o) && | ||
!t.o(n, o) && | ||
Object.defineProperty(n, o, { enumerable: !0, get: e[o] }) | ||
}), | ||
(t.o = (n, e) => Object.prototype.hasOwnProperty.call(n, e)), | ||
(t.r = (n) => { | ||
'undefined' != typeof Symbol && | ||
Symbol.toStringTag && | ||
Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' }), | ||
Object.defineProperty(n, '__esModule', { value: !0 }) | ||
}) | ||
var o = {} | ||
return ( | ||
(() => { | ||
'use strict' | ||
t.r(o), t.d(o, { default: () => n }) | ||
const n = { | ||
barrel: t(4249), | ||
chromaAB: t(3886), | ||
grain: t(4775), | ||
stretch: t(8249), | ||
} | ||
})(), | ||
o | ||
) | ||
})() | ||
}) |
@@ -1,1 +0,84 @@ | ||
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.lygia=e():n.Lygia=e()}(self,(function(){return(()=>{var n={1995:n=>{n.exports='/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get\'s the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: rgb2luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_RGB2LUMA\n#define FNC_RGB2LUMA\nfloat rgb2luma(in vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\nfloat rgb2luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: TODO\nuse: bilateralBlur(<sampler2D> texture, <vec2> st, <vec2> duv)\noptions: TODO\nlicense: TODO\n*/\n\n#ifndef BILATERALBLUR_AMOUNT\n#define BILATERALBLUR_AMOUNT bilateralBlur13\n#endif\n\n#ifndef BILATERALBLUR_TYPE\n#define BILATERALBLUR_TYPE vec4\n#endif\n\n#ifndef BILATERALBLUR_SAMPLER_FNC\n#define BILATERALBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef BILATERALBLUR_LUMA\n#define BILATERALBLUR_LUMA(RGB) rgb2luma(RGB.rgb)\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get\'s the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: rgb2luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_RGB2LUMA\n#define FNC_RGB2LUMA\nfloat rgb2luma(in vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\nfloat rgb2luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: two dimensional bilateral Blur, to do it in one single pass\nuse: bilateralBlur2D(<sampler2D> texture, <vec2> st, <vec2> offset, <int> kernelSize)\noptions:\n BILATERALBLUR2D_TYPE: default is vec3\n BILATERALBLUR2D_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\n BILATERALBLUR2D_LUMA(RGB): default rgb2luma\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BILATERALBLUR2D_TYPE\n#define BILATERALBLUR2D_TYPE vec4\n#endif\n\n#ifndef BILATERALBLUR2D_SAMPLER_FNC\n#define BILATERALBLUR2D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef BILATERALBLUR2D_LUMA\n#define BILATERALBLUR2D_LUMA(RGB) rgb2luma(RGB.rgb)\n#endif\n\n#ifndef FNC_BILATERALBLUR2D\n#define FNC_BILATERALBLUR2D\nBILATERALBLUR2D_TYPE bilateralBlur2D(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n BILATERALBLUR2D_TYPE accumColor = BILATERALBLUR2D_TYPE(0.);\n #ifndef BILATERALBLUR2D_KERNELSIZE\n #define BILATERALBLUR2D_KERNELSIZE kernelSize\n #endif\n float accumWeight = 0.;\n const float k = .15915494; // 1. / (2.*PI)\n const float k2 = k * k;\n float kernelSize2 = float(BILATERALBLUR2D_KERNELSIZE) * float(BILATERALBLUR2D_KERNELSIZE);\n BILATERALBLUR2D_TYPE tex0 = BILATERALBLUR2D_SAMPLER_FNC(st);\n float lum0 = BILATERALBLUR2D_LUMA(tex0);\n\n for (int j = 0; j < BILATERALBLUR2D_KERNELSIZE; j++) {\n float dy = -.5 * (float(BILATERALBLUR2D_KERNELSIZE) - 1.0) + float(j);\n for (int i = 0; i < BILATERALBLUR2D_KERNELSIZE; i++) {\n float dx = -.5 * (float(BILATERALBLUR2D_KERNELSIZE) - 1.0) + float(i);\n BILATERALBLUR2D_TYPE tex = BILATERALBLUR2D_SAMPLER_FNC(st + vec2(dx, dy) * offset);\n float lum = BILATERALBLUR2D_LUMA(tex);\n float dl = 255. * (lum - lum0);\n float weight = (k2 / kernelSize2) * exp(-(dx * dx + dy * dy + dl * dl) / (2. * kernelSize2));\n accumColor += weight * tex;\n accumWeight += weight;\n }\n }\n return accumColor / accumWeight;\n}\n#endif\n\n\n#ifndef FNC_BILATERALFILTER\n#define FNC_BILATERALFILTER\nBILATERALBLUR_TYPE bilateralBlur(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n return bilateralBlur2D(tex, st, offset, kernelSize);\n}\n\nBILATERALBLUR_TYPE bilateralBlur13(in sampler2D tex, in vec2 st, in vec2 offset) {\n return bilateralBlur(tex, st, offset, 7);\n}\n\nBILATERALBLUR_TYPE bilateralBlur9(in sampler2D tex, in vec2 st, in vec2 offset) {\n return bilateralBlur(tex, st, offset, 5);\n}\n\nBILATERALBLUR_TYPE bilateralBlur5(in sampler2D tex, in vec2 st, in vec2 offset) {\n return bilateralBlur(tex, st, offset, 3);\n}\n\nBILATERALBLUR_TYPE bilateralBlur(in sampler2D tex, in vec2 st, in vec2 offset) {\n return BILATERALBLUR_AMOUNT(tex, st, offset);\n}\n#endif\n'},4207:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: given a texture return a simple box blured pixel\nuse: boxBlur(<sampler2D> texture, <vec2> st, <vec2> pixel_offset)\noptions:\n BOXBLUR_2D: default to 1D\n BOXBLUR_ITERATIONS: default 3\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BOXBLUR_ITERATIONS\n#define BOXBLUR_ITERATIONS 3\n#endif\n\n#ifndef BOXBLUR_TYPE\n#define BOXBLUR_TYPE vec4\n#endif\n\n#ifndef BOXBLUR_SAMPLER_FNC\n#define BOXBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: simple one dimentional box blur, to be applied in two passes\nuse: boxBlur1D(<sampler2D> texture, <vec2> st, <vec2> pixel_offset, <int> kernelSize)\noptions:\n BOXBLUR1D_TYPE: default is vec4\n BOXBLUR1D_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\n BOXBLUR1D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n#ifndef BOXBLUR1D_TYPE\n#define BOXBLUR1D_TYPE vec4\n#endif\n\n#ifndef BOXBLUR1D_SAMPLER_FNC\n#define BOXBLUR1D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_BOXBLUR1D\n#define FNC_BOXBLUR1D\nBOXBLUR1D_TYPE boxBlur1D(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n BOXBLUR1D_TYPE color = BOXBLUR1D_TYPE(0.);\n #ifndef BOXBLUR1D_KERNELSIZE\n #define BOXBLUR1D_KERNELSIZE kernelSize\n #endif\n\n float f_kernelSize = float(BOXBLUR1D_KERNELSIZE);\n float weight = 1. / f_kernelSize;\n\n for (int i = 0; i < BOXBLUR1D_KERNELSIZE; i++) {\n float x = -.5 * (f_kernelSize - 1.) + float(i);\n color += BOXBLUR1D_SAMPLER_FNC(st + offset * x ) * weight;\n }\n return color;\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: simple two dimentional box blur, so can be apply in a single pass\nuse: boxBlur2D(<sampler2D> texture, <vec2> st, <vec2> pixel_offset, <int> kernelSize)\noptions:\n BOXBLUR2D_TYPE: Default `vec4`\n BOXBLUR2D_SAMPLER_FNC(POS_UV): default is `texture2D(tex, POS_UV)`\n BOXBLUR2D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BOXBLUR2D_TYPE\n#define BOXBLUR2D_TYPE vec4\n#endif\n\n#ifndef BOXBLUR2D_SAMPLER_FNC\n#define BOXBLUR2D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_BOXBLUR2D\n#define FNC_BOXBLUR2D\nBOXBLUR2D_TYPE boxBlur2D(in sampler2D tex, in vec2 st, in vec2 pixel, const int kernelSize) {\n BOXBLUR2D_TYPE color = BOXBLUR2D_TYPE(0.);\n #ifndef BOXBLUR2D_KERNELSIZE\n #define BOXBLUR2D_KERNELSIZE kernelSize\n #endif\n\n float accumWeight = 0.;\n float f_kernelSize = float(BOXBLUR2D_KERNELSIZE);\n float kernelSize2 = f_kernelSize * f_kernelSize;\n float weight = 1. / kernelSize2;\n\n for (int j = 0; j < BOXBLUR2D_KERNELSIZE; j++) {\n float y = -.5 * (f_kernelSize - 1.) + float(j);\n for (int i = 0; i < BOXBLUR2D_KERNELSIZE; i++) {\n float x = -.5 * (f_kernelSize - 1.) + float(i);\n color += BOXBLUR2D_SAMPLER_FNC(st + vec2(x, y) * pixel) * weight;\n }\n }\n return color;\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: simple two dimentional box blur, so can be apply in a single pass\nuse: boxBlur1D_fast9(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n BOXBLUR2D_FAST9_TYPE: Default is `vec4`\n BOXBLUR2D_FAST9_SAMPLER_FNC(POS_UV): Default is `texture2D(tex, POS_UV)`\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BOXBLUR2D_FAST9_TYPE\n#define BOXBLUR2D_FAST9_TYPE vec4\n#endif\n\n#ifndef BOXBLUR2D_FAST9_SAMPLER_FNC\n#define BOXBLUR2D_FAST9_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_BOXBLUR2D_FAST9\n#define FNC_BOXBLUR2D_FAST9\nBOXBLUR2D_FAST9_TYPE boxBlur2D_fast9(in sampler2D tex, in vec2 st, in vec2 offset) {\n BOXBLUR2D_FAST9_TYPE color = BOXBLUR2D_FAST9_SAMPLER_FNC(st); // center\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(-offset.x, offset.y)); // tleft\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(-offset.x, 0.)); // left\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(-offset.x, -offset.y)); // bleft\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(0., offset.y)); // top\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(0., -offset.y)); // bottom\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + offset); // tright\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(offset.x, 0.)); // right\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(offset.x, -offset.y)); // bright\n return color * 0.1111111111; // 1./9.\n}\n#endif\n\n\n#ifndef FNC_BOXBLUR\n#define FNC_BOXBLUR\nBOXBLUR_TYPE boxBlur13(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, 7);\n#else\n return boxBlur1D(tex, st, offset, 7);\n#endif\n}\n\nBOXBLUR_TYPE boxBlur9(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef BOXBLUR_2D\n return boxBlur2D_fast9(tex, st, offset);\n#else\n return boxBlur1D(tex, st, offset, 5);\n#endif\n}\n\nBOXBLUR_TYPE boxBlur5(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, 3);\n#else\n return boxBlur1D(tex, st, offset, 3);\n#endif\n}\n\nvec4 boxBlur(in sampler2D tex, in vec2 st, vec2 offset, const int kernelSize) {\n#ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, kernelSize);\n#else\n return boxBlur1D(tex, st, offset, kernelSize);\n#endif\n}\n\nvec4 boxBlur(in sampler2D tex, in vec2 st, vec2 offset) {\n #ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, BOXBLUR_ITERATIONS);\n #else\n return boxBlur1D(tex, st, offset, BOXBLUR_ITERATIONS);\n #endif\n}\n#endif\n'},548:n=>{n.exports='/*\nauthor: [Matt DesLauriers, Patricio Gonzalez Vivo]\ndescription: adapted versions from 5, 9 and 13 gaussian fast blur from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur(<sampler2D> texture, <vec2> st, <vec2> pixel_direction [, const int kernelSize])\noptions:\n GAUSSIANBLUR_AMOUNT: gaussianBlur5 gaussianBlur9 gaussianBlur13 \n GAUSSIANBLUR_2D: default to 1D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n#ifndef GAUSSIANBLUR_AMOUNT\n#define GAUSSIANBLUR_AMOUNT gaussianBlur13\n#endif\n\n#ifndef GAUSSIANBLUR_TYPE\n#define GAUSSIANBLUR_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR_SAMPLER_FNC\n#define GAUSSIANBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: two dimension Gaussian Blur to be applied in only one passes\nuse: gaussianBlur2D(<sampler2D> texture, <vec2> st, <vec2> pixel_direction , const int kernelSize)\noptions:\n GAUSSIANBLUR2D_TYPE: Default `vec4`\n GAUSSIANBLUR2D_SAMPLER_FNC(POS_UV): Default `texture2D(tex, POS_UV)`\n GAUSSIANBLUR2D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n#ifndef GAUSSIANBLUR2D_TYPE\n#define GAUSSIANBLUR2D_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR2D_SAMPLER_FNC\n#define GAUSSIANBLUR2D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR2D\n#define FNC_GAUSSIANBLUR2D\nGAUSSIANBLUR2D_TYPE gaussianBlur2D(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n GAUSSIANBLUR2D_TYPE accumColor = GAUSSIANBLUR2D_TYPE(0.);\n #ifndef GAUSSIANBLUR2D_KERNELSIZE\n #define GAUSSIANBLUR2D_KERNELSIZE kernelSize\n #endif\n\n float accumWeight = 0.;\n const float k = .15915494; // 1 / (2*PI)\n float kernelSize2 = float(GAUSSIANBLUR2D_KERNELSIZE) * float(GAUSSIANBLUR2D_KERNELSIZE);\n\n for (int j = 0; j < GAUSSIANBLUR2D_KERNELSIZE; j++) {\n float y = -.5 * (float(GAUSSIANBLUR2D_KERNELSIZE) - 1.) + float(j);\n for (int i = 0; i < GAUSSIANBLUR2D_KERNELSIZE; i++) {\n float x = -.5 * (float(GAUSSIANBLUR2D_KERNELSIZE) - 1.) + float(i);\n float weight = (k / float(GAUSSIANBLUR2D_KERNELSIZE)) * exp(-(x * x + y * y) / (2. * kernelSize2));\n GAUSSIANBLUR2D_TYPE tex = GAUSSIANBLUR2D_SAMPLER_FNC(st + vec2(x, y) * offset);\n accumColor += weight * tex;\n accumWeight += weight;\n }\n }\n return accumColor / accumWeight;\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: one dimension Gaussian Blur to be applied in two passes\nuse: gaussianBlur1D(<sampler2D> texture, <vec2> st, <vec2> pixel_direction , const int kernelSize)\noptions:\n GAUSSIANBLUR1D_TYPE:\n GAUSSIANBLUR1D_SAMPLER_FNC(POS_UV):\n GAUSSIANBLUR1D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef GAUSSIANBLUR1D_TYPE\n#define GAUSSIANBLUR1D_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_SAMPLER_FNC\n#define GAUSSIANBLUR1D_SAMPLER_FNC(POS_UV)texture2D(tex,POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D\n#define FNC_GAUSSIANBLUR1D\n\n#ifdef GAUSSIANBLUR1D_DYNAMIC\n\nGAUSSIANBLUR1D_TYPE gaussianBlur1D(in sampler2D tex,in vec2 st,in vec2 offset,const int kernelSize){\n GAUSSIANBLUR1D_TYPE accumColor = GAUSSIANBLUR1D_TYPE(0.0);\n \n float accumWeight = 0.0;\n const float k = 0.39894228;// 1 / sqrt(2*PI)\n float kernelSize2 = float(kernelSize)*float(kernelSize);\n for(int i = 0; i < 16; i++){\n if( i >= kernelSize)\n break;\n float x = -0.5 * (float(kernelSize) - 1.0)+float(i);\n float weight = (k/float(kernelSize)) * exp(-(x*x)/(2.0*kernelSize2));\n GAUSSIANBLUR1D_TYPE tex = GAUSSIANBLUR1D_SAMPLER_FNC(st + x * offset);\n accumColor += weight * tex;\n accumWeight += weight;\n }\n return accumColor/accumWeight;\n}\n\n#else\nGAUSSIANBLUR1D_TYPE gaussianBlur1D(in sampler2D tex,in vec2 st,in vec2 offset,const int kernelSize){\n GAUSSIANBLUR1D_TYPE accumColor=GAUSSIANBLUR1D_TYPE(0.);\n #ifndef GAUSSIANBLUR1D_KERNELSIZE\n #define GAUSSIANBLUR1D_KERNELSIZE kernelSize\n #endif\n \n float accumWeight = 0.0;\n const float k = 0.39894228;// 1 / sqrt(2*PI)\n float kernelSize2=float(GAUSSIANBLUR1D_KERNELSIZE)*float(GAUSSIANBLUR1D_KERNELSIZE);\n for(int i = 0; i < GAUSSIANBLUR1D_KERNELSIZE; i++){\n float x = -0.5 * (float(GAUSSIANBLUR1D_KERNELSIZE) -1.0) + float(i);\n float weight = (k/float(GAUSSIANBLUR1D_KERNELSIZE)) * exp(-(x*x)/(2.0*kernelSize2));\n GAUSSIANBLUR1D_TYPE tex = GAUSSIANBLUR1D_SAMPLER_FNC(st + x * offset);\n accumColor += weight * tex;\n accumWeight += weight;\n }\n return accumColor/accumWeight;\n}\n#endif\n\n#endif\n\n/*\nfunction: gaussianBlur1D_fast13\nauthor: Matt DesLauriers\ndescription: adapted versions of gaussian fast blur 13 from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur1D_fast13(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n GAUSSIANBLUR1D_FAST13_TYPE\n GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(POS_UV)\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Jam3\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n#ifndef GAUSSIANBLUR1D_FAST13_TYPE\n#define GAUSSIANBLUR1D_FAST13_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_FAST13_SAMPLER_FNC\n#define GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D_FAST13\n#define FNC_GAUSSIANBLUR1D_FAST13\nGAUSSIANBLUR1D_FAST13_TYPE gaussianBlur1D_fast13(in sampler2D tex, in vec2 st, in vec2 offset) {\n GAUSSIANBLUR1D_FAST13_TYPE color = GAUSSIANBLUR1D_FAST13_TYPE(0.);\n vec2 off1 = vec2(1.411764705882353) * offset;\n vec2 off2 = vec2(3.2941176470588234) * offset;\n vec2 off3 = vec2(5.176470588235294) * offset;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st) * .1964825501511404;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st + (off1)) * .2969069646728344;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st - (off1)) * .2969069646728344;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st + (off2)) * .09447039785044732;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st - (off2)) * .09447039785044732;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st + (off3)) * .010381362401148057;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st - (off3)) * .010381362401148057;\n return color;\n}\n#endif\n\n/*\nauthor: Matt DesLauriers\ndescription: adapted versions of gaussian fast blur 13 from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur1D_fast9(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n GAUSSIANBLUR1D_FAST9_TYPE\n GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(POS_UV)\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Jam3\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n#ifndef GAUSSIANBLUR1D_FAST9_TYPE\n#define GAUSSIANBLUR1D_FAST9_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_FAST9_SAMPLER_FNC\n#define GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D_FAST9\n#define FNC_GAUSSIANBLUR1D_FAST9\nGAUSSIANBLUR1D_FAST9_TYPE gaussianBlur1D_fast9(in sampler2D tex, in vec2 st, in vec2 offset) {\n GAUSSIANBLUR1D_FAST9_TYPE color = GAUSSIANBLUR1D_FAST9_TYPE(0.);\n vec2 off1 = vec2(1.3846153846) * offset;\n vec2 off2 = vec2(3.2307692308) * offset;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st) * .2270270270;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st + (off1)) * .3162162162;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st - (off1)) * .3162162162;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st + (off2)) * .0702702703;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st - (off2)) * .0702702703;\n return color;\n}\n#endif\n\n/*\nauthor: Matt DesLauriers\ndescription: adapted versions of gaussian fast blur 13 from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur1D_fast5(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n GAUSSIANBLUR1D_FAST5_TYPE\n GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(POS_UV)\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Jam3\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef GAUSSIANBLUR1D_FAST5_TYPE\n#define GAUSSIANBLUR1D_FAST5_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_FAST5_SAMPLER_FNC\n#define GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D_FAST5\n#define FNC_GAUSSIANBLUR1D_FAST5\nGAUSSIANBLUR1D_FAST5_TYPE gaussianBlur1D_fast5(in sampler2D tex, in vec2 st, in vec2 offset) {\n GAUSSIANBLUR1D_FAST5_TYPE color = GAUSSIANBLUR1D_FAST5_TYPE(0.);\n vec2 off1 = vec2(1.3333333333333333) * offset;\n color += GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(st) * .29411764705882354;\n color += GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(st + (off1)) * .35294117647058826;\n color += GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(st - (off1)) * .35294117647058826;\n return color;\n}\n#endif\n\n\n#ifndef FNC_GAUSSIANBLUR\n#define FNC_GAUSSIANBLUR\nGAUSSIANBLUR_TYPE gaussianBlur13(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, 7);\n#else\n return gaussianBlur1D_fast13(tex, st, offset);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur9(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, 5);\n#else\n return gaussianBlur1D_fast9(tex, st, offset);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur5(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, 3);\n#else\n return gaussianBlur1D_fast5(tex, st, offset);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, kernelSize);\n#else\n return gaussianBlur1D(tex, st, offset, kernelSize);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur(in sampler2D tex, in vec2 st, in vec2 offset) {\n return GAUSSIANBLUR_AMOUNT(tex, st, offset);\n}\n#endif\n'},5551:n=>{n.exports='/*\nauthor: Brad Larson\ndescription: Kuwahara image abstraction, drawn from the work of Kyprianidis, et. al. in their publication "Anisotropic Kuwahara Filtering on the GPU" within the GPU Pro collection. This produces an oil-painting-like image, but it is extremely computationally expensive, so it can take seconds to render a frame on an iPad 2. This might be best used for still images.\nuse: kuwahara(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n KUWAHARA_TYPE: defaults to vec3\n KUWAHARA_SAMPLER_FNC(POS_UV): defaults to texture2D(tex, POS_UV).rgb\n KUWAHARA_RADIUS radius\nlicence:\n Copyright (c) 2012, Brad Larson, Ben Cochran, Hugues Lismonde, Keitaroh Kobayashi, Alaric Cole, Matthew Clark, Jacob Gundersen, Chris Williams.\n All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef KUWAHARA_TYPE\n#define KUWAHARA_TYPE vec3\n#endif\n\n#ifndef KUWAHARA_SAMPLER_FNC\n#define KUWAHARA_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV).rgb\n#endif\n\n#ifndef KUWAHARA_RADIUS\n#define KUWAHARA_RADIUS radius\n#endif\n\n#ifndef FNC_KUWAHARA\n#define FNC_KUWAHARA\n\n#ifdef TARGET_MOBILE\nKUWAHARA_TYPE kuwahara(in sampler2D tex, in vec2 st, in vec2 pixel, in int radius) {\n float n = float((KUWAHARA_RADIUS + 1) * (KUWAHARA_RADIUS + 1));\n int i; int j;\n KUWAHARA_TYPE m0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE s0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE rta = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE c;\n\n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m0 += c;\n s0 += c * c;\n }\n }\n\n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m1 += c;\n s1 += c * c;\n }\n }\n\n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m2 += c;\n s2 += c * c;\n }\n }\n\n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m3 += c;\n s3 += c * c;\n }\n }\n\n float min_sigma2 = 1e+2;\n m0 /= n;\n s0 = abs(s0 / n - m0 * m0);\n\n float sigma2 = s0.r + s0.g + s0.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m0;\n }\n\n m1 /= n;\n s1 = abs(s1 / n - m1 * m1);\n\n sigma2 = s1.r + s1.g + s1.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m1;\n }\n\n m2 /= n;\n s2 = abs(s2 / n - m2 * m2);\n\n sigma2 = s2.r + s2.g + s2.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m2;\n }\n\n m3 /= n;\n s3 = abs(s3 / n - m3 * m3);\n\n sigma2 = s3.r + s3.g + s3.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m3;\n }\n\n return rta;\n}\n#else\n\nKUWAHARA_TYPE kuwahara(in sampler2D tex, in vec2 st, in vec2 pixel, in int radius) {\n\n float n = float((KUWAHARA_RADIUS + 1) * (KUWAHARA_RADIUS + 1));\n int i; int j;\n KUWAHARA_TYPE m0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE s0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE rta = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE c;\n \n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m0 += c;\n s0 += c * c;\n }\n }\n \n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m1 += c;\n s1 += c * c;\n }\n }\n \n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m2 += c;\n s2 += c * c;\n }\n }\n \n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m3 += c;\n s3 += c * c;\n }\n }\n \n \n float min_sigma2 = 1e+2;\n m0 /= n;\n s0 = abs(s0 / n - m0 * m0);\n \n float sigma2 = s0.r + s0.g + s0.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m0;\n }\n \n m1 /= n;\n s1 = abs(s1 / n - m1 * m1);\n \n sigma2 = s1.r + s1.g + s1.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m1;\n }\n \n m2 /= n;\n s2 = abs(s2 / n - m2 * m2);\n \n sigma2 = s2.r + s2.g + s2.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m2;\n }\n \n m3 /= n;\n s3 = abs(s3 / n - m3 * m3);\n \n sigma2 = s3.r + s3.g + s3.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m3;\n }\n\n return rta;\n}\n\n#endif\n\n#endif'},7030:n=>{n.exports='/*\nauthor: Brad Larson\ndescription: adapted version of mean average sampling on four coorners of a sampled point from https://github.com/BradLarson/GPUImage2\nuse: mean(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEAN_TYPE: defaults to vec4\n AVERAGE_SAMPLER_FNC(POS_UV): defaults to texture2D(tex,POS_UV)\nlicence:\n Copyright (c) 2015, Brad Larson. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef MEAN_TYPE\n#define MEAN_TYPE vec4\n#endif\n\n#ifndef MEAN_AMOUNT\n#define MEAN_AMOUNT mean4\n#endif\n\n#ifndef MEAN_SAMPLER_FNC\n#define MEAN_SAMPLER_FNC(POS_UV) texture2D(tex,POS_UV)\n#endif\n\n#ifndef FNC_AVERAGE\n#define FNC_AVERAGE\nMEAN_TYPE mean4(in sampler2D tex, in vec2 st, in vec2 pixel) {\n MEAN_TYPE topLeft = MEAN_SAMPLER_FNC(st - pixel);\n MEAN_TYPE bottomLeft = MEAN_SAMPLER_FNC(st + vec2(-pixel.x, pixel.y));\n MEAN_TYPE topRight = MEAN_SAMPLER_FNC(st + vec2(pixel.x, -pixel.y));\n MEAN_TYPE bottomRight = MEAN_SAMPLER_FNC(st + pixel);\n return 0.25 * (topLeft + topRight + bottomLeft + bottomRight);\n}\n\nMEAN_TYPE mean(in sampler2D tex, in vec2 st, in vec2 pixel) {\n return MEAN_AMOUNT(tex, st, pixel);\n}\n#endif\n'},6815:n=>{n.exports='/*\nauthor:[Morgan McGuire, Kyle Whitson]\ndescription: 3x3 and 5x5 median filter, adapted from "A Fast, Small-Radius GPU Median Filter" by Morgan McGuire in ShaderX6 https://casual-effects.com/research/McGuire2008Median/index.html\nuse: median(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEDIAN_AMOUNT: median3 (3x3) median5 (5x5)\n MEDIAN_TYPE: default vec4\n MEDIAN_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\nlicense:\n Copyright (c) Morgan McGuire and Williams College, 2006. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef MEDIAN_AMOUNT\n#define MEDIAN_AMOUNT median5\n#endif\n\n#ifndef MEDIAN_TYPE\n#define MEDIAN_TYPE vec4\n#endif\n\n#ifndef MEDIAN_SAMPLER_FNC\n#define MEDIAN_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n/*\nauthor: [Morgan McGuire, Kyle Whitson]\ndescription: |\n 3x3 median filter, adapted from "A Fast, Small-Radius GPU Median Filter" \n by Morgan McGuire in ShaderX6 https://casual-effects.com/research/McGuire2008Median/index.html\nuse: median2D_fast3(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEDIAN2D_FAST3_TYPE: default vec4\n MEDIAN2D_FAST3_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\nlicense:\n Copyright (c) Morgan McGuire and Williams College, 2006. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n*/\n\n#ifndef MEDIAN2D_FAST3_TYPE\n#define MEDIAN2D_FAST3_TYPE vec4\n#endif\n\n#ifndef MEDIAN2D_FAST3_SAMPLER_FNC\n#define MEDIAN2D_FAST3_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef MEDIAN_S2\n#define MEDIAN_S2(a, b) temp = a; a = min(a, b); b = max(temp, b);\n#endif\n\n#ifndef MEDIAN_2\n#define MEDIAN_2(a, b) MEDIAN_S2(v[a], v[b]);\n#endif\n\n#ifndef FNC_MEDIAN2D_FAST3\n#define FNC_MEDIAN2D_FAST3\n#define MEDIAN_MN3(a, b, c) MEDIAN_2(a, b); MEDIAN_2(a, c);\n#define MEDIAN_MX3(a, b, c) MEDIAN_2(b, c); MEDIAN_2(a, c);\n#define MEDIAN_MNMX3(a, b, c) MEDIAN_MX3(a, b, c); MEDIAN_2(a, b); // 3 exchanges\n#define MEDIAN_MNMX4(a, b, c, d) MEDIAN_2(a, b); MEDIAN_2(c, d); MEDIAN_2(a, c); MEDIAN_2(b, d); // 4 exchanges\n#define MEDIAN_MNMX5(a, b, c, d, e) MEDIAN_2(a, b); MEDIAN_2(c, d); MEDIAN_MN3(a, c, e); MEDIAN_MX3(b, d, e); // 6 exchanges\n#define MEDIAN_MNMX6(a, b, c, d, e, f) MEDIAN_2(a, d); MEDIAN_2(b, e); MEDIAN_2(c, f); MEDIAN_MN3(a, b, c); MEDIAN_MX3(d, e, f); // 7 exchanges\nMEDIAN2D_FAST3_TYPE median2D_fast3(in sampler2D tex, in vec2 st, in vec2 radius) {\n MEDIAN2D_FAST3_TYPE v[9];\n for (int dX = -1; dX <= 1; ++dX) {\n for (int dY = -1; dY <= 1; ++dY) {\n vec2 offset = vec2(float(dX), float(dY));\n // If a pixel in the window is located at (x+dX, y+dY), put it at index (dX + R)(2R + 1) + (dY + R) of the\n // pixel array. This will fill the pixel array, with the top left pixel of the window at pixel[0] and the\n // bottom right pixel of the window at pixel[N-1].\n v[(dX + 1) * 3 + (dY + 1)] = MEDIAN2D_FAST3_SAMPLER_FNC(st + offset * radius);\n }\n }\n MEDIAN2D_FAST3_TYPE temp = MEDIAN2D_FAST3_TYPE(0.);\n MEDIAN_MNMX6(0, 1, 2, 3, 4, 5);\n MEDIAN_MNMX5(1, 2, 3, 4, 6);\n MEDIAN_MNMX4(2, 3, 4, 7);\n MEDIAN_MNMX3(3, 4, 8);\n return v[4];\n}\n#endif\n\n/*\nauthor: [Morgan McGuire, Kyle Whitson]\ndescription: |\n 3x3 median filter, adapted from "A Fast, Small-Radius GPU Median Filter" \n by Morgan McGuire in ShaderX6 https://casual-effects.com/research/McGuire2008Median/index.html\nuse: median2D_fast5(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEDIAN2D_FAST5_TYPE: default vec4\n MEDIAN2D_FAST5_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\nlicense:\n Copyright (c) Morgan McGuire and Williams College, 2006. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n*/\n\n#ifndef MEDIAN2D_FAST5_TYPE\n#define MEDIAN2D_FAST5_TYPE vec4\n#endif\n\n#ifndef MEDIAN2D_FAST5_SAMPLER_FNC\n#define MEDIAN2D_FAST5_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef MEDIAN_S2\n#define MEDIAN_S2(a, b) temp = a; a = min(a, b); b = max(temp, b);\n#endif\n\n#ifndef MEDIAN_2\n#define MEDIAN_2(a, b) MEDIAN_S2(v[a], v[b]);\n#endif\n\n#ifndef FNC_MEDIAN2D_FAST5\n#define FNC_MEDIAN2D_FAST5\n#define MEDIAN_S2(a, b) temp = a; a = min(a, b); b = max(temp, b);\n#define MEDIAN_2(a, b) MEDIAN_S2(v[a], v[b]);\n\n#define MEDIAN_24(a, b, c, d, e, f, g, h) MEDIAN_2(a, b); MEDIAN_2(c, d); MEDIAN_2(e, f); MEDIAN_2(g, h);\n#define MEDIAN_25(a, b, c, d, e, f, g, h, i, j) MEDIAN_24(a, b, c, d, e, f, g, h); MEDIAN_2(i, j);\n\nMEDIAN2D_FAST5_TYPE median2D_fast5(in sampler2D tex, in vec2 st, in vec2 radius) {\n MEDIAN2D_FAST5_TYPE v[25];\n for (int dX = -2; dX <= 2; ++dX) {\n for (int dY = -2; dY <= 2; ++dY) {\n vec2 offset = vec2(float(dX), float(dY));\n // If a pixel in the window is located at (x+dX, y+dY), put it at index (dX + R)(2R + 1) + (dY + R) of the\n // pixel array. This will fill the pixel array, with the top left pixel of the window at pixel[0] and the\n // bottom right pixel of the window at pixel[N-1].\n v[(dX + 2) * 5 + (dY + 2)] = MEDIAN2D_FAST5_SAMPLER_FNC(st + offset * radius);\n }\n }\n\n MEDIAN2D_FAST5_TYPE temp = MEDIAN2D_FAST5_TYPE(0.);\n MEDIAN_25(0, 1, 3, 4, 2, 4, 2, 3, 6, 7);\n MEDIAN_25(5, 7, 5, 6, 9, 7, 1, 7, 1, 4);\n MEDIAN_25(12, 13, 11, 13, 11, 12, 15, 16, 14, 16);\n MEDIAN_25(14, 15, 18, 19, 17, 19, 17, 18, 21, 22);\n MEDIAN_25(20, 22, 20, 21, 23, 24, 2, 5, 3, 6);\n MEDIAN_25(0, 6, 0, 3, 4, 7, 1, 7, 1, 4);\n MEDIAN_25(11, 14, 8, 14, 8, 11, 12, 15, 9, 15);\n MEDIAN_25(9, 12, 13, 16, 10, 16, 10, 13, 20, 23);\n MEDIAN_25(17, 23, 17, 20, 21, 24, 18, 24, 18, 21);\n MEDIAN_25(19, 22, 8, 17, 9, 18, 0, 18, 0, 9);\n MEDIAN_25(10, 19, 1, 19, 1, 10, 11, 20, 2, 20);\n MEDIAN_25(2, 11, 12, 21, 3, 21, 3, 12, 13, 22);\n MEDIAN_25(4, 22, 4, 13, 14, 23, 5, 23, 5, 14);\n MEDIAN_25(15, 24, 6, 24, 6, 15, 7, 16, 7, 19);\n MEDIAN_25(3, 11, 5, 17, 11, 17, 9, 17, 4, 10);\n MEDIAN_25(6, 12, 7, 14, 4, 6, 4, 7, 12, 14);\n MEDIAN_25(10, 14, 6, 7, 10, 12, 6, 10, 6, 17);\n MEDIAN_25(12, 17, 7, 17, 7, 10, 12, 18, 7, 12);\n MEDIAN_24(10, 18, 12, 20, 10, 20, 10, 12);\n return v[12];\n}\n#endif\n\n\n#ifndef FNC_MEDIAN\n#define FNC_MEDIAN\nMEDIAN_TYPE median3(in sampler2D tex, in vec2 st, in vec2 radius) {\n return median2D_fast3(tex, st, radius);\n}\n\nMEDIAN_TYPE median5(in sampler2D tex, in vec2 st, in vec2 radius) {\n return median2D_fast5(tex, st, radius);\n}\n\nMEDIAN_TYPE median(in sampler2D tex, in vec2 st, in vec2 radius) {\n return MEDIAN_AMOUNT(tex, st, radius);\n}\n#endif\n'},6105:n=>{n.exports="/*\nauthor: Alan Wolfe\ndescription: white noise blur based on this shader https://www.shadertoy.com/view/XsVBDR\nuse: noiseBlur(<sampler2D> texture, <vec2> st, <vec2> pixel, <float> radius)\noptions:\n NOISEBLUR_TYPE: default to vec3\n NOISEBLUR_GAUSSIAN_K: no gaussian by default\n NOISEBLUR_RANDOM23_FNC(UV): defaults to random2(UV)\n NOISEBLUR_SAMPLE_FNC(UV): defualts to texture2D(tex, UV).rgb\n NOISEBLUR_SAMPLES: default to 4\nlicence: |\n TODO\n*/\n\n#define RANDOM_SCALE3 vec3(443.897, 441.423, .0973)\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: pass a value and get some random normalize value between 0 and 1\nuse: float random[2|3](<float|vec2|vec3> value)\n*/\n\n#ifndef FNC_RANDOM\n#define FNC_RANDOM\nfloat random(in float x) {\n return fract(sin(x) * 43758.5453);\n}\n\nfloat random(in vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nfloat random(in vec3 pos) {\n return fract(sin(dot(pos.xyz, vec3(70.9898, 78.233, 32.4355))) * 43758.5453123);\n}\n\nfloat random(in vec4 pos) {\n float dot_product = dot(pos, vec4(12.9898,78.233,45.164,94.673));\n return fract(sin(dot_product) * 43758.5453);\n}\n\n// Hash function from https://www.shadertoy.com/view/4djSRW\n#ifndef RANDOM_SCALE3\n#define RANDOM_SCALE3 vec3(.1031, .1030, .0973)\n#endif\n\n#ifndef FANDOM_SCALE4\n#define FANDOM_SCALE4 vec4(1031, .1030, .0973, .1099)\n#endif\nvec2 random2(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec2 random2(in vec2 st) {\n const vec2 k = vec2(.3183099, .3678794);\n st = st * k + k.yx;\n return -1. + 2. * fract(16. * k * fract(st.x * st.y * (st.x + st.y)));\n}\n\nvec2 random2(vec3 p3) {\n p3 = fract(p3 * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec3 random3(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx); \n}\n\nvec3 random3(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yxz+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx);\n}\n\nvec3 random3(in vec3 p) {\n p = vec3( dot(p, vec3(127.1, 311.7, 74.7)),\n dot(p, vec3(269.5, 183.3, 246.1)),\n dot(p, vec3(113.5, 271.9, 124.6)));\n return -1. + 2. * fract(sin(p) * 43758.5453123);\n}\n\nvec4 random4(float p) {\n vec4 p4 = fract(vec4(p) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx); \n}\n\nvec4 random4(vec2 p) {\n vec4 p4 = fract(vec4(p.xyxy) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec3 p) {\n vec4 p4 = fract(vec4(p.xyzx) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec4 p4) {\n p4 = fract(p4 * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\n\n#endif\n\n\n#ifndef NOISEBLUR_SAMPLES\n#define NOISEBLUR_SAMPLES 4\n#endif\n\n#ifndef NOISEBLUR_TYPE\n#define NOISEBLUR_TYPE vec3\n#endif\n\n#ifndef NOISEBLUR_SAMPLE_FNC\n#define NOISEBLUR_SAMPLE_FNC(UV) texture2D(tex, UV).rgb\n#endif\n\n#ifndef NOISEBLUR_RANDOM23_FNC\n#define NOISEBLUR_RANDOM23_FNC(UV) random2(UV)\n#endif\n\n#ifndef FNC_NOISEBLUR\n#define FNC_NOISEBLUR\nNOISEBLUR_TYPE noiseBlur(in sampler2D tex, in vec2 st, in vec2 pixel, float radius) {\n float blurRadius = radius;\n vec2 whiteNoiseUV = st;\n NOISEBLUR_TYPE result = NOISEBLUR_TYPE(0.0);\n for (int i = 0; i < NOISEBLUR_SAMPLES; ++i) {\n vec2 whiteNoiseRand = NOISEBLUR_RANDOM23_FNC(vec3(whiteNoiseUV.xy, float(i)));\n whiteNoiseUV = whiteNoiseRand;\n\n vec2 r = whiteNoiseRand;\n r.x *= TAU;\n \n #if defined(NOISEBLUR_GAUSSIAN_K)\n // box-muller transform to get gaussian distributed sample points in the circle\n vec2 cr = vec2(sin(r.x),cos(r.x))*sqrt(-NOISEBLUR_GAUSSIAN_K * log(r.y));\n #else\n // uniform sample the circle\n vec2 cr = vec2(sin(r.x),cos(r.x))*sqrt(r.y);\n #endif\n \n NOISEBLUR_TYPE color = NOISEBLUR_SAMPLE_FNC( st + cr * blurRadius * pixel );\n // average the samples as we get em\n // https://blog.demofox.org/2016/08/23/incremental-averaging/\n result = mix(result, color, 1.0 / float(i+1));\n }\n return result;\n}\n#endif"},6827:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: make a radial blur, with dir as the direction to the center and strength as the amount\nuse: radialBlur(<sampler2D> texture, <vec2> st, <vec2> dir [, <float> strength] )\noptions:\n RADIALBLUR_KERNELSIZE: Default 64 \n RADIALBLUR_STRENGTH: Default 0.125\n RADIALBLUR_TYPE: Default `vec4`\n RADIALBLUR_SAMPLER_FNC(POS_UV): Default `texture2D(tex, POS_UV)`\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef RADIALBLUR_KERNELSIZE\n#define RADIALBLUR_KERNELSIZE 64\n#endif\n\n#ifndef RADIALBLUR_STRENGTH\n#define RADIALBLUR_STRENGTH .125\n#endif\n\n#ifndef RADIALBLUR_TYPE\n#define RADIALBLUR_TYPE vec4\n#endif\n\n#ifndef RADIALBLUR_SAMPLER_FNC\n#define RADIALBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_RADIALBLUR\n#define FNC_RADIALBLUR\nRADIALBLUR_TYPE radialBlur(in sampler2D tex, in vec2 st, in vec2 dir, in float strength) {\n RADIALBLUR_TYPE color = RADIALBLUR_TYPE(0.);\n float f_samples = float(RADIALBLUR_KERNELSIZE);\n float f_factor = 1./f_samples;\n for (int i = 0; i < RADIALBLUR_KERNELSIZE; i += 2) {\n color += RADIALBLUR_SAMPLER_FNC(st + float(i) * f_factor * dir * strength);\n color += RADIALBLUR_SAMPLER_FNC(st + float(i+1) * f_factor * dir * strength);\n }\n return color * f_factor;\n}\n\nRADIALBLUR_TYPE radialBlur(in sampler2D tex, in vec2 st, in vec2 dir) {\n return radialBlur(tex, st, dir, RADIALBLUR_STRENGTH);\n}\n#endif\n'}},e={};function t(i){var o=e[i];if(void 0!==o)return o.exports;var A=e[i]={exports:{}};return n[i](A,A.exports,t),A.exports}t.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return t.d(e,{a:e}),e},t.d=(n,e)=>{for(var i in e)t.o(e,i)&&!t.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:e[i]})},t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),t.r=n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var i={};return(()=>{"use strict";t.r(i),t.d(i,{default:()=>d});var n=t(1995),e=t.n(n),o=t(4207),A=t.n(o),s=t(548),r=t.n(s),E=t(7030),R=t.n(E),a=t(6815),S=t.n(a),I=t(6827),T=t.n(I),f=t(5551),N=t.n(f),l=t(6105),O=t.n(l);const d={bilateralBlur:e(),boxBlur:A(),gaussianBlur:r(),mean:R(),median:S(),radialBlur:T(),kuwahara:N(),noiseBlur:O()}})(),i})()})); | ||
!(function (n, e) { | ||
'object' == typeof exports && 'object' == typeof module | ||
? (module.exports = e()) | ||
: 'function' == typeof define && define.amd | ||
? define([], e) | ||
: 'object' == typeof exports | ||
? (exports.lygia = e()) | ||
: (n.Lygia = e()) | ||
})(self, function () { | ||
return (() => { | ||
var n = { | ||
1995: (n) => { | ||
n.exports = | ||
'/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get\'s the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: rgb2luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_RGB2LUMA\n#define FNC_RGB2LUMA\nfloat rgb2luma(in vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\nfloat rgb2luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: TODO\nuse: bilateralBlur(<sampler2D> texture, <vec2> st, <vec2> duv)\noptions: TODO\nlicense: TODO\n*/\n\n#ifndef BILATERALBLUR_AMOUNT\n#define BILATERALBLUR_AMOUNT bilateralBlur13\n#endif\n\n#ifndef BILATERALBLUR_TYPE\n#define BILATERALBLUR_TYPE vec4\n#endif\n\n#ifndef BILATERALBLUR_SAMPLER_FNC\n#define BILATERALBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef BILATERALBLUR_LUMA\n#define BILATERALBLUR_LUMA(RGB) rgb2luma(RGB.rgb)\n#endif\n\n/*\nauthor: Hugh Kennedy (https://github.com/hughsk)\ndescription: get\'s the luminosity of a color. From https://github.com/hughsk/glsl-luma/blob/master/index.glsl\nuse: rgb2luma(<vec3|vec4> color)\nlicense: |\n This software is released under the MIT license:\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef FNC_RGB2LUMA\n#define FNC_RGB2LUMA\nfloat rgb2luma(in vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\nfloat rgb2luma(in vec4 color) {\n return rgb2luma(color.rgb);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: two dimensional bilateral Blur, to do it in one single pass\nuse: bilateralBlur2D(<sampler2D> texture, <vec2> st, <vec2> offset, <int> kernelSize)\noptions:\n BILATERALBLUR2D_TYPE: default is vec3\n BILATERALBLUR2D_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\n BILATERALBLUR2D_LUMA(RGB): default rgb2luma\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BILATERALBLUR2D_TYPE\n#define BILATERALBLUR2D_TYPE vec4\n#endif\n\n#ifndef BILATERALBLUR2D_SAMPLER_FNC\n#define BILATERALBLUR2D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef BILATERALBLUR2D_LUMA\n#define BILATERALBLUR2D_LUMA(RGB) rgb2luma(RGB.rgb)\n#endif\n\n#ifndef FNC_BILATERALBLUR2D\n#define FNC_BILATERALBLUR2D\nBILATERALBLUR2D_TYPE bilateralBlur2D(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n BILATERALBLUR2D_TYPE accumColor = BILATERALBLUR2D_TYPE(0.);\n #ifndef BILATERALBLUR2D_KERNELSIZE\n #define BILATERALBLUR2D_KERNELSIZE kernelSize\n #endif\n float accumWeight = 0.;\n const float k = .15915494; // 1. / (2.*PI)\n const float k2 = k * k;\n float kernelSize2 = float(BILATERALBLUR2D_KERNELSIZE) * float(BILATERALBLUR2D_KERNELSIZE);\n BILATERALBLUR2D_TYPE tex0 = BILATERALBLUR2D_SAMPLER_FNC(st);\n float lum0 = BILATERALBLUR2D_LUMA(tex0);\n\n for (int j = 0; j < BILATERALBLUR2D_KERNELSIZE; j++) {\n float dy = -.5 * (float(BILATERALBLUR2D_KERNELSIZE) - 1.0) + float(j);\n for (int i = 0; i < BILATERALBLUR2D_KERNELSIZE; i++) {\n float dx = -.5 * (float(BILATERALBLUR2D_KERNELSIZE) - 1.0) + float(i);\n BILATERALBLUR2D_TYPE tex = BILATERALBLUR2D_SAMPLER_FNC(st + vec2(dx, dy) * offset);\n float lum = BILATERALBLUR2D_LUMA(tex);\n float dl = 255. * (lum - lum0);\n float weight = (k2 / kernelSize2) * exp(-(dx * dx + dy * dy + dl * dl) / (2. * kernelSize2));\n accumColor += weight * tex;\n accumWeight += weight;\n }\n }\n return accumColor / accumWeight;\n}\n#endif\n\n\n#ifndef FNC_BILATERALFILTER\n#define FNC_BILATERALFILTER\nBILATERALBLUR_TYPE bilateralBlur(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n return bilateralBlur2D(tex, st, offset, kernelSize);\n}\n\nBILATERALBLUR_TYPE bilateralBlur13(in sampler2D tex, in vec2 st, in vec2 offset) {\n return bilateralBlur(tex, st, offset, 7);\n}\n\nBILATERALBLUR_TYPE bilateralBlur9(in sampler2D tex, in vec2 st, in vec2 offset) {\n return bilateralBlur(tex, st, offset, 5);\n}\n\nBILATERALBLUR_TYPE bilateralBlur5(in sampler2D tex, in vec2 st, in vec2 offset) {\n return bilateralBlur(tex, st, offset, 3);\n}\n\nBILATERALBLUR_TYPE bilateralBlur(in sampler2D tex, in vec2 st, in vec2 offset) {\n return BILATERALBLUR_AMOUNT(tex, st, offset);\n}\n#endif\n' | ||
}, | ||
4207: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: given a texture return a simple box blured pixel\nuse: boxBlur(<sampler2D> texture, <vec2> st, <vec2> pixel_offset)\noptions:\n BOXBLUR_2D: default to 1D\n BOXBLUR_ITERATIONS: default 3\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BOXBLUR_ITERATIONS\n#define BOXBLUR_ITERATIONS 3\n#endif\n\n#ifndef BOXBLUR_TYPE\n#define BOXBLUR_TYPE vec4\n#endif\n\n#ifndef BOXBLUR_SAMPLER_FNC\n#define BOXBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: simple one dimentional box blur, to be applied in two passes\nuse: boxBlur1D(<sampler2D> texture, <vec2> st, <vec2> pixel_offset, <int> kernelSize)\noptions:\n BOXBLUR1D_TYPE: default is vec4\n BOXBLUR1D_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\n BOXBLUR1D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n#ifndef BOXBLUR1D_TYPE\n#define BOXBLUR1D_TYPE vec4\n#endif\n\n#ifndef BOXBLUR1D_SAMPLER_FNC\n#define BOXBLUR1D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_BOXBLUR1D\n#define FNC_BOXBLUR1D\nBOXBLUR1D_TYPE boxBlur1D(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n BOXBLUR1D_TYPE color = BOXBLUR1D_TYPE(0.);\n #ifndef BOXBLUR1D_KERNELSIZE\n #define BOXBLUR1D_KERNELSIZE kernelSize\n #endif\n\n float f_kernelSize = float(BOXBLUR1D_KERNELSIZE);\n float weight = 1. / f_kernelSize;\n\n for (int i = 0; i < BOXBLUR1D_KERNELSIZE; i++) {\n float x = -.5 * (f_kernelSize - 1.) + float(i);\n color += BOXBLUR1D_SAMPLER_FNC(st + offset * x ) * weight;\n }\n return color;\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: simple two dimentional box blur, so can be apply in a single pass\nuse: boxBlur2D(<sampler2D> texture, <vec2> st, <vec2> pixel_offset, <int> kernelSize)\noptions:\n BOXBLUR2D_TYPE: Default `vec4`\n BOXBLUR2D_SAMPLER_FNC(POS_UV): default is `texture2D(tex, POS_UV)`\n BOXBLUR2D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BOXBLUR2D_TYPE\n#define BOXBLUR2D_TYPE vec4\n#endif\n\n#ifndef BOXBLUR2D_SAMPLER_FNC\n#define BOXBLUR2D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_BOXBLUR2D\n#define FNC_BOXBLUR2D\nBOXBLUR2D_TYPE boxBlur2D(in sampler2D tex, in vec2 st, in vec2 pixel, const int kernelSize) {\n BOXBLUR2D_TYPE color = BOXBLUR2D_TYPE(0.);\n #ifndef BOXBLUR2D_KERNELSIZE\n #define BOXBLUR2D_KERNELSIZE kernelSize\n #endif\n\n float accumWeight = 0.;\n float f_kernelSize = float(BOXBLUR2D_KERNELSIZE);\n float kernelSize2 = f_kernelSize * f_kernelSize;\n float weight = 1. / kernelSize2;\n\n for (int j = 0; j < BOXBLUR2D_KERNELSIZE; j++) {\n float y = -.5 * (f_kernelSize - 1.) + float(j);\n for (int i = 0; i < BOXBLUR2D_KERNELSIZE; i++) {\n float x = -.5 * (f_kernelSize - 1.) + float(i);\n color += BOXBLUR2D_SAMPLER_FNC(st + vec2(x, y) * pixel) * weight;\n }\n }\n return color;\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: simple two dimentional box blur, so can be apply in a single pass\nuse: boxBlur1D_fast9(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n BOXBLUR2D_FAST9_TYPE: Default is `vec4`\n BOXBLUR2D_FAST9_SAMPLER_FNC(POS_UV): Default is `texture2D(tex, POS_UV)`\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef BOXBLUR2D_FAST9_TYPE\n#define BOXBLUR2D_FAST9_TYPE vec4\n#endif\n\n#ifndef BOXBLUR2D_FAST9_SAMPLER_FNC\n#define BOXBLUR2D_FAST9_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_BOXBLUR2D_FAST9\n#define FNC_BOXBLUR2D_FAST9\nBOXBLUR2D_FAST9_TYPE boxBlur2D_fast9(in sampler2D tex, in vec2 st, in vec2 offset) {\n BOXBLUR2D_FAST9_TYPE color = BOXBLUR2D_FAST9_SAMPLER_FNC(st); // center\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(-offset.x, offset.y)); // tleft\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(-offset.x, 0.)); // left\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(-offset.x, -offset.y)); // bleft\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(0., offset.y)); // top\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(0., -offset.y)); // bottom\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + offset); // tright\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(offset.x, 0.)); // right\n color += BOXBLUR2D_FAST9_SAMPLER_FNC(st + vec2(offset.x, -offset.y)); // bright\n return color * 0.1111111111; // 1./9.\n}\n#endif\n\n\n#ifndef FNC_BOXBLUR\n#define FNC_BOXBLUR\nBOXBLUR_TYPE boxBlur13(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, 7);\n#else\n return boxBlur1D(tex, st, offset, 7);\n#endif\n}\n\nBOXBLUR_TYPE boxBlur9(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef BOXBLUR_2D\n return boxBlur2D_fast9(tex, st, offset);\n#else\n return boxBlur1D(tex, st, offset, 5);\n#endif\n}\n\nBOXBLUR_TYPE boxBlur5(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, 3);\n#else\n return boxBlur1D(tex, st, offset, 3);\n#endif\n}\n\nvec4 boxBlur(in sampler2D tex, in vec2 st, vec2 offset, const int kernelSize) {\n#ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, kernelSize);\n#else\n return boxBlur1D(tex, st, offset, kernelSize);\n#endif\n}\n\nvec4 boxBlur(in sampler2D tex, in vec2 st, vec2 offset) {\n #ifdef BOXBLUR_2D\n return boxBlur2D(tex, st, offset, BOXBLUR_ITERATIONS);\n #else\n return boxBlur1D(tex, st, offset, BOXBLUR_ITERATIONS);\n #endif\n}\n#endif\n' | ||
}, | ||
548: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Matt DesLauriers, Patricio Gonzalez Vivo]\ndescription: adapted versions from 5, 9 and 13 gaussian fast blur from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur(<sampler2D> texture, <vec2> st, <vec2> pixel_direction [, const int kernelSize])\noptions:\n GAUSSIANBLUR_AMOUNT: gaussianBlur5 gaussianBlur9 gaussianBlur13 \n GAUSSIANBLUR_2D: default to 1D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n#ifndef GAUSSIANBLUR_AMOUNT\n#define GAUSSIANBLUR_AMOUNT gaussianBlur13\n#endif\n\n#ifndef GAUSSIANBLUR_TYPE\n#define GAUSSIANBLUR_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR_SAMPLER_FNC\n#define GAUSSIANBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: two dimension Gaussian Blur to be applied in only one passes\nuse: gaussianBlur2D(<sampler2D> texture, <vec2> st, <vec2> pixel_direction , const int kernelSize)\noptions:\n GAUSSIANBLUR2D_TYPE: Default `vec4`\n GAUSSIANBLUR2D_SAMPLER_FNC(POS_UV): Default `texture2D(tex, POS_UV)`\n GAUSSIANBLUR2D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n#ifndef GAUSSIANBLUR2D_TYPE\n#define GAUSSIANBLUR2D_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR2D_SAMPLER_FNC\n#define GAUSSIANBLUR2D_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR2D\n#define FNC_GAUSSIANBLUR2D\nGAUSSIANBLUR2D_TYPE gaussianBlur2D(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n GAUSSIANBLUR2D_TYPE accumColor = GAUSSIANBLUR2D_TYPE(0.);\n #ifndef GAUSSIANBLUR2D_KERNELSIZE\n #define GAUSSIANBLUR2D_KERNELSIZE kernelSize\n #endif\n\n float accumWeight = 0.;\n const float k = .15915494; // 1 / (2*PI)\n float kernelSize2 = float(GAUSSIANBLUR2D_KERNELSIZE) * float(GAUSSIANBLUR2D_KERNELSIZE);\n\n for (int j = 0; j < GAUSSIANBLUR2D_KERNELSIZE; j++) {\n float y = -.5 * (float(GAUSSIANBLUR2D_KERNELSIZE) - 1.) + float(j);\n for (int i = 0; i < GAUSSIANBLUR2D_KERNELSIZE; i++) {\n float x = -.5 * (float(GAUSSIANBLUR2D_KERNELSIZE) - 1.) + float(i);\n float weight = (k / float(GAUSSIANBLUR2D_KERNELSIZE)) * exp(-(x * x + y * y) / (2. * kernelSize2));\n GAUSSIANBLUR2D_TYPE tex = GAUSSIANBLUR2D_SAMPLER_FNC(st + vec2(x, y) * offset);\n accumColor += weight * tex;\n accumWeight += weight;\n }\n }\n return accumColor / accumWeight;\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: one dimension Gaussian Blur to be applied in two passes\nuse: gaussianBlur1D(<sampler2D> texture, <vec2> st, <vec2> pixel_direction , const int kernelSize)\noptions:\n GAUSSIANBLUR1D_TYPE:\n GAUSSIANBLUR1D_SAMPLER_FNC(POS_UV):\n GAUSSIANBLUR1D_KERNELSIZE: Use only for WebGL 1.0 and OpenGL ES 2.0 . For example RaspberryPis is not happy with dynamic loops. Default is \'kernelSize\'\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef GAUSSIANBLUR1D_TYPE\n#define GAUSSIANBLUR1D_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_SAMPLER_FNC\n#define GAUSSIANBLUR1D_SAMPLER_FNC(POS_UV)texture2D(tex,POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D\n#define FNC_GAUSSIANBLUR1D\n\n#ifdef GAUSSIANBLUR1D_DYNAMIC\n\nGAUSSIANBLUR1D_TYPE gaussianBlur1D(in sampler2D tex,in vec2 st,in vec2 offset,const int kernelSize){\n GAUSSIANBLUR1D_TYPE accumColor = GAUSSIANBLUR1D_TYPE(0.0);\n \n float accumWeight = 0.0;\n const float k = 0.39894228;// 1 / sqrt(2*PI)\n float kernelSize2 = float(kernelSize)*float(kernelSize);\n for(int i = 0; i < 16; i++){\n if( i >= kernelSize)\n break;\n float x = -0.5 * (float(kernelSize) - 1.0)+float(i);\n float weight = (k/float(kernelSize)) * exp(-(x*x)/(2.0*kernelSize2));\n GAUSSIANBLUR1D_TYPE tex = GAUSSIANBLUR1D_SAMPLER_FNC(st + x * offset);\n accumColor += weight * tex;\n accumWeight += weight;\n }\n return accumColor/accumWeight;\n}\n\n#else\nGAUSSIANBLUR1D_TYPE gaussianBlur1D(in sampler2D tex,in vec2 st,in vec2 offset,const int kernelSize){\n GAUSSIANBLUR1D_TYPE accumColor=GAUSSIANBLUR1D_TYPE(0.);\n #ifndef GAUSSIANBLUR1D_KERNELSIZE\n #define GAUSSIANBLUR1D_KERNELSIZE kernelSize\n #endif\n \n float accumWeight = 0.0;\n const float k = 0.39894228;// 1 / sqrt(2*PI)\n float kernelSize2=float(GAUSSIANBLUR1D_KERNELSIZE)*float(GAUSSIANBLUR1D_KERNELSIZE);\n for(int i = 0; i < GAUSSIANBLUR1D_KERNELSIZE; i++){\n float x = -0.5 * (float(GAUSSIANBLUR1D_KERNELSIZE) -1.0) + float(i);\n float weight = (k/float(GAUSSIANBLUR1D_KERNELSIZE)) * exp(-(x*x)/(2.0*kernelSize2));\n GAUSSIANBLUR1D_TYPE tex = GAUSSIANBLUR1D_SAMPLER_FNC(st + x * offset);\n accumColor += weight * tex;\n accumWeight += weight;\n }\n return accumColor/accumWeight;\n}\n#endif\n\n#endif\n\n/*\nfunction: gaussianBlur1D_fast13\nauthor: Matt DesLauriers\ndescription: adapted versions of gaussian fast blur 13 from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur1D_fast13(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n GAUSSIANBLUR1D_FAST13_TYPE\n GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(POS_UV)\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Jam3\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n#ifndef GAUSSIANBLUR1D_FAST13_TYPE\n#define GAUSSIANBLUR1D_FAST13_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_FAST13_SAMPLER_FNC\n#define GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D_FAST13\n#define FNC_GAUSSIANBLUR1D_FAST13\nGAUSSIANBLUR1D_FAST13_TYPE gaussianBlur1D_fast13(in sampler2D tex, in vec2 st, in vec2 offset) {\n GAUSSIANBLUR1D_FAST13_TYPE color = GAUSSIANBLUR1D_FAST13_TYPE(0.);\n vec2 off1 = vec2(1.411764705882353) * offset;\n vec2 off2 = vec2(3.2941176470588234) * offset;\n vec2 off3 = vec2(5.176470588235294) * offset;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st) * .1964825501511404;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st + (off1)) * .2969069646728344;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st - (off1)) * .2969069646728344;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st + (off2)) * .09447039785044732;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st - (off2)) * .09447039785044732;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st + (off3)) * .010381362401148057;\n color += GAUSSIANBLUR1D_FAST13_SAMPLER_FNC(st - (off3)) * .010381362401148057;\n return color;\n}\n#endif\n\n/*\nauthor: Matt DesLauriers\ndescription: adapted versions of gaussian fast blur 13 from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur1D_fast9(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n GAUSSIANBLUR1D_FAST9_TYPE\n GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(POS_UV)\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Jam3\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n#ifndef GAUSSIANBLUR1D_FAST9_TYPE\n#define GAUSSIANBLUR1D_FAST9_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_FAST9_SAMPLER_FNC\n#define GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D_FAST9\n#define FNC_GAUSSIANBLUR1D_FAST9\nGAUSSIANBLUR1D_FAST9_TYPE gaussianBlur1D_fast9(in sampler2D tex, in vec2 st, in vec2 offset) {\n GAUSSIANBLUR1D_FAST9_TYPE color = GAUSSIANBLUR1D_FAST9_TYPE(0.);\n vec2 off1 = vec2(1.3846153846) * offset;\n vec2 off2 = vec2(3.2307692308) * offset;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st) * .2270270270;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st + (off1)) * .3162162162;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st - (off1)) * .3162162162;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st + (off2)) * .0702702703;\n color += GAUSSIANBLUR1D_FAST9_SAMPLER_FNC(st - (off2)) * .0702702703;\n return color;\n}\n#endif\n\n/*\nauthor: Matt DesLauriers\ndescription: adapted versions of gaussian fast blur 13 from https://github.com/Jam3/glsl-fast-gaussian-blur\nuse: gaussianBlur1D_fast5(<sampler2D> texture, <vec2> st, <vec2> pixel_direction)\noptions:\n GAUSSIANBLUR1D_FAST5_TYPE\n GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(POS_UV)\nlicense: |\n The MIT License (MIT) Copyright (c) 2015 Jam3\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef GAUSSIANBLUR1D_FAST5_TYPE\n#define GAUSSIANBLUR1D_FAST5_TYPE vec4\n#endif\n\n#ifndef GAUSSIANBLUR1D_FAST5_SAMPLER_FNC\n#define GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_GAUSSIANBLUR1D_FAST5\n#define FNC_GAUSSIANBLUR1D_FAST5\nGAUSSIANBLUR1D_FAST5_TYPE gaussianBlur1D_fast5(in sampler2D tex, in vec2 st, in vec2 offset) {\n GAUSSIANBLUR1D_FAST5_TYPE color = GAUSSIANBLUR1D_FAST5_TYPE(0.);\n vec2 off1 = vec2(1.3333333333333333) * offset;\n color += GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(st) * .29411764705882354;\n color += GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(st + (off1)) * .35294117647058826;\n color += GAUSSIANBLUR1D_FAST5_SAMPLER_FNC(st - (off1)) * .35294117647058826;\n return color;\n}\n#endif\n\n\n#ifndef FNC_GAUSSIANBLUR\n#define FNC_GAUSSIANBLUR\nGAUSSIANBLUR_TYPE gaussianBlur13(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, 7);\n#else\n return gaussianBlur1D_fast13(tex, st, offset);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur9(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, 5);\n#else\n return gaussianBlur1D_fast9(tex, st, offset);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur5(in sampler2D tex, in vec2 st, in vec2 offset) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, 3);\n#else\n return gaussianBlur1D_fast5(tex, st, offset);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur(in sampler2D tex, in vec2 st, in vec2 offset, const int kernelSize) {\n#ifdef GAUSSIANBLUR_2D\n return gaussianBlur2D(tex, st, offset, kernelSize);\n#else\n return gaussianBlur1D(tex, st, offset, kernelSize);\n#endif\n}\n\nGAUSSIANBLUR_TYPE gaussianBlur(in sampler2D tex, in vec2 st, in vec2 offset) {\n return GAUSSIANBLUR_AMOUNT(tex, st, offset);\n}\n#endif\n' | ||
}, | ||
5551: (n) => { | ||
n.exports = | ||
'/*\nauthor: Brad Larson\ndescription: Kuwahara image abstraction, drawn from the work of Kyprianidis, et. al. in their publication "Anisotropic Kuwahara Filtering on the GPU" within the GPU Pro collection. This produces an oil-painting-like image, but it is extremely computationally expensive, so it can take seconds to render a frame on an iPad 2. This might be best used for still images.\nuse: kuwahara(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n KUWAHARA_TYPE: defaults to vec3\n KUWAHARA_SAMPLER_FNC(POS_UV): defaults to texture2D(tex, POS_UV).rgb\n KUWAHARA_RADIUS radius\nlicence:\n Copyright (c) 2012, Brad Larson, Ben Cochran, Hugues Lismonde, Keitaroh Kobayashi, Alaric Cole, Matthew Clark, Jacob Gundersen, Chris Williams.\n All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef KUWAHARA_TYPE\n#define KUWAHARA_TYPE vec3\n#endif\n\n#ifndef KUWAHARA_SAMPLER_FNC\n#define KUWAHARA_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV).rgb\n#endif\n\n#ifndef KUWAHARA_RADIUS\n#define KUWAHARA_RADIUS radius\n#endif\n\n#ifndef FNC_KUWAHARA\n#define FNC_KUWAHARA\n\n#ifdef TARGET_MOBILE\nKUWAHARA_TYPE kuwahara(in sampler2D tex, in vec2 st, in vec2 pixel, in int radius) {\n float n = float((KUWAHARA_RADIUS + 1) * (KUWAHARA_RADIUS + 1));\n int i; int j;\n KUWAHARA_TYPE m0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE s0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE rta = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE c;\n\n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m0 += c;\n s0 += c * c;\n }\n }\n\n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m1 += c;\n s1 += c * c;\n }\n }\n\n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m2 += c;\n s2 += c * c;\n }\n }\n\n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m3 += c;\n s3 += c * c;\n }\n }\n\n float min_sigma2 = 1e+2;\n m0 /= n;\n s0 = abs(s0 / n - m0 * m0);\n\n float sigma2 = s0.r + s0.g + s0.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m0;\n }\n\n m1 /= n;\n s1 = abs(s1 / n - m1 * m1);\n\n sigma2 = s1.r + s1.g + s1.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m1;\n }\n\n m2 /= n;\n s2 = abs(s2 / n - m2 * m2);\n\n sigma2 = s2.r + s2.g + s2.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m2;\n }\n\n m3 /= n;\n s3 = abs(s3 / n - m3 * m3);\n\n sigma2 = s3.r + s3.g + s3.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m3;\n }\n\n return rta;\n}\n#else\n\nKUWAHARA_TYPE kuwahara(in sampler2D tex, in vec2 st, in vec2 pixel, in int radius) {\n\n float n = float((KUWAHARA_RADIUS + 1) * (KUWAHARA_RADIUS + 1));\n int i; int j;\n KUWAHARA_TYPE m0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE m3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE s0 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s1 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s2 = KUWAHARA_TYPE(0.0); KUWAHARA_TYPE s3 = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE rta = KUWAHARA_TYPE(0.0);\n KUWAHARA_TYPE c;\n \n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m0 += c;\n s0 += c * c;\n }\n }\n \n for (j = -KUWAHARA_RADIUS; j <= 0; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m1 += c;\n s1 += c * c;\n }\n }\n \n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = 0; i <= KUWAHARA_RADIUS; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m2 += c;\n s2 += c * c;\n }\n }\n \n for (j = 0; j <= KUWAHARA_RADIUS; ++j) {\n for (i = -KUWAHARA_RADIUS; i <= 0; ++i) {\n c = KUWAHARA_SAMPLER_FNC(st + vec2(i,j) * pixel);\n m3 += c;\n s3 += c * c;\n }\n }\n \n \n float min_sigma2 = 1e+2;\n m0 /= n;\n s0 = abs(s0 / n - m0 * m0);\n \n float sigma2 = s0.r + s0.g + s0.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m0;\n }\n \n m1 /= n;\n s1 = abs(s1 / n - m1 * m1);\n \n sigma2 = s1.r + s1.g + s1.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m1;\n }\n \n m2 /= n;\n s2 = abs(s2 / n - m2 * m2);\n \n sigma2 = s2.r + s2.g + s2.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m2;\n }\n \n m3 /= n;\n s3 = abs(s3 / n - m3 * m3);\n \n sigma2 = s3.r + s3.g + s3.b;\n if (sigma2 < min_sigma2) {\n min_sigma2 = sigma2;\n rta = m3;\n }\n\n return rta;\n}\n\n#endif\n\n#endif' | ||
}, | ||
7030: (n) => { | ||
n.exports = | ||
'/*\nauthor: Brad Larson\ndescription: adapted version of mean average sampling on four coorners of a sampled point from https://github.com/BradLarson/GPUImage2\nuse: mean(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEAN_TYPE: defaults to vec4\n AVERAGE_SAMPLER_FNC(POS_UV): defaults to texture2D(tex,POS_UV)\nlicence:\n Copyright (c) 2015, Brad Larson. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef MEAN_TYPE\n#define MEAN_TYPE vec4\n#endif\n\n#ifndef MEAN_AMOUNT\n#define MEAN_AMOUNT mean4\n#endif\n\n#ifndef MEAN_SAMPLER_FNC\n#define MEAN_SAMPLER_FNC(POS_UV) texture2D(tex,POS_UV)\n#endif\n\n#ifndef FNC_AVERAGE\n#define FNC_AVERAGE\nMEAN_TYPE mean4(in sampler2D tex, in vec2 st, in vec2 pixel) {\n MEAN_TYPE topLeft = MEAN_SAMPLER_FNC(st - pixel);\n MEAN_TYPE bottomLeft = MEAN_SAMPLER_FNC(st + vec2(-pixel.x, pixel.y));\n MEAN_TYPE topRight = MEAN_SAMPLER_FNC(st + vec2(pixel.x, -pixel.y));\n MEAN_TYPE bottomRight = MEAN_SAMPLER_FNC(st + pixel);\n return 0.25 * (topLeft + topRight + bottomLeft + bottomRight);\n}\n\nMEAN_TYPE mean(in sampler2D tex, in vec2 st, in vec2 pixel) {\n return MEAN_AMOUNT(tex, st, pixel);\n}\n#endif\n' | ||
}, | ||
6815: (n) => { | ||
n.exports = | ||
'/*\nauthor:[Morgan McGuire, Kyle Whitson]\ndescription: 3x3 and 5x5 median filter, adapted from "A Fast, Small-Radius GPU Median Filter" by Morgan McGuire in ShaderX6 https://casual-effects.com/research/McGuire2008Median/index.html\nuse: median(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEDIAN_AMOUNT: median3 (3x3) median5 (5x5)\n MEDIAN_TYPE: default vec4\n MEDIAN_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\nlicense:\n Copyright (c) Morgan McGuire and Williams College, 2006. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef MEDIAN_AMOUNT\n#define MEDIAN_AMOUNT median5\n#endif\n\n#ifndef MEDIAN_TYPE\n#define MEDIAN_TYPE vec4\n#endif\n\n#ifndef MEDIAN_SAMPLER_FNC\n#define MEDIAN_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n/*\nauthor: [Morgan McGuire, Kyle Whitson]\ndescription: |\n 3x3 median filter, adapted from "A Fast, Small-Radius GPU Median Filter" \n by Morgan McGuire in ShaderX6 https://casual-effects.com/research/McGuire2008Median/index.html\nuse: median2D_fast3(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEDIAN2D_FAST3_TYPE: default vec4\n MEDIAN2D_FAST3_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\nlicense:\n Copyright (c) Morgan McGuire and Williams College, 2006. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n*/\n\n#ifndef MEDIAN2D_FAST3_TYPE\n#define MEDIAN2D_FAST3_TYPE vec4\n#endif\n\n#ifndef MEDIAN2D_FAST3_SAMPLER_FNC\n#define MEDIAN2D_FAST3_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef MEDIAN_S2\n#define MEDIAN_S2(a, b) temp = a; a = min(a, b); b = max(temp, b);\n#endif\n\n#ifndef MEDIAN_2\n#define MEDIAN_2(a, b) MEDIAN_S2(v[a], v[b]);\n#endif\n\n#ifndef FNC_MEDIAN2D_FAST3\n#define FNC_MEDIAN2D_FAST3\n#define MEDIAN_MN3(a, b, c) MEDIAN_2(a, b); MEDIAN_2(a, c);\n#define MEDIAN_MX3(a, b, c) MEDIAN_2(b, c); MEDIAN_2(a, c);\n#define MEDIAN_MNMX3(a, b, c) MEDIAN_MX3(a, b, c); MEDIAN_2(a, b); // 3 exchanges\n#define MEDIAN_MNMX4(a, b, c, d) MEDIAN_2(a, b); MEDIAN_2(c, d); MEDIAN_2(a, c); MEDIAN_2(b, d); // 4 exchanges\n#define MEDIAN_MNMX5(a, b, c, d, e) MEDIAN_2(a, b); MEDIAN_2(c, d); MEDIAN_MN3(a, c, e); MEDIAN_MX3(b, d, e); // 6 exchanges\n#define MEDIAN_MNMX6(a, b, c, d, e, f) MEDIAN_2(a, d); MEDIAN_2(b, e); MEDIAN_2(c, f); MEDIAN_MN3(a, b, c); MEDIAN_MX3(d, e, f); // 7 exchanges\nMEDIAN2D_FAST3_TYPE median2D_fast3(in sampler2D tex, in vec2 st, in vec2 radius) {\n MEDIAN2D_FAST3_TYPE v[9];\n for (int dX = -1; dX <= 1; ++dX) {\n for (int dY = -1; dY <= 1; ++dY) {\n vec2 offset = vec2(float(dX), float(dY));\n // If a pixel in the window is located at (x+dX, y+dY), put it at index (dX + R)(2R + 1) + (dY + R) of the\n // pixel array. This will fill the pixel array, with the top left pixel of the window at pixel[0] and the\n // bottom right pixel of the window at pixel[N-1].\n v[(dX + 1) * 3 + (dY + 1)] = MEDIAN2D_FAST3_SAMPLER_FNC(st + offset * radius);\n }\n }\n MEDIAN2D_FAST3_TYPE temp = MEDIAN2D_FAST3_TYPE(0.);\n MEDIAN_MNMX6(0, 1, 2, 3, 4, 5);\n MEDIAN_MNMX5(1, 2, 3, 4, 6);\n MEDIAN_MNMX4(2, 3, 4, 7);\n MEDIAN_MNMX3(3, 4, 8);\n return v[4];\n}\n#endif\n\n/*\nauthor: [Morgan McGuire, Kyle Whitson]\ndescription: |\n 3x3 median filter, adapted from "A Fast, Small-Radius GPU Median Filter" \n by Morgan McGuire in ShaderX6 https://casual-effects.com/research/McGuire2008Median/index.html\nuse: median2D_fast5(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n MEDIAN2D_FAST5_TYPE: default vec4\n MEDIAN2D_FAST5_SAMPLER_FNC(POS_UV): default texture2D(tex, POS_UV)\nlicense:\n Copyright (c) Morgan McGuire and Williams College, 2006. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n*/\n\n#ifndef MEDIAN2D_FAST5_TYPE\n#define MEDIAN2D_FAST5_TYPE vec4\n#endif\n\n#ifndef MEDIAN2D_FAST5_SAMPLER_FNC\n#define MEDIAN2D_FAST5_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef MEDIAN_S2\n#define MEDIAN_S2(a, b) temp = a; a = min(a, b); b = max(temp, b);\n#endif\n\n#ifndef MEDIAN_2\n#define MEDIAN_2(a, b) MEDIAN_S2(v[a], v[b]);\n#endif\n\n#ifndef FNC_MEDIAN2D_FAST5\n#define FNC_MEDIAN2D_FAST5\n#define MEDIAN_S2(a, b) temp = a; a = min(a, b); b = max(temp, b);\n#define MEDIAN_2(a, b) MEDIAN_S2(v[a], v[b]);\n\n#define MEDIAN_24(a, b, c, d, e, f, g, h) MEDIAN_2(a, b); MEDIAN_2(c, d); MEDIAN_2(e, f); MEDIAN_2(g, h);\n#define MEDIAN_25(a, b, c, d, e, f, g, h, i, j) MEDIAN_24(a, b, c, d, e, f, g, h); MEDIAN_2(i, j);\n\nMEDIAN2D_FAST5_TYPE median2D_fast5(in sampler2D tex, in vec2 st, in vec2 radius) {\n MEDIAN2D_FAST5_TYPE v[25];\n for (int dX = -2; dX <= 2; ++dX) {\n for (int dY = -2; dY <= 2; ++dY) {\n vec2 offset = vec2(float(dX), float(dY));\n // If a pixel in the window is located at (x+dX, y+dY), put it at index (dX + R)(2R + 1) + (dY + R) of the\n // pixel array. This will fill the pixel array, with the top left pixel of the window at pixel[0] and the\n // bottom right pixel of the window at pixel[N-1].\n v[(dX + 2) * 5 + (dY + 2)] = MEDIAN2D_FAST5_SAMPLER_FNC(st + offset * radius);\n }\n }\n\n MEDIAN2D_FAST5_TYPE temp = MEDIAN2D_FAST5_TYPE(0.);\n MEDIAN_25(0, 1, 3, 4, 2, 4, 2, 3, 6, 7);\n MEDIAN_25(5, 7, 5, 6, 9, 7, 1, 7, 1, 4);\n MEDIAN_25(12, 13, 11, 13, 11, 12, 15, 16, 14, 16);\n MEDIAN_25(14, 15, 18, 19, 17, 19, 17, 18, 21, 22);\n MEDIAN_25(20, 22, 20, 21, 23, 24, 2, 5, 3, 6);\n MEDIAN_25(0, 6, 0, 3, 4, 7, 1, 7, 1, 4);\n MEDIAN_25(11, 14, 8, 14, 8, 11, 12, 15, 9, 15);\n MEDIAN_25(9, 12, 13, 16, 10, 16, 10, 13, 20, 23);\n MEDIAN_25(17, 23, 17, 20, 21, 24, 18, 24, 18, 21);\n MEDIAN_25(19, 22, 8, 17, 9, 18, 0, 18, 0, 9);\n MEDIAN_25(10, 19, 1, 19, 1, 10, 11, 20, 2, 20);\n MEDIAN_25(2, 11, 12, 21, 3, 21, 3, 12, 13, 22);\n MEDIAN_25(4, 22, 4, 13, 14, 23, 5, 23, 5, 14);\n MEDIAN_25(15, 24, 6, 24, 6, 15, 7, 16, 7, 19);\n MEDIAN_25(3, 11, 5, 17, 11, 17, 9, 17, 4, 10);\n MEDIAN_25(6, 12, 7, 14, 4, 6, 4, 7, 12, 14);\n MEDIAN_25(10, 14, 6, 7, 10, 12, 6, 10, 6, 17);\n MEDIAN_25(12, 17, 7, 17, 7, 10, 12, 18, 7, 12);\n MEDIAN_24(10, 18, 12, 20, 10, 20, 10, 12);\n return v[12];\n}\n#endif\n\n\n#ifndef FNC_MEDIAN\n#define FNC_MEDIAN\nMEDIAN_TYPE median3(in sampler2D tex, in vec2 st, in vec2 radius) {\n return median2D_fast3(tex, st, radius);\n}\n\nMEDIAN_TYPE median5(in sampler2D tex, in vec2 st, in vec2 radius) {\n return median2D_fast5(tex, st, radius);\n}\n\nMEDIAN_TYPE median(in sampler2D tex, in vec2 st, in vec2 radius) {\n return MEDIAN_AMOUNT(tex, st, radius);\n}\n#endif\n' | ||
}, | ||
6105: (n) => { | ||
n.exports = | ||
'/*\nauthor: Alan Wolfe\ndescription: white noise blur based on this shader https://www.shadertoy.com/view/XsVBDR\nuse: noiseBlur(<sampler2D> texture, <vec2> st, <vec2> pixel, <float> radius)\noptions:\n NOISEBLUR_TYPE: default to vec3\n NOISEBLUR_GAUSSIAN_K: no gaussian by default\n NOISEBLUR_RANDOM23_FNC(UV): defaults to random2(UV)\n NOISEBLUR_SAMPLE_FNC(UV): defualts to texture2D(tex, UV).rgb\n NOISEBLUR_SAMPLES: default to 4\nlicence: |\n TODO\n*/\n\n#define RANDOM_SCALE3 vec3(443.897, 441.423, .0973)\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: pass a value and get some random normalize value between 0 and 1\nuse: float random[2|3](<float|vec2|vec3> value)\n*/\n\n#ifndef FNC_RANDOM\n#define FNC_RANDOM\nfloat random(in float x) {\n return fract(sin(x) * 43758.5453);\n}\n\nfloat random(in vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nfloat random(in vec3 pos) {\n return fract(sin(dot(pos.xyz, vec3(70.9898, 78.233, 32.4355))) * 43758.5453123);\n}\n\nfloat random(in vec4 pos) {\n float dot_product = dot(pos, vec4(12.9898,78.233,45.164,94.673));\n return fract(sin(dot_product) * 43758.5453);\n}\n\n// Hash function from https://www.shadertoy.com/view/4djSRW\n#ifndef RANDOM_SCALE3\n#define RANDOM_SCALE3 vec3(.1031, .1030, .0973)\n#endif\n\n#ifndef FANDOM_SCALE4\n#define FANDOM_SCALE4 vec4(1031, .1030, .0973, .1099)\n#endif\nvec2 random2(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec2 random2(in vec2 st) {\n const vec2 k = vec2(.3183099, .3678794);\n st = st * k + k.yx;\n return -1. + 2. * fract(16. * k * fract(st.x * st.y * (st.x + st.y)));\n}\n\nvec2 random2(vec3 p3) {\n p3 = fract(p3 * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xx+p3.yz)*p3.zy);\n}\n\nvec3 random3(float p) {\n vec3 p3 = fract(vec3(p) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yzx+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx); \n}\n\nvec3 random3(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * RANDOM_SCALE3);\n p3 += dot(p3, p3.yxz+19.19);\n return fract((p3.xxy+p3.yzz)*p3.zyx);\n}\n\nvec3 random3(in vec3 p) {\n p = vec3( dot(p, vec3(127.1, 311.7, 74.7)),\n dot(p, vec3(269.5, 183.3, 246.1)),\n dot(p, vec3(113.5, 271.9, 124.6)));\n return -1. + 2. * fract(sin(p) * 43758.5453123);\n}\n\nvec4 random4(float p) {\n vec4 p4 = fract(vec4(p) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx); \n}\n\nvec4 random4(vec2 p) {\n vec4 p4 = fract(vec4(p.xyxy) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec3 p) {\n vec4 p4 = fract(vec4(p.xyzx) * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\nvec4 random4(vec4 p4) {\n p4 = fract(p4 * FANDOM_SCALE4);\n p4 += dot(p4, p4.wzxy+19.19);\n return fract((p4.xxyz+p4.yzzw)*p4.zywx);\n}\n\n\n#endif\n\n\n#ifndef NOISEBLUR_SAMPLES\n#define NOISEBLUR_SAMPLES 4\n#endif\n\n#ifndef NOISEBLUR_TYPE\n#define NOISEBLUR_TYPE vec3\n#endif\n\n#ifndef NOISEBLUR_SAMPLE_FNC\n#define NOISEBLUR_SAMPLE_FNC(UV) texture2D(tex, UV).rgb\n#endif\n\n#ifndef NOISEBLUR_RANDOM23_FNC\n#define NOISEBLUR_RANDOM23_FNC(UV) random2(UV)\n#endif\n\n#ifndef FNC_NOISEBLUR\n#define FNC_NOISEBLUR\nNOISEBLUR_TYPE noiseBlur(in sampler2D tex, in vec2 st, in vec2 pixel, float radius) {\n float blurRadius = radius;\n vec2 whiteNoiseUV = st;\n NOISEBLUR_TYPE result = NOISEBLUR_TYPE(0.0);\n for (int i = 0; i < NOISEBLUR_SAMPLES; ++i) {\n vec2 whiteNoiseRand = NOISEBLUR_RANDOM23_FNC(vec3(whiteNoiseUV.xy, float(i)));\n whiteNoiseUV = whiteNoiseRand;\n\n vec2 r = whiteNoiseRand;\n r.x *= TAU;\n \n #if defined(NOISEBLUR_GAUSSIAN_K)\n // box-muller transform to get gaussian distributed sample points in the circle\n vec2 cr = vec2(sin(r.x),cos(r.x))*sqrt(-NOISEBLUR_GAUSSIAN_K * log(r.y));\n #else\n // uniform sample the circle\n vec2 cr = vec2(sin(r.x),cos(r.x))*sqrt(r.y);\n #endif\n \n NOISEBLUR_TYPE color = NOISEBLUR_SAMPLE_FNC( st + cr * blurRadius * pixel );\n // average the samples as we get em\n // https://blog.demofox.org/2016/08/23/incremental-averaging/\n result = mix(result, color, 1.0 / float(i+1));\n }\n return result;\n}\n#endif' | ||
}, | ||
6827: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: make a radial blur, with dir as the direction to the center and strength as the amount\nuse: radialBlur(<sampler2D> texture, <vec2> st, <vec2> dir [, <float> strength] )\noptions:\n RADIALBLUR_KERNELSIZE: Default 64 \n RADIALBLUR_STRENGTH: Default 0.125\n RADIALBLUR_TYPE: Default `vec4`\n RADIALBLUR_SAMPLER_FNC(POS_UV): Default `texture2D(tex, POS_UV)`\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n#ifndef RADIALBLUR_KERNELSIZE\n#define RADIALBLUR_KERNELSIZE 64\n#endif\n\n#ifndef RADIALBLUR_STRENGTH\n#define RADIALBLUR_STRENGTH .125\n#endif\n\n#ifndef RADIALBLUR_TYPE\n#define RADIALBLUR_TYPE vec4\n#endif\n\n#ifndef RADIALBLUR_SAMPLER_FNC\n#define RADIALBLUR_SAMPLER_FNC(POS_UV) texture2D(tex, POS_UV)\n#endif\n\n#ifndef FNC_RADIALBLUR\n#define FNC_RADIALBLUR\nRADIALBLUR_TYPE radialBlur(in sampler2D tex, in vec2 st, in vec2 dir, in float strength) {\n RADIALBLUR_TYPE color = RADIALBLUR_TYPE(0.);\n float f_samples = float(RADIALBLUR_KERNELSIZE);\n float f_factor = 1./f_samples;\n for (int i = 0; i < RADIALBLUR_KERNELSIZE; i += 2) {\n color += RADIALBLUR_SAMPLER_FNC(st + float(i) * f_factor * dir * strength);\n color += RADIALBLUR_SAMPLER_FNC(st + float(i+1) * f_factor * dir * strength);\n }\n return color * f_factor;\n}\n\nRADIALBLUR_TYPE radialBlur(in sampler2D tex, in vec2 st, in vec2 dir) {\n return radialBlur(tex, st, dir, RADIALBLUR_STRENGTH);\n}\n#endif\n' | ||
}, | ||
}, | ||
e = {} | ||
function t(i) { | ||
var o = e[i] | ||
if (void 0 !== o) return o.exports | ||
var A = (e[i] = { exports: {} }) | ||
return n[i](A, A.exports, t), A.exports | ||
} | ||
;(t.d = (n, e) => { | ||
for (var i in e) | ||
t.o(e, i) && | ||
!t.o(n, i) && | ||
Object.defineProperty(n, i, { enumerable: !0, get: e[i] }) | ||
}), | ||
(t.o = (n, e) => Object.prototype.hasOwnProperty.call(n, e)), | ||
(t.r = (n) => { | ||
'undefined' != typeof Symbol && | ||
Symbol.toStringTag && | ||
Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' }), | ||
Object.defineProperty(n, '__esModule', { value: !0 }) | ||
}) | ||
var i = {} | ||
return ( | ||
(() => { | ||
'use strict' | ||
t.r(i), t.d(i, { default: () => n }) | ||
const n = { | ||
bilateralBlur: t(1995), | ||
boxBlur: t(4207), | ||
gaussianBlur: t(548), | ||
mean: t(7030), | ||
median: t(6815), | ||
radialBlur: t(6827), | ||
kuwahara: t(5551), | ||
noiseBlur: t(6105), | ||
} | ||
})(), | ||
i | ||
) | ||
})() | ||
}) |
@@ -1,1 +0,169 @@ | ||
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.lygia=e():n.Lygia=e()}(self,(function(){return(()=>{var n={8236:n=>{n.exports='/*\nauthor: Brad Larson\ndescription: adaptive threshold from https://github.com/BradLarson/GPUImage/blob/master/framework/Source/GPUImageAdaptiveThresholdFilter.m\nuse: adaptiveThreshold(<float> value, <float> blur_value, <float> bias)\nlicense: |\n Copyright (c) 2012, Brad Larson, Ben Cochran, Hugues Lismonde, Keitaroh Kobayashi, Alaric Cole, Matthew Clark, Jacob Gundersen, Chris Williams.\n All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef FNC_ADAPTIVETHRESHOLD\n#define FNC_ADAPTIVETHRESHOLD\nfloat adaptiveThreshold(in float value, in float blur_value, in float bias) {\n return step(blur_value + bias, value);\n}\n\nfloat adaptiveThreshold(in float value, in float blur_value) {\n return step(blur_value - 0.05, value);\n}\n#endif\n'},6951:n=>{n.exports="#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n"},7877:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: decimate a value with an specific presicion \nuse: decimation(<float|vec2|vec3|vec4> value, <float|vec2|vec3|vec4> presicion)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_DECIMATION\n#define FNC_DECIMATION\n#define decimation(value, presicion) (floor(value * presicion)/presicion)\n#endif'},1496:n=>{n.exports="/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: fade\nuse: fade(<vec2|vec3|vec4> t)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_FADE\n#define FNC_FADE\nfloat fade(in float t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec2 fade(in vec2 t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec3 fade(in vec3 t) {\n return t * t * t * (t * (t * 6. - 15. ) + 10.);\n}\n\nvec4 fade(vec4 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n#endif\n"},2381:n=>{n.exports="/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: grad4, used for snoise(vec4 v)\nuse: grad4(<float> j, <vec4> ip)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_GRAD4\n#define FNC_GRAD4\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n#endif\n"},1056:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Squared length\nuse: lengthSq(<vec2|float2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LENGTHSQ\n#define FNC_LENGTHSQ\nfloat lengthSq(in vec2 st) {\n return dot(st, st);\n}\n\nfloat lengthSq(in vec3 pos) {\n return dot(pos, pos);\n}\n#endif\n'},1578:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: clamp a value between 0 and 1\nuse: saturation(<float|vec2|vec3|vec4> value)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_SATURATE\n#define FNC_SATURATE\n// #define saturate(x) clamp(x, 0.0, 1.0)\nfloat saturate( float x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec2 saturate( vec2 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec3 saturate( vec3 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec4 saturate( vec4 x) {\n return clamp(x, 0.0, 1.0);\n}\n#endif\n\n/*\nauthor: Johan Ismael\ndescription: Map a value between one range to another.\nuse: map(<float|vec2|vec3|vec4> value, <float|vec2|vec3|vec4> inMin, <float|vec2|vec3|vec4> inMax, <float|vec2|vec3|vec4> outMin, <float|vec2|vec3|vec4> outMax)\nlicense: |\n Copyright (c) 2017 Johan Ismael.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_MAP\n#define FNC_MAP\n\nfloat map( float value, float inMin, float inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nvec2 map( vec2 value, vec2 inMin, vec2 inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nvec3 map( vec3 value, vec3 inMin, vec3 inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nvec4 map( vec4 value, vec4 inMin, vec4 inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nfloat map(in float value, in float inMin, in float inMax, in float outMin, in float outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\nvec2 map(in vec2 value, in vec2 inMin, in vec2 inMax, in vec2 outMin, in vec2 outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\nvec3 map(in vec3 value, in vec3 inMin, in vec3 inMax, in vec3 outMin, in vec3 outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\nvec4 map(in vec4 value, in vec4 inMin, in vec4 inMax, in vec4 outMin, in vec4 outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\n#endif\n'},4688:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: extend GLSL Max function to add more arguments\nuse: \n - max(<float> A, <float> B, <float> C[, <float> D])\n - max(<vec2|vec3|vec4> A)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_MAX\n#define FNC_MAX\nfloat max(in float a, in float b, in float c) {\n return max(a, max(b, c));\n}\n\nfloat max(in float a, in float b, in float c, in float d) {\n return max(max(a, b), max(c, d));\n}\n\nfloat max(const vec2 v) {\n return max(v.x, v.y);\n}\n\nfloat max(const vec3 v) {\n return max(v.x, v.y, v.z);\n}\n\nfloat max(const vec4 v) {\n return max(v.x, v.y, v.z, v.w);\n}\n#endif\n'},254:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: extend GLSL min function to add more arguments\nuse: \n - min(<float> A, <float> B, <float> C[, <float> D])\n - min(<vec2|vec3|vec4> A)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_MIN\n#define FNC_MIN\nfloat min(in float a, in float b, in float c) {\n return min(a, min(b, c));\n}\n\nfloat min(in float a, in float b, in float c, in float d) {\n return min(min(a,b), min(c, d));\n}\n\nfloat min(const vec2 v) {\n return min(v.x, v.y);\n}\n\nfloat min(const vec3 v) {\n return min(v.x, v.y, v.z);\n}\n\nfloat min(const vec4 v) {\n return min(v.x, v.y, v.z, v.w);\n}\n#endif\n'},5824:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: expands mix to linearly mix more than two values\nuse: mix(<float|vec2|vec3|vec4> a, <float|vec2|vec3|vec4> b, <float|vec2|vec3|vec4> c [, <float|vec2|vec3|vec4> d], <float> pct)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_MIX\n#define FNC_MIX\nfloat mix(float a , float b, float c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec2 mix(vec2 a , vec2 b, vec2 c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec2 mix(vec2 a , vec2 b, vec2 c, vec2 pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec3 mix(vec3 a , vec3 b, vec3 c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec3 mix(vec3 a , vec3 b, vec3 c, vec3 pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec4 mix(vec4 a , vec4 b, vec4 c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec4 mix(vec4 a , vec4 b, vec4 c, vec4 pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nfloat mix(in float a , in float b, in float c, in float d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec2 mix(in vec2 a , in vec2 b, in vec2 c, in vec2 d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec2 mix(in vec2 a , in vec2 b, in vec2 c, in vec2 d, in vec2 pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec3 mix(in vec3 a , in vec3 b, in vec3 c, in vec3 d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec3 mix(in vec3 a , in vec3 b, in vec3 c, in vec3 d, in vec3 pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec4 mix(in vec4 a , in vec4 b, in vec4 c, in vec4 d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec4 mix(in vec4 a , in vec4 b, in vec4 c, in vec4 d, in vec4 pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n#endif\n'},7802:n=>{n.exports="/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n"},1:n=>{n.exports="/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n"},5661:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 2\nuse: pow2(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW2\n#define FNC_POW2\nfloat pow2(in float x) {\n return x * x;\n}\n\nvec2 pow2(in vec2 x) {\n return x * x;\n}\n\nvec3 pow2(in vec3 x) {\n return x * x;\n}\n\nvec4 pow2(in vec4 x) {\n return x * x;\n}\n#endif\n'},1759:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 3\nuse: pow3(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW3\n#define FNC_POW3\nfloat pow3(in float x) {\n return x * x * x;\n}\n\nvec2 pow3(in vec2 x) {\n return x * x * x;\n}\n\nvec3 pow3(in vec3 x) {\n return x * x * x;\n}\n\nvec4 pow3(in vec4 x) {\n return x * x * x;\n}\n#endif\n'},8029:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 5\nuse: pow5(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW5\n#define FNC_POW5\nfloat pow5(in float x) {\n float x2 = x * x;\n return x2 * x2 * x;\n}\n\nvec2 pow5(in vec2 x) {\n vec2 x2 = x * x;\n return x2 * x2 * x;\n}\n\nvec3 pow5(in vec3 x) {\n vec3 x2 = x * x;\n return x2 * x2 * x;\n}\n\nvec4 pow5(in vec4 x) {\n vec4 x2 = x * x;\n return x2 * x2 * x;\n}\n#endif\n'},2257:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 7\nuse: pow7(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW2\n#define FNC_POW2\nfloat pow7(in float x) {\n return x * x * x * x * x * x * x;\n}\n\nvec2 pow7(in vec2 x) {\n return x * x * x * x * x * x * x;\n}\n\nvec3 pow7(in vec3 x) {\n return x * x * x * x * x * x * x;\n}\n\nvec4 pow7(in vec4 x) {\n return x * x * x * x * x * x * x;\n}\n#endif\n'},6398:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: fast approximation to pow()\nuse: powFast(<float> x, <float> exp)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POWFAST\n#define FNC_POWFAST\n\nfloat powFast(float a, float b) {\n return a / ((1. - b) * a + b);\n}\n\n#endif'},2471:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 2x2 rotation matrix\nuse: rotate2d(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE2D\n#define FNC_ROTATE2D\nmat2 rotate2d(in float radians){\n float c = cos(radians);\n float s = sin(radians);\n return mat2(c, -s, s, c);\n}\n#endif\n'},5085:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4d(<vec3> axis, <float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE3D\n#define FNC_ROTATE3D\nmat3 rotate3d(in vec3 axis, in float radians) {\n axis = normalize(axis);\n float s = sin(radians);\n float c = cos(radians);\n float oc = 1.0 - c;\n\n return mat3(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s,\n oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s,\n oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c );\n}\n#endif\n'},3448:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4d(<vec3> axis, <float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4D\n#define FNC_ROTATE4D\nmat4 rotate4d(in vec3 axis, in float radians) {\n axis = normalize(axis);\n float s = sin(radians);\n float c = cos(radians);\n float oc = 1.0 - c;\n\n return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,\n oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,\n oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n#endif\n'},2109:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dX(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DX\n#define FNC_ROTATE4DX\nmat4 rotate4dX(in float phi){\n return mat4(\n vec4(1.,0.,0.,0),\n vec4(0.,cos(phi),-sin(phi),0.),\n vec4(0.,sin(phi),cos(phi),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n'},3538:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dY(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DY\n#define FNC_ROTATE4DY\nmat4 rotate4dY(in float theta){\n return mat4(\n vec4(cos(theta),0.,-sin(theta),0),\n vec4(0.,1.,0.,0.),\n vec4(sin(theta),0.,cos(theta),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n'},3553:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dZ(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DZ\n#define FNC_ROTATE4DZ\nmat4 rotate4dZ(in float psi){\n return mat4(\n vec4(cos(psi),-sin(psi),0.,0),\n vec4(sin(psi),cos(psi),0.,0.),\n vec4(0.,0.,1.,0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n'},4782:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: clamp a value between 0 and 1\nuse: saturation(<float|vec2|vec3|vec4> value)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_SATURATE\n#define FNC_SATURATE\n// #define saturate(x) clamp(x, 0.0, 1.0)\nfloat saturate( float x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec2 saturate( vec2 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec3 saturate( vec3 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec4 saturate( vec4 x) {\n return clamp(x, 0.0, 1.0);\n}\n#endif'},608:n=>{n.exports="/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif"}},e={};function t(i){var o=e[i];if(void 0!==o)return o.exports;var a=e[i]={exports:{}};return n[i](a,a.exports,t),a.exports}t.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return t.d(e,{a:e}),e},t.d=(n,e)=>{for(var i in e)t.o(e,i)&&!t.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:e[i]})},t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),t.r=n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var i={};return(()=>{"use strict";t.r(i),t.d(i,{default:()=>k});var n=t(8236),e=t.n(n),o=t(1056),a=t.n(o),r=t(7802),s=t.n(r),c=t(2257),T=t.n(c),O=t(2109),E=t.n(O),I=t(6951),R=t.n(I),N=t(1578),l=t.n(N),A=t(1),f=t.n(A),d=t(6398),S=t.n(d),h=t(3538),u=t.n(h),p=t(7877),x=t.n(p),m=t(4688),v=t.n(m),H=t(5661),L=t.n(H),C=t(2471),F=t.n(C),b=t(3553),w=t.n(b),D=t(1496),M=t.n(D),P=t(254),g=t.n(P),y=t(1759),W=t.n(y),U=t(5085),G=t.n(U),Y=t(4782),B=t.n(Y),z=t(2381),V=t.n(z),_=t(5824),X=t.n(_),j=t(8029),K=t.n(j),q=t(3448),Q=t.n(q),J=t(608),Z=t.n(J);const k={adaptiveThreshold:e(),lengthSq:a(),mod289:s(),pow7:T(),rotate4dX:E(),consts:R(),map:l(),permute:f(),powFast:S(),rotate4dY:u(),decimation:x(),max:v(),pow2:L(),rotate2d:F(),rotate4dZ:w(),fade:M(),min:g(),pow3:W(),rotate3d:G(),saturate:B(),grad4:V(),mix:X(),pow5:K(),rotate4d:Q(),taylorInvSqrt:Z()}})(),i})()})); | ||
!(function (n, e) { | ||
'object' == typeof exports && 'object' == typeof module | ||
? (module.exports = e()) | ||
: 'function' == typeof define && define.amd | ||
? define([], e) | ||
: 'object' == typeof exports | ||
? (exports.lygia = e()) | ||
: (n.Lygia = e()) | ||
})(self, function () { | ||
return (() => { | ||
var n = { | ||
8236: (n) => { | ||
n.exports = | ||
'/*\nauthor: Brad Larson\ndescription: adaptive threshold from https://github.com/BradLarson/GPUImage/blob/master/framework/Source/GPUImageAdaptiveThresholdFilter.m\nuse: adaptiveThreshold(<float> value, <float> blur_value, <float> bias)\nlicense: |\n Copyright (c) 2012, Brad Larson, Ben Cochran, Hugues Lismonde, Keitaroh Kobayashi, Alaric Cole, Matthew Clark, Jacob Gundersen, Chris Williams.\n All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n Neither the name of the GPUImage framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef FNC_ADAPTIVETHRESHOLD\n#define FNC_ADAPTIVETHRESHOLD\nfloat adaptiveThreshold(in float value, in float blur_value, in float bias) {\n return step(blur_value + bias, value);\n}\n\nfloat adaptiveThreshold(in float value, in float blur_value) {\n return step(blur_value - 0.05, value);\n}\n#endif\n' | ||
}, | ||
6951: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n' | ||
}, | ||
7877: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: decimate a value with an specific presicion \nuse: decimation(<float|vec2|vec3|vec4> value, <float|vec2|vec3|vec4> presicion)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_DECIMATION\n#define FNC_DECIMATION\n#define decimation(value, presicion) (floor(value * presicion)/presicion)\n#endif' | ||
}, | ||
1496: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: fade\nuse: fade(<vec2|vec3|vec4> t)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_FADE\n#define FNC_FADE\nfloat fade(in float t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec2 fade(in vec2 t) {\n return t * t * t * (t * (t * 6. - 15.) + 10.);\n}\n\nvec3 fade(in vec3 t) {\n return t * t * t * (t * (t * 6. - 15. ) + 10.);\n}\n\nvec4 fade(vec4 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n#endif\n' | ||
}, | ||
2381: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: grad4, used for snoise(vec4 v)\nuse: grad4(<float> j, <vec4> ip)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_GRAD4\n#define FNC_GRAD4\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n#endif\n' | ||
}, | ||
1056: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Squared length\nuse: lengthSq(<vec2|float2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LENGTHSQ\n#define FNC_LENGTHSQ\nfloat lengthSq(in vec2 st) {\n return dot(st, st);\n}\n\nfloat lengthSq(in vec3 pos) {\n return dot(pos, pos);\n}\n#endif\n' | ||
}, | ||
1578: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: clamp a value between 0 and 1\nuse: saturation(<float|vec2|vec3|vec4> value)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_SATURATE\n#define FNC_SATURATE\n// #define saturate(x) clamp(x, 0.0, 1.0)\nfloat saturate( float x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec2 saturate( vec2 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec3 saturate( vec3 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec4 saturate( vec4 x) {\n return clamp(x, 0.0, 1.0);\n}\n#endif\n\n/*\nauthor: Johan Ismael\ndescription: Map a value between one range to another.\nuse: map(<float|vec2|vec3|vec4> value, <float|vec2|vec3|vec4> inMin, <float|vec2|vec3|vec4> inMax, <float|vec2|vec3|vec4> outMin, <float|vec2|vec3|vec4> outMax)\nlicense: |\n Copyright (c) 2017 Johan Ismael.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_MAP\n#define FNC_MAP\n\nfloat map( float value, float inMin, float inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nvec2 map( vec2 value, vec2 inMin, vec2 inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nvec3 map( vec3 value, vec3 inMin, vec3 inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nvec4 map( vec4 value, vec4 inMin, vec4 inMax ) {\n return saturate( (value-inMin)/(inMax-inMin));\n}\n\nfloat map(in float value, in float inMin, in float inMax, in float outMin, in float outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\nvec2 map(in vec2 value, in vec2 inMin, in vec2 inMax, in vec2 outMin, in vec2 outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\nvec3 map(in vec3 value, in vec3 inMin, in vec3 inMax, in vec3 outMin, in vec3 outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\nvec4 map(in vec4 value, in vec4 inMin, in vec4 inMax, in vec4 outMin, in vec4 outMax) {\n return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);\n}\n\n#endif\n' | ||
}, | ||
4688: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: extend GLSL Max function to add more arguments\nuse: \n - max(<float> A, <float> B, <float> C[, <float> D])\n - max(<vec2|vec3|vec4> A)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_MAX\n#define FNC_MAX\nfloat max(in float a, in float b, in float c) {\n return max(a, max(b, c));\n}\n\nfloat max(in float a, in float b, in float c, in float d) {\n return max(max(a, b), max(c, d));\n}\n\nfloat max(const vec2 v) {\n return max(v.x, v.y);\n}\n\nfloat max(const vec3 v) {\n return max(v.x, v.y, v.z);\n}\n\nfloat max(const vec4 v) {\n return max(v.x, v.y, v.z, v.w);\n}\n#endif\n' | ||
}, | ||
254: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: extend GLSL min function to add more arguments\nuse: \n - min(<float> A, <float> B, <float> C[, <float> D])\n - min(<vec2|vec3|vec4> A)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_MIN\n#define FNC_MIN\nfloat min(in float a, in float b, in float c) {\n return min(a, min(b, c));\n}\n\nfloat min(in float a, in float b, in float c, in float d) {\n return min(min(a,b), min(c, d));\n}\n\nfloat min(const vec2 v) {\n return min(v.x, v.y);\n}\n\nfloat min(const vec3 v) {\n return min(v.x, v.y, v.z);\n}\n\nfloat min(const vec4 v) {\n return min(v.x, v.y, v.z, v.w);\n}\n#endif\n' | ||
}, | ||
5824: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: expands mix to linearly mix more than two values\nuse: mix(<float|vec2|vec3|vec4> a, <float|vec2|vec3|vec4> b, <float|vec2|vec3|vec4> c [, <float|vec2|vec3|vec4> d], <float> pct)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_MIX\n#define FNC_MIX\nfloat mix(float a , float b, float c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec2 mix(vec2 a , vec2 b, vec2 c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec2 mix(vec2 a , vec2 b, vec2 c, vec2 pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec3 mix(vec3 a , vec3 b, vec3 c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec3 mix(vec3 a , vec3 b, vec3 c, vec3 pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec4 mix(vec4 a , vec4 b, vec4 c, float pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nvec4 mix(vec4 a , vec4 b, vec4 c, vec4 pct) {\n return mix(\n mix(a, b, 2. * pct),\n mix(b, c, 2. * (max(pct, .5) - .5)),\n step(.5, pct)\n );\n}\n\nfloat mix(in float a , in float b, in float c, in float d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec2 mix(in vec2 a , in vec2 b, in vec2 c, in vec2 d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec2 mix(in vec2 a , in vec2 b, in vec2 c, in vec2 d, in vec2 pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec3 mix(in vec3 a , in vec3 b, in vec3 c, in vec3 d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec3 mix(in vec3 a , in vec3 b, in vec3 c, in vec3 d, in vec3 pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec4 mix(in vec4 a , in vec4 b, in vec4 c, in vec4 d, in float pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n\nvec4 mix(in vec4 a , in vec4 b, in vec4 c, in vec4 d, in vec4 pct) {\n return mix(\n mix(a, b, 3. * pct),\n mix(b,\n mix( c,\n d,\n 3. * (max(pct, .66) - .66)),\n 3. * (clamp(pct, .33, .66) - .33)\n ),\n step(.33, pct)\n );\n}\n#endif\n' | ||
}, | ||
7802: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n' | ||
}, | ||
1: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: modulus of 289\nuse: mod289(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n#ifndef FNC_MOD289\n#define FNC_MOD289\nfloat mod289(in float x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec2 mod289(in vec2 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec3 mod289(in vec3 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n\nvec4 mod289(in vec4 x) {\n return x - floor(x * (1. / 289.)) * 289.;\n}\n#endif\n\n\n/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: permute\nuse: permute(<float|vec2|vec3|vec4> x)\nlicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_PERMUTE\n#define FNC_PERMUTE\nfloat permute(in float x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n\nvec3 permute(in vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 permute(in vec4 x) {\n return mod289(((x * 34.) + 1.)*x);\n}\n#endif\n' | ||
}, | ||
5661: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 2\nuse: pow2(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW2\n#define FNC_POW2\nfloat pow2(in float x) {\n return x * x;\n}\n\nvec2 pow2(in vec2 x) {\n return x * x;\n}\n\nvec3 pow2(in vec3 x) {\n return x * x;\n}\n\nvec4 pow2(in vec4 x) {\n return x * x;\n}\n#endif\n' | ||
}, | ||
1759: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 3\nuse: pow3(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW3\n#define FNC_POW3\nfloat pow3(in float x) {\n return x * x * x;\n}\n\nvec2 pow3(in vec2 x) {\n return x * x * x;\n}\n\nvec3 pow3(in vec3 x) {\n return x * x * x;\n}\n\nvec4 pow3(in vec4 x) {\n return x * x * x;\n}\n#endif\n' | ||
}, | ||
8029: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 5\nuse: pow5(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW5\n#define FNC_POW5\nfloat pow5(in float x) {\n float x2 = x * x;\n return x2 * x2 * x;\n}\n\nvec2 pow5(in vec2 x) {\n vec2 x2 = x * x;\n return x2 * x2 * x;\n}\n\nvec3 pow5(in vec3 x) {\n vec3 x2 = x * x;\n return x2 * x2 * x;\n}\n\nvec4 pow5(in vec4 x) {\n vec4 x2 = x * x;\n return x2 * x2 * x;\n}\n#endif\n' | ||
}, | ||
2257: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: power of 7\nuse: pow7(<float|vec2|vec3|vec4> x)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POW2\n#define FNC_POW2\nfloat pow7(in float x) {\n return x * x * x * x * x * x * x;\n}\n\nvec2 pow7(in vec2 x) {\n return x * x * x * x * x * x * x;\n}\n\nvec3 pow7(in vec3 x) {\n return x * x * x * x * x * x * x;\n}\n\nvec4 pow7(in vec4 x) {\n return x * x * x * x * x * x * x;\n}\n#endif\n' | ||
}, | ||
6398: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: fast approximation to pow()\nuse: powFast(<float> x, <float> exp)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_POWFAST\n#define FNC_POWFAST\n\nfloat powFast(float a, float b) {\n return a / ((1. - b) * a + b);\n}\n\n#endif' | ||
}, | ||
2471: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 2x2 rotation matrix\nuse: rotate2d(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE2D\n#define FNC_ROTATE2D\nmat2 rotate2d(in float radians){\n float c = cos(radians);\n float s = sin(radians);\n return mat2(c, -s, s, c);\n}\n#endif\n' | ||
}, | ||
5085: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4d(<vec3> axis, <float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE3D\n#define FNC_ROTATE3D\nmat3 rotate3d(in vec3 axis, in float radians) {\n axis = normalize(axis);\n float s = sin(radians);\n float c = cos(radians);\n float oc = 1.0 - c;\n\n return mat3(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s,\n oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s,\n oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c );\n}\n#endif\n' | ||
}, | ||
3448: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4d(<vec3> axis, <float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4D\n#define FNC_ROTATE4D\nmat4 rotate4d(in vec3 axis, in float radians) {\n axis = normalize(axis);\n float s = sin(radians);\n float c = cos(radians);\n float oc = 1.0 - c;\n\n return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,\n oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,\n oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n#endif\n' | ||
}, | ||
2109: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dX(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DX\n#define FNC_ROTATE4DX\nmat4 rotate4dX(in float phi){\n return mat4(\n vec4(1.,0.,0.,0),\n vec4(0.,cos(phi),-sin(phi),0.),\n vec4(0.,sin(phi),cos(phi),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n' | ||
}, | ||
3538: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dY(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DY\n#define FNC_ROTATE4DY\nmat4 rotate4dY(in float theta){\n return mat4(\n vec4(cos(theta),0.,-sin(theta),0),\n vec4(0.,1.,0.,0.),\n vec4(sin(theta),0.,cos(theta),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n' | ||
}, | ||
3553: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dZ(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DZ\n#define FNC_ROTATE4DZ\nmat4 rotate4dZ(in float psi){\n return mat4(\n vec4(cos(psi),-sin(psi),0.,0),\n vec4(sin(psi),cos(psi),0.,0.),\n vec4(0.,0.,1.,0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n' | ||
}, | ||
4782: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: clamp a value between 0 and 1\nuse: saturation(<float|vec2|vec3|vec4> value)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_SATURATE\n#define FNC_SATURATE\n// #define saturate(x) clamp(x, 0.0, 1.0)\nfloat saturate( float x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec2 saturate( vec2 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec3 saturate( vec3 x) {\n return clamp(x, 0.0, 1.0);\n}\n\nvec4 saturate( vec4 x) {\n return clamp(x, 0.0, 1.0);\n}\n#endif' | ||
}, | ||
608: (n) => { | ||
n.exports = | ||
'/*\nauthor: [Ian McEwan, Ashima Arts]\ndescription: \nuse: taylorInvSqrt(<float|vec4> x)\nLicense : |\n Copyright (C) 2011 Ashima Arts. All rights reserved.\n Distributed under the MIT License. See LICENSE file.\n https://github.com/ashima/webgl-noise\n*/\n\n#ifndef FNC_TAYLORINVSQRT\n#define FNC_TAYLORINVSQRT\nfloat taylorInvSqrt(in float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 taylorInvSqrt(in vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif' | ||
}, | ||
}, | ||
e = {} | ||
function t(i) { | ||
var o = e[i] | ||
if (void 0 !== o) return o.exports | ||
var a = (e[i] = { exports: {} }) | ||
return n[i](a, a.exports, t), a.exports | ||
} | ||
;(t.d = (n, e) => { | ||
for (var i in e) | ||
t.o(e, i) && | ||
!t.o(n, i) && | ||
Object.defineProperty(n, i, { enumerable: !0, get: e[i] }) | ||
}), | ||
(t.o = (n, e) => Object.prototype.hasOwnProperty.call(n, e)), | ||
(t.r = (n) => { | ||
'undefined' != typeof Symbol && | ||
Symbol.toStringTag && | ||
Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' }), | ||
Object.defineProperty(n, '__esModule', { value: !0 }) | ||
}) | ||
var i = {} | ||
return ( | ||
(() => { | ||
'use strict' | ||
t.r(i), t.d(i, { default: () => n }) | ||
const n = { | ||
adaptiveThreshold: t(8236), | ||
lengthSq: t(1056), | ||
mod289: t(7802), | ||
pow7: t(2257), | ||
rotate4dX: t(2109), | ||
consts: t(6951), | ||
map: t(1578), | ||
permute: t(1), | ||
powFast: t(6398), | ||
rotate4dY: t(3538), | ||
decimation: t(7877), | ||
max: t(4688), | ||
pow2: t(5661), | ||
rotate2d: t(2471), | ||
rotate4dZ: t(3553), | ||
fade: t(1496), | ||
min: t(254), | ||
pow3: t(1759), | ||
rotate3d: t(5085), | ||
saturate: t(4782), | ||
grad4: t(2381), | ||
mix: t(5824), | ||
pow5: t(8029), | ||
rotate4d: t(3448), | ||
taylorInvSqrt: t(608), | ||
} | ||
})(), | ||
i | ||
) | ||
})() | ||
}) |
@@ -1,1 +0,47 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.lygia=t():e.Lygia=t()}(self,(function(){return(()=>{var e={4324:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Converts a RGB normal map into normal vectors\nuse: normalMap(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n NORMALMAP_Z: Steepness of z before normalization, defaults to .01\n NORMALMAP_SAMPLER_FNC(POS_UV): Function used to sample into the normal map texture, defaults to texture2D(tex,POS_UV).r\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef NORMALMAP_Z\n#define NORMALMAP_Z .01\n#endif\n\n#ifndef NORMALMAP_SAMPLER_FNC\n#define NORMALMAP_SAMPLER_FNC(POS_UV) texture2D(tex,POS_UV).r\n#endif\n\n#ifndef FNC_NORMALMAP\n#define FNC_NORMALMAP\nvec3 normalMap(sampler2D tex, vec2 st, vec2 pixel) {\n float center = NORMALMAP_SAMPLER_FNC(st);\n float topLeft = NORMALMAP_SAMPLER_FNC(st - pixel);\n float left = NORMALMAP_SAMPLER_FNC(st - vec2(pixel.x, .0));\n float bottomLeft = NORMALMAP_SAMPLER_FNC(st + vec2(-pixel.x, pixel.y));\n float top = NORMALMAP_SAMPLER_FNC(st - vec2(.0, pixel.y));\n float bottom = NORMALMAP_SAMPLER_FNC(st + vec2(.0, pixel.y));\n float topRight = NORMALMAP_SAMPLER_FNC(st + vec2(pixel.x, -pixel.y));\n float right = NORMALMAP_SAMPLER_FNC(st + vec2(pixel.x, .0));\n float bottomRight = NORMALMAP_SAMPLER_FNC(st + pixel);\n \n float dX = topRight + 2. * right + bottomRight - topLeft - 2. * left - bottomLeft;\n float dY = bottomLeft + 2. * bottom + bottomRight - topLeft - 2. * top - topRight;\n\n return normalize(vec3(dX, dY, NORMALMAP_Z) );\n}\n#endif'}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,o),r.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";o.r(n),o.d(n,{default:()=>t});var e=o(4324);const t={normalMap:o.n(e)()}})(),n})()})); | ||
!(function (t, e) { | ||
'object' == typeof exports && 'object' == typeof module | ||
? (module.exports = e()) | ||
: 'function' == typeof define && define.amd | ||
? define([], e) | ||
: 'object' == typeof exports | ||
? (exports.lygia = e()) | ||
: (t.Lygia = e()) | ||
})(self, function () { | ||
return (() => { | ||
var t = { | ||
4324: (t) => { | ||
t.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Converts a RGB normal map into normal vectors\nuse: normalMap(<sampler2D> texture, <vec2> st, <vec2> pixel)\noptions:\n NORMALMAP_Z: Steepness of z before normalization, defaults to .01\n NORMALMAP_SAMPLER_FNC(POS_UV): Function used to sample into the normal map texture, defaults to texture2D(tex,POS_UV).r\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef NORMALMAP_Z\n#define NORMALMAP_Z .01\n#endif\n\n#ifndef NORMALMAP_SAMPLER_FNC\n#define NORMALMAP_SAMPLER_FNC(POS_UV) texture2D(tex,POS_UV).r\n#endif\n\n#ifndef FNC_NORMALMAP\n#define FNC_NORMALMAP\nvec3 normalMap(sampler2D tex, vec2 st, vec2 pixel) {\n float center = NORMALMAP_SAMPLER_FNC(st);\n float topLeft = NORMALMAP_SAMPLER_FNC(st - pixel);\n float left = NORMALMAP_SAMPLER_FNC(st - vec2(pixel.x, .0));\n float bottomLeft = NORMALMAP_SAMPLER_FNC(st + vec2(-pixel.x, pixel.y));\n float top = NORMALMAP_SAMPLER_FNC(st - vec2(.0, pixel.y));\n float bottom = NORMALMAP_SAMPLER_FNC(st + vec2(.0, pixel.y));\n float topRight = NORMALMAP_SAMPLER_FNC(st + vec2(pixel.x, -pixel.y));\n float right = NORMALMAP_SAMPLER_FNC(st + vec2(pixel.x, .0));\n float bottomRight = NORMALMAP_SAMPLER_FNC(st + pixel);\n \n float dX = topRight + 2. * right + bottomRight - topLeft - 2. * left - bottomLeft;\n float dY = bottomLeft + 2. * bottom + bottomRight - topLeft - 2. * top - topRight;\n\n return normalize(vec3(dX, dY, NORMALMAP_Z) );\n}\n#endif' | ||
}, | ||
}, | ||
e = {} | ||
function o(n) { | ||
var i = e[n] | ||
if (void 0 !== i) return i.exports | ||
var r = (e[n] = { exports: {} }) | ||
return t[n](r, r.exports, o), r.exports | ||
} | ||
;(o.d = (t, e) => { | ||
for (var n in e) | ||
o.o(e, n) && | ||
!o.o(t, n) && | ||
Object.defineProperty(t, n, { enumerable: !0, get: e[n] }) | ||
}), | ||
(o.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e)), | ||
(o.r = (t) => { | ||
'undefined' != typeof Symbol && | ||
Symbol.toStringTag && | ||
Object.defineProperty(t, Symbol.toStringTag, { value: 'Module' }), | ||
Object.defineProperty(t, '__esModule', { value: !0 }) | ||
}) | ||
var n = {} | ||
return ( | ||
(() => { | ||
'use strict' | ||
o.r(n), o.d(n, { default: () => t }) | ||
const t = { normalMap: o(4324) } | ||
})(), | ||
n | ||
) | ||
})() | ||
}) |
@@ -1,1 +0,104 @@ | ||
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.lygia=e():n.Lygia=e()}(self,(function(){return(()=>{var n={7899:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a circle-shaped SDF.\nuse: circleSDF(vec2 st[, vec2 center])\noptions:\n CIRCLESDF_FNC(POS_UV) : function used to calculate the SDF, defaults to GLSL length function, use lengthSq for a different slope\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef CIRCLESDF_FNC\n#define CIRCLESDF_FNC(POS_UV) length(POS_UV)\n#endif\n\n#ifndef FNC_CIRCLESDF\n#define FNC_CIRCLESDF\n\nfloat circleSDF(in vec2 st, in vec2 center) {\n return CIRCLESDF_FNC(st - center) * 2.;\n}\n\nfloat circleSDF(in vec2 st) {\n return circleSDF(st, vec2(.5));\n}\n\n#endif\n'},2092:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a rectangular SDF\nuse: rectSDF(<vec2> st, <vec2> size)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_RECTSDF\n#define FNC_RECTSDF\nfloat rectSDF(in vec2 st, in vec2 s) {\n st = st * 2. - 1.;\n return max( abs(st.x / s.x),\n abs(st.y / s.y) );\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a cross-shaped SDF\nuse: crossSDF(<vec2> st, size s)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_CROSSSDF\n#define FNC_CROSSSDF\nfloat crossSDF(in vec2 st, in float s) {\n vec2 size = vec2(.25, s);\n return min(rectSDF(st.xy, size.xy),\n rectSDF(st.xy, size.yx));\n}\n#endif\n'},9023:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a flower shaped SDF\nuse: flowerSDF(<vec2> st, <int> n_sides)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_FLOWERSDF\n#define FNC_FLOWERSDF\nfloat flowerSDF(vec2 st, int N) {\n st = st * 2.0 - 1.0;\n float r = length(st) * 2.0;\n float a = atan(st.y, st.x);\n float v = float(N) * 0.5;\n return 1.0 - (abs(cos(a * v)) * 0.5 + 0.5) / r;\n}\n#endif'},6881:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a heart shaped SDF\nuse: heartSDF(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_HEARTSDF\n#define FNC_HEARTSDF\nfloat heartSDF(vec2 st) {\n st -= vec2(0.5, 0.8);\n float r = length(st) * 5.0;\n st = normalize(st);\n return r - ((st.y * pow(abs(st.x), 0.67)) / (st.y + 1.5) - (2.0) * st.y + 1.26);\n}\n#endif'},9455:n=>{n.exports='/*\\\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a hexagon-shaped SDF\nuse: hexSDF(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_HEXSDF\n#define FNC_HEXSDF\nfloat hexSDF(in vec2 st) {\n st = abs(st * 2. - 1.);\n return max(abs(st.y), st.x * .866025 + st.y * .5);\n}\n#endif\n'},6223:n=>{n.exports='#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a sdf for a regular polygon with V sides.\nuse: polySDF(<vec2> st, int V)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_POLYSDF\n#define FNC_POLYSDF\nfloat polySDF(in vec2 st, in int V) {\n st = st * 2. - 1.;\n float a = atan(st.x, st.y) + PI;\n float r = length(st);\n float v = TAU / float(V);\n return cos(floor(.5 + a / v) * v - a ) * r;\n}\n#endif\n'},122:n=>{n.exports='#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a sdf for rays with N branches\nuse: raysSDF(<vec2> st, <int> N)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_RAYSSDF\n#define FNC_RAYSSDF\nfloat raysSDF(in vec2 st, in int N) {\n st -= .5;\n return fract(atan(st.y, st.x) / TAU * float(N));\n}\n#endif\n'},2704:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a rectangular SDF\nuse: rectSDF(<vec2> st, <vec2> size)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_RECTSDF\n#define FNC_RECTSDF\nfloat rectSDF(in vec2 st, in vec2 s) {\n st = st * 2. - 1.;\n return max( abs(st.x / s.x),\n abs(st.y / s.y) );\n}\n#endif\n'},4260:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a spiral SDF\nuse: spiralSDF(<vec2> st, <float> turns)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_SPIRALSDF\n#define FNC_SPIRALSDF\nfloat spiralSDF(vec2 st, float t) {\n st -= 0.5;\n float r = dot(st, st);\n float a = atan(st.y, st.x);\n return abs(sin(fract(log(r) * t + a * 0.159)));\n}\n#endif'},3433:n=>{n.exports='#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a star-shaped sdf with V branches\nuse: starSDF(<vec2> st, <int> V, <float> scale)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_STARSDF\n#define FNC_STARSDF\nfloat starSDF(in vec2 st, in int V, in float s) {\n st = st * 4. - 2.;\n float a = atan(st.y, st.x) / TAU;\n float seg = a * float(V);\n a = ((floor(seg) + .5) / float(V) +\n mix(s, -s, step(.5, fract(seg))))\n * TAU;\n return abs(dot(vec2(cos(a), sin(a)),\n st));\n}\n#endif\n'},5866:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a triangle-shaped sdf\nuse: triSDF(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_TRISDF\n#define FNC_TRISDF\nfloat triSDF(in vec2 st) {\n st = (st * 2. - 1.) * 2.;\n return max(abs(st.x) * .866025 + st.y * .5, -st.y * .5);\n}\n#endif\n'},2838:n=>{n.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a circle-shaped SDF.\nuse: circleSDF(vec2 st[, vec2 center])\noptions:\n CIRCLESDF_FNC(POS_UV) : function used to calculate the SDF, defaults to GLSL length function, use lengthSq for a different slope\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef CIRCLESDF_FNC\n#define CIRCLESDF_FNC(POS_UV) length(POS_UV)\n#endif\n\n#ifndef FNC_CIRCLESDF\n#define FNC_CIRCLESDF\n\nfloat circleSDF(in vec2 st, in vec2 center) {\n return CIRCLESDF_FNC(st - center) * 2.;\n}\n\nfloat circleSDF(in vec2 st) {\n return circleSDF(st, vec2(.5));\n}\n\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns an almond-shaped sdf\nuse: vesicaSDF(<vec2> st, <float> w)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_VESICASDF\n#define FNC_VESICASDF\nfloat vesicaSDF(in vec2 st, in float w) {\n vec2 offset = vec2(w*.5,0.);\n return max( circleSDF(st-offset),\n circleSDF(st+offset));\n}\n#endif\n'}},e={};function i(t){var r=e[t];if(void 0!==r)return r.exports;var s=e[t]={exports:{}};return n[t](s,s.exports,i),s.exports}i.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return i.d(e,{a:e}),e},i.d=(n,e)=>{for(var t in e)i.o(e,t)&&!i.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},i.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),i.r=n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var t={};return(()=>{"use strict";i.r(t),i.d(t,{default:()=>L});var n=i(7899),e=i.n(n),r=i(9023),s=i.n(r),o=i(9455),f=i.n(o),a=i(122),c=i.n(a),d=i(4260),l=i.n(d),S=i(5866),D=i.n(S),u=i(2092),v=i.n(u),F=i(6881),p=i.n(F),N=i(6223),h=i.n(N),C=i(2704),P=i.n(C),_=i(3433),E=i.n(_),z=i(2838),I=i.n(z);const L={circleSDF:e(),flowerSDF:s(),hexSDF:f(),raysSDF:c(),spiralSDF:l(),triSDF:D(),crossSDF:v(),heartSDF:p(),polySDF:h(),rectSDF:P(),starSDF:E(),vesicaSDF:I()}})(),t})()})); | ||
!(function (n, e) { | ||
'object' == typeof exports && 'object' == typeof module | ||
? (module.exports = e()) | ||
: 'function' == typeof define && define.amd | ||
? define([], e) | ||
: 'object' == typeof exports | ||
? (exports.lygia = e()) | ||
: (n.Lygia = e()) | ||
})(self, function () { | ||
return (() => { | ||
var n = { | ||
7899: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a circle-shaped SDF.\nuse: circleSDF(vec2 st[, vec2 center])\noptions:\n CIRCLESDF_FNC(POS_UV) : function used to calculate the SDF, defaults to GLSL length function, use lengthSq for a different slope\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef CIRCLESDF_FNC\n#define CIRCLESDF_FNC(POS_UV) length(POS_UV)\n#endif\n\n#ifndef FNC_CIRCLESDF\n#define FNC_CIRCLESDF\n\nfloat circleSDF(in vec2 st, in vec2 center) {\n return CIRCLESDF_FNC(st - center) * 2.;\n}\n\nfloat circleSDF(in vec2 st) {\n return circleSDF(st, vec2(.5));\n}\n\n#endif\n' | ||
}, | ||
2092: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a rectangular SDF\nuse: rectSDF(<vec2> st, <vec2> size)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_RECTSDF\n#define FNC_RECTSDF\nfloat rectSDF(in vec2 st, in vec2 s) {\n st = st * 2. - 1.;\n return max( abs(st.x / s.x),\n abs(st.y / s.y) );\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a cross-shaped SDF\nuse: crossSDF(<vec2> st, size s)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_CROSSSDF\n#define FNC_CROSSSDF\nfloat crossSDF(in vec2 st, in float s) {\n vec2 size = vec2(.25, s);\n return min(rectSDF(st.xy, size.xy),\n rectSDF(st.xy, size.yx));\n}\n#endif\n' | ||
}, | ||
9023: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a flower shaped SDF\nuse: flowerSDF(<vec2> st, <int> n_sides)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_FLOWERSDF\n#define FNC_FLOWERSDF\nfloat flowerSDF(vec2 st, int N) {\n st = st * 2.0 - 1.0;\n float r = length(st) * 2.0;\n float a = atan(st.y, st.x);\n float v = float(N) * 0.5;\n return 1.0 - (abs(cos(a * v)) * 0.5 + 0.5) / r;\n}\n#endif' | ||
}, | ||
6881: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a heart shaped SDF\nuse: heartSDF(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_HEARTSDF\n#define FNC_HEARTSDF\nfloat heartSDF(vec2 st) {\n st -= vec2(0.5, 0.8);\n float r = length(st) * 5.0;\n st = normalize(st);\n return r - ((st.y * pow(abs(st.x), 0.67)) / (st.y + 1.5) - (2.0) * st.y + 1.26);\n}\n#endif' | ||
}, | ||
9455: (n) => { | ||
n.exports = | ||
'/*\\\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a hexagon-shaped SDF\nuse: hexSDF(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_HEXSDF\n#define FNC_HEXSDF\nfloat hexSDF(in vec2 st) {\n st = abs(st * 2. - 1.);\n return max(abs(st.y), st.x * .866025 + st.y * .5);\n}\n#endif\n' | ||
}, | ||
6223: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a sdf for a regular polygon with V sides.\nuse: polySDF(<vec2> st, int V)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_POLYSDF\n#define FNC_POLYSDF\nfloat polySDF(in vec2 st, in int V) {\n st = st * 2. - 1.;\n float a = atan(st.x, st.y) + PI;\n float r = length(st);\n float v = TAU / float(V);\n return cos(floor(.5 + a / v) * v - a ) * r;\n}\n#endif\n' | ||
}, | ||
122: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a sdf for rays with N branches\nuse: raysSDF(<vec2> st, <int> N)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_RAYSSDF\n#define FNC_RAYSSDF\nfloat raysSDF(in vec2 st, in int N) {\n st -= .5;\n return fract(atan(st.y, st.x) / TAU * float(N));\n}\n#endif\n' | ||
}, | ||
2704: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a rectangular SDF\nuse: rectSDF(<vec2> st, <vec2> size)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_RECTSDF\n#define FNC_RECTSDF\nfloat rectSDF(in vec2 st, in vec2 s) {\n st = st * 2. - 1.;\n return max( abs(st.x / s.x),\n abs(st.y / s.y) );\n}\n#endif\n' | ||
}, | ||
4260: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a spiral SDF\nuse: spiralSDF(<vec2> st, <float> turns)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_SPIRALSDF\n#define FNC_SPIRALSDF\nfloat spiralSDF(vec2 st, float t) {\n st -= 0.5;\n float r = dot(st, st);\n float a = atan(st.y, st.x);\n return abs(sin(fract(log(r) * t + a * 0.159)));\n}\n#endif' | ||
}, | ||
3433: (n) => { | ||
n.exports = | ||
'#ifndef QTR_PI\n#define QTR_PI 0.78539816339\n#endif\n#ifndef HALF_PI\n#define HALF_PI 1.5707963267948966192313216916398\n#endif\n#ifndef PI\n#define PI 3.1415926535897932384626433832795\n#endif\n#ifndef TWO_PI\n#define TWO_PI 6.2831853071795864769252867665590\n#endif\n#ifndef TAU\n#define TAU 6.2831853071795864769252867665590\n#endif\n#ifndef ONE_OVER_PI\n#define ONE_OVER_PI 0.31830988618\n#endif\n#ifndef PHI\n#define PHI 1.618033988749894848204586834\n#endif\n#ifndef EPSILON\n#define EPSILON 0.0000001\n#endif\n#ifndef GOLDEN_RATIO\n#define GOLDEN_RATIO 1.6180339887\n#endif\n#ifndef GOLDEN_RATIO_CONJUGATE \n#define GOLDEN_RATIO_CONJUGATE 0.61803398875\n#endif\n#ifndef GOLDEN_ANGLE // (3.-sqrt(5.0))*PI radians\n#define GOLDEN_ANGLE 2.39996323\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a star-shaped sdf with V branches\nuse: starSDF(<vec2> st, <int> V, <float> scale)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_STARSDF\n#define FNC_STARSDF\nfloat starSDF(in vec2 st, in int V, in float s) {\n st = st * 4. - 2.;\n float a = atan(st.y, st.x) / TAU;\n float seg = a * float(V);\n a = ((floor(seg) + .5) / float(V) +\n mix(s, -s, step(.5, fract(seg))))\n * TAU;\n return abs(dot(vec2(cos(a), sin(a)),\n st));\n}\n#endif\n' | ||
}, | ||
5866: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a triangle-shaped sdf\nuse: triSDF(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_TRISDF\n#define FNC_TRISDF\nfloat triSDF(in vec2 st) {\n st = (st * 2. - 1.) * 2.;\n return max(abs(st.x) * .866025 + st.y * .5, -st.y * .5);\n}\n#endif\n' | ||
}, | ||
2838: (n) => { | ||
n.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns a circle-shaped SDF.\nuse: circleSDF(vec2 st[, vec2 center])\noptions:\n CIRCLESDF_FNC(POS_UV) : function used to calculate the SDF, defaults to GLSL length function, use lengthSq for a different slope\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef CIRCLESDF_FNC\n#define CIRCLESDF_FNC(POS_UV) length(POS_UV)\n#endif\n\n#ifndef FNC_CIRCLESDF\n#define FNC_CIRCLESDF\n\nfloat circleSDF(in vec2 st, in vec2 center) {\n return CIRCLESDF_FNC(st - center) * 2.;\n}\n\nfloat circleSDF(in vec2 st) {\n return circleSDF(st, vec2(.5));\n}\n\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: Returns an almond-shaped sdf\nuse: vesicaSDF(<vec2> st, <float> w)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo. All rights reserved.\n Distributed under BSD 3-clause "New" or "Revised" License. See LICENSE file at\n https://github.com/patriciogonzalezvivo/PixelSpiritDeck\n*/\n\n#ifndef FNC_VESICASDF\n#define FNC_VESICASDF\nfloat vesicaSDF(in vec2 st, in float w) {\n vec2 offset = vec2(w*.5,0.);\n return max( circleSDF(st-offset),\n circleSDF(st+offset));\n}\n#endif\n' | ||
}, | ||
}, | ||
e = {} | ||
function i(t) { | ||
var s = e[t] | ||
if (void 0 !== s) return s.exports | ||
var r = (e[t] = { exports: {} }) | ||
return n[t](r, r.exports, i), r.exports | ||
} | ||
;(i.d = (n, e) => { | ||
for (var t in e) | ||
i.o(e, t) && | ||
!i.o(n, t) && | ||
Object.defineProperty(n, t, { enumerable: !0, get: e[t] }) | ||
}), | ||
(i.o = (n, e) => Object.prototype.hasOwnProperty.call(n, e)), | ||
(i.r = (n) => { | ||
'undefined' != typeof Symbol && | ||
Symbol.toStringTag && | ||
Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' }), | ||
Object.defineProperty(n, '__esModule', { value: !0 }) | ||
}) | ||
var t = {} | ||
return ( | ||
(() => { | ||
'use strict' | ||
i.r(t), i.d(t, { default: () => n }) | ||
const n = { | ||
circleSDF: i(7899), | ||
flowerSDF: i(9023), | ||
hexSDF: i(9455), | ||
raysSDF: i(122), | ||
spiralSDF: i(4260), | ||
triSDF: i(5866), | ||
crossSDF: i(2092), | ||
heartSDF: i(6881), | ||
polySDF: i(6223), | ||
rectSDF: i(2704), | ||
starSDF: i(3433), | ||
vesicaSDF: i(2838), | ||
} | ||
})(), | ||
t | ||
) | ||
})() | ||
}) |
@@ -1,1 +0,84 @@ | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.lygia=n():e.Lygia=n()}(self,(function(){return(()=>{var e={7225:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Flip Y axis\nuse: flipY(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_FLIPY\n#define FNC_FLIPY\nvec2 flipY(in vec2 st) {\n return vec2(st.x, 1. - st.y);\n}\n#endif\n'},7358:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: linearize depth\nuse: linearizeDepth(<float> depth, <float> near, <float> far)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LINEARIZE_DEPTH\n#define FNC_LINEARIZE_DEPTH\n\nfloat linearizeDepth(float depth, float near, float far) {\n depth = 2.0 * depth - 1.0;\n return (2.0 * near) / (far + near - depth * (far - near));\n}\n\n#endif'},9357:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: Fix the aspect ratio of a space keeping things squared for you.\nuse: ratio(vec2 st, vec2 st_size)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_RATIO\n#define FNC_RATIO\nvec2 ratio(in vec2 st, in vec2 s) {\n return mix( vec2((st.x*s.x/s.y)-(s.x*.5-s.y*.5)/s.y,st.y),\n vec2(st.x,st.y*(s.y/s.x)-(s.y*.5-s.x*.5)/s.x),\n step(s.x,s.y));\n}\n#endif\n'},1904:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 2x2 rotation matrix\nuse: rotate2d(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE2D\n#define FNC_ROTATE2D\nmat2 rotate2d(in float radians){\n float c = cos(radians);\n float s = sin(radians);\n return mat2(c, -s, s, c);\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4d(<vec3> axis, <float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4D\n#define FNC_ROTATE4D\nmat4 rotate4d(in vec3 axis, in float radians) {\n axis = normalize(axis);\n float s = sin(radians);\n float c = cos(radians);\n float oc = 1.0 - c;\n\n return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,\n oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,\n oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian radians\nuse: rotate(<vec3|vec2> st, float radians [, vec2 center])\noptions:\n - CENTER_2D\n - CENTER_3D\n - CENTER_4D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATE\n#define FNC_ROTATE\nvec2 rotate(in vec2 st, in float radians, in vec2 center) {\n return rotate2d(radians) * (st - center) + center;\n}\n\nvec2 rotate(in vec2 st, in float radians) {\n #ifdef CENTER_2D\n return rotate(st, radians, CENTER_2D);\n #else\n return rotate(st, radians, vec2(.5));\n #endif\n}\n\nvec3 rotate(in vec3 xyz, in float radians, in vec3 axis, in vec3 center) {\n return (rotate4d(axis, radians) * vec4(xyz - center, 1.)).xyz + center;\n}\n\nvec3 rotate(in vec3 xyz, in float radians, in vec3 axis) {\n #ifdef CENTER_3D\n return rotate(xyz, radians, axis, CENTER_3D);\n #else\n return rotate(xyz, radians, axis, vec3(0.));\n #endif\n}\n\nvec4 rotate(in vec4 xyzw, in float radians, in vec3 axis, in vec4 center) {\n return rotate4d(axis, radians) * (xyzw - center) + center;\n}\n\nvec4 rotate(in vec4 xyzw, in float radians, in vec3 axis) {\n #ifdef CENTER_4D\n return rotate(xyzw, radians, axis, CENTER_4D);\n #else\n return rotate(xyzw, radians, axis, vec4(0.));\n #endif\n}\n#endif\n'},8535:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dX(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DX\n#define FNC_ROTATE4DX\nmat4 rotate4dX(in float phi){\n return mat4(\n vec4(1.,0.,0.,0),\n vec4(0.,cos(phi),-sin(phi),0.),\n vec4(0.,sin(phi),cos(phi),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian angle\nuse: rotateX(<vec3|vec4> pos, float radian [, vec3 center])\noptions:\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATEX\n#define FNC_ROTATEX\nvec3 rotateX(in vec3 pos, in float radian, in vec3 center) {\n return (rotate4dX(radian) * vec4(pos - center, 1.)).xyz + center;\n}\n\nvec3 rotateX(in vec3 pos, in float radian) {\n #ifdef CENTER_3D\n return rotateX(pos, radian, CENTER_3D);\n #else\n return rotateX(pos, radian, vec3(.0));\n #endif\n}\n#endif\n'},5422:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dY(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DY\n#define FNC_ROTATE4DY\nmat4 rotate4dY(in float theta){\n return mat4(\n vec4(cos(theta),0.,-sin(theta),0),\n vec4(0.,1.,0.,0.),\n vec4(sin(theta),0.,cos(theta),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian angle\nuse: rotateY(<vec3> pos, float radian [, vec4 center])\noptions:\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATEY\n#define FNC_ROTATEY\nvec3 rotateY(in vec3 pos, in float radian, in vec3 center) {\n return (rotate4dY(radian) * vec4((pos - center), 1.)).xyz + center;\n}\n\nvec3 rotateY(in vec3 pos, in float radian) {\n #ifdef CENTER_3D\n return rotateY(pos, radian, CENTER_3D);\n #else\n return rotateY(pos, radian, vec3(.0));\n #endif\n}\n#endif\n'},9174:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dZ(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DZ\n#define FNC_ROTATE4DZ\nmat4 rotate4dZ(in float psi){\n return mat4(\n vec4(cos(psi),-sin(psi),0.,0),\n vec4(sin(psi),cos(psi),0.,0.),\n vec4(0.,0.,1.,0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n\n\n/*\nfunction: rotateZ\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian angle\nuse: rotateZ(<vec3|vec4> pos, float radian [, vec3 center])\noptions:\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATEZ\n#define FNC_ROTATEZ\nvec3 rotateZ(in vec3 pos, in float radian, in vec3 center) {\n return (rotate4dZ(radian) * vec4(pos - center, 0.) ).xyz + center;\n}\n\nvec3 rotateZ(in vec3 pos, in float radian) {\n #ifdef CENTER_3D\n return rotateZ(pos, radian, CENTER_3D);\n #else\n return rotateZ(pos, radian, vec3(.0));\n #endif\n}\n#endif\n'},8457:e=>{e.exports='/*\nauthor: Patricio Gonzalez Vivo\ndescription: scale a 2D space variable\nuse: scale(<vec2> st, <vec2|float> scale_factor [, <vec2> center])\noptions:\n - CENTER\n - CENTER_2D\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_SCALE\n#define FNC_SCALE\nfloat scale(in float st, in float s, in float center) {\n return (st - center) * s + center;\n}\n\nfloat scale(in float st, in float s) {\n #ifdef CENTER_2D\n return scale(st, s, CENTER);\n #else\n return scale(st, s, .5);\n #endif\n}\n\n\nvec2 scale(in vec2 st, in vec2 s, in vec2 center) {\n return (st - center) * s + center;\n}\n\nvec2 scale(in vec2 st, in float value, in vec2 center) {\n return scale(st, vec2(value), center);\n}\n\nvec2 scale(in vec2 st, in vec2 s) {\n #ifdef CENTER_2D\n return scale(st, s, CENTER_2D);\n #else\n return scale(st, s, vec2(.5));\n #endif\n}\n\nvec2 scale(in vec2 st, in float value) {\n return scale(st, vec2(value));\n}\n\nvec3 scale(in vec3 st, in vec3 s, in vec3 center) {\n return (st - center) * s + center;\n}\n\nvec3 scale(in vec3 st, in float value, in vec3 center) {\n return scale(st, vec3(value), center);\n}\n\nvec3 scale(in vec3 st, in vec3 s) {\n #ifdef CENTER_3D\n return scale(st, s, CENTER_3D);\n #else\n return scale(st, s, vec3(.5));\n #endif\n}\n\nvec3 scale(in vec3 st, in float value) {\n return scale(st, vec3(value));\n}\n#endif\n'}},n={};function t(i){var o=n[i];if(void 0!==o)return o.exports;var a=n[i]={exports:{}};return e[i](a,a.exports,t),a.exports}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";t.r(i),t.d(i,{default:()=>f});var e=t(7225),n=t.n(e),o=t(9357),a=t.n(o),s=t(1904),r=t.n(s),T=t(8535),E=t.n(T),c=t(5422),O=t.n(c),R=t(9174),I=t.n(R),N=t(8457),A=t.n(N),d=t(7358),l=t.n(d);const f={flipY:n(),ratio:a(),rotate:r(),rotateX:E(),rotateY:O(),rotateZ:I(),scale:A(),linearizeDepth:l()}})(),i})()})); | ||
!(function (e, n) { | ||
'object' == typeof exports && 'object' == typeof module | ||
? (module.exports = n()) | ||
: 'function' == typeof define && define.amd | ||
? define([], n) | ||
: 'object' == typeof exports | ||
? (exports.lygia = n()) | ||
: (e.Lygia = n()) | ||
})(self, function () { | ||
return (() => { | ||
var e = { | ||
7225: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Flip Y axis\nuse: flipY(<vec2> st)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_FLIPY\n#define FNC_FLIPY\nvec2 flipY(in vec2 st) {\n return vec2(st.x, 1. - st.y);\n}\n#endif\n' | ||
}, | ||
7358: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: linearize depth\nuse: linearizeDepth(<float> depth, <float> near, <float> far)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_LINEARIZE_DEPTH\n#define FNC_LINEARIZE_DEPTH\n\nfloat linearizeDepth(float depth, float near, float far) {\n depth = 2.0 * depth - 1.0;\n return (2.0 * near) / (far + near - depth * (far - near));\n}\n\n#endif' | ||
}, | ||
9357: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: Fix the aspect ratio of a space keeping things squared for you.\nuse: ratio(vec2 st, vec2 st_size)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_RATIO\n#define FNC_RATIO\nvec2 ratio(in vec2 st, in vec2 s) {\n return mix( vec2((st.x*s.x/s.y)-(s.x*.5-s.y*.5)/s.y,st.y),\n vec2(st.x,st.y*(s.y/s.x)-(s.y*.5-s.x*.5)/s.x),\n step(s.x,s.y));\n}\n#endif\n' | ||
}, | ||
1904: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 2x2 rotation matrix\nuse: rotate2d(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE2D\n#define FNC_ROTATE2D\nmat2 rotate2d(in float radians){\n float c = cos(radians);\n float s = sin(radians);\n return mat2(c, -s, s, c);\n}\n#endif\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4d(<vec3> axis, <float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4D\n#define FNC_ROTATE4D\nmat4 rotate4d(in vec3 axis, in float radians) {\n axis = normalize(axis);\n float s = sin(radians);\n float c = cos(radians);\n float oc = 1.0 - c;\n\n return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,\n oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,\n oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian radians\nuse: rotate(<vec3|vec2> st, float radians [, vec2 center])\noptions:\n - CENTER_2D\n - CENTER_3D\n - CENTER_4D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATE\n#define FNC_ROTATE\nvec2 rotate(in vec2 st, in float radians, in vec2 center) {\n return rotate2d(radians) * (st - center) + center;\n}\n\nvec2 rotate(in vec2 st, in float radians) {\n #ifdef CENTER_2D\n return rotate(st, radians, CENTER_2D);\n #else\n return rotate(st, radians, vec2(.5));\n #endif\n}\n\nvec3 rotate(in vec3 xyz, in float radians, in vec3 axis, in vec3 center) {\n return (rotate4d(axis, radians) * vec4(xyz - center, 1.)).xyz + center;\n}\n\nvec3 rotate(in vec3 xyz, in float radians, in vec3 axis) {\n #ifdef CENTER_3D\n return rotate(xyz, radians, axis, CENTER_3D);\n #else\n return rotate(xyz, radians, axis, vec3(0.));\n #endif\n}\n\nvec4 rotate(in vec4 xyzw, in float radians, in vec3 axis, in vec4 center) {\n return rotate4d(axis, radians) * (xyzw - center) + center;\n}\n\nvec4 rotate(in vec4 xyzw, in float radians, in vec3 axis) {\n #ifdef CENTER_4D\n return rotate(xyzw, radians, axis, CENTER_4D);\n #else\n return rotate(xyzw, radians, axis, vec4(0.));\n #endif\n}\n#endif\n' | ||
}, | ||
8535: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dX(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DX\n#define FNC_ROTATE4DX\nmat4 rotate4dX(in float phi){\n return mat4(\n vec4(1.,0.,0.,0),\n vec4(0.,cos(phi),-sin(phi),0.),\n vec4(0.,sin(phi),cos(phi),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian angle\nuse: rotateX(<vec3|vec4> pos, float radian [, vec3 center])\noptions:\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATEX\n#define FNC_ROTATEX\nvec3 rotateX(in vec3 pos, in float radian, in vec3 center) {\n return (rotate4dX(radian) * vec4(pos - center, 1.)).xyz + center;\n}\n\nvec3 rotateX(in vec3 pos, in float radian) {\n #ifdef CENTER_3D\n return rotateX(pos, radian, CENTER_3D);\n #else\n return rotateX(pos, radian, vec3(.0));\n #endif\n}\n#endif\n' | ||
}, | ||
5422: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dY(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DY\n#define FNC_ROTATE4DY\nmat4 rotate4dY(in float theta){\n return mat4(\n vec4(cos(theta),0.,-sin(theta),0),\n vec4(0.,1.,0.,0.),\n vec4(sin(theta),0.,cos(theta),0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n\n\n/*\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian angle\nuse: rotateY(<vec3> pos, float radian [, vec4 center])\noptions:\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATEY\n#define FNC_ROTATEY\nvec3 rotateY(in vec3 pos, in float radian, in vec3 center) {\n return (rotate4dY(radian) * vec4((pos - center), 1.)).xyz + center;\n}\n\nvec3 rotateY(in vec3 pos, in float radian) {\n #ifdef CENTER_3D\n return rotateY(pos, radian, CENTER_3D);\n #else\n return rotateY(pos, radian, vec3(.0));\n #endif\n}\n#endif\n' | ||
}, | ||
9174: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: returns a 4x4 rotation matrix\nuse: rotate4dZ(<float> radians)\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\n*/\n\n#ifndef FNC_ROTATE4DZ\n#define FNC_ROTATE4DZ\nmat4 rotate4dZ(in float psi){\n return mat4(\n vec4(cos(psi),-sin(psi),0.,0),\n vec4(sin(psi),cos(psi),0.,0.),\n vec4(0.,0.,1.,0.),\n vec4(0.,0.,0.,1.));\n}\n#endif\n\n\n/*\nfunction: rotateZ\nauthor: Patricio Gonzalez Vivo\ndescription: rotate a 2D space by a radian angle\nuse: rotateZ(<vec3|vec4> pos, float radian [, vec3 center])\noptions:\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_ROTATEZ\n#define FNC_ROTATEZ\nvec3 rotateZ(in vec3 pos, in float radian, in vec3 center) {\n return (rotate4dZ(radian) * vec4(pos - center, 0.) ).xyz + center;\n}\n\nvec3 rotateZ(in vec3 pos, in float radian) {\n #ifdef CENTER_3D\n return rotateZ(pos, radian, CENTER_3D);\n #else\n return rotateZ(pos, radian, vec3(.0));\n #endif\n}\n#endif\n' | ||
}, | ||
8457: (e) => { | ||
e.exports = | ||
'/*\nauthor: Patricio Gonzalez Vivo\ndescription: scale a 2D space variable\nuse: scale(<vec2> st, <vec2|float> scale_factor [, <vec2> center])\noptions:\n - CENTER\n - CENTER_2D\n - CENTER_3D\nlicense: |\n Copyright (c) 2017 Patricio Gonzalez Vivo.\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n*/\n\n#ifndef FNC_SCALE\n#define FNC_SCALE\nfloat scale(in float st, in float s, in float center) {\n return (st - center) * s + center;\n}\n\nfloat scale(in float st, in float s) {\n #ifdef CENTER_2D\n return scale(st, s, CENTER);\n #else\n return scale(st, s, .5);\n #endif\n}\n\n\nvec2 scale(in vec2 st, in vec2 s, in vec2 center) {\n return (st - center) * s + center;\n}\n\nvec2 scale(in vec2 st, in float value, in vec2 center) {\n return scale(st, vec2(value), center);\n}\n\nvec2 scale(in vec2 st, in vec2 s) {\n #ifdef CENTER_2D\n return scale(st, s, CENTER_2D);\n #else\n return scale(st, s, vec2(.5));\n #endif\n}\n\nvec2 scale(in vec2 st, in float value) {\n return scale(st, vec2(value));\n}\n\nvec3 scale(in vec3 st, in vec3 s, in vec3 center) {\n return (st - center) * s + center;\n}\n\nvec3 scale(in vec3 st, in float value, in vec3 center) {\n return scale(st, vec3(value), center);\n}\n\nvec3 scale(in vec3 st, in vec3 s) {\n #ifdef CENTER_3D\n return scale(st, s, CENTER_3D);\n #else\n return scale(st, s, vec3(.5));\n #endif\n}\n\nvec3 scale(in vec3 st, in float value) {\n return scale(st, vec3(value));\n}\n#endif\n' | ||
}, | ||
}, | ||
n = {} | ||
function t(i) { | ||
var o = n[i] | ||
if (void 0 !== o) return o.exports | ||
var a = (n[i] = { exports: {} }) | ||
return e[i](a, a.exports, t), a.exports | ||
} | ||
;(t.d = (e, n) => { | ||
for (var i in n) | ||
t.o(n, i) && | ||
!t.o(e, i) && | ||
Object.defineProperty(e, i, { enumerable: !0, get: n[i] }) | ||
}), | ||
(t.o = (e, n) => Object.prototype.hasOwnProperty.call(e, n)), | ||
(t.r = (e) => { | ||
'undefined' != typeof Symbol && | ||
Symbol.toStringTag && | ||
Object.defineProperty(e, Symbol.toStringTag, { value: 'Module' }), | ||
Object.defineProperty(e, '__esModule', { value: !0 }) | ||
}) | ||
var i = {} | ||
return ( | ||
(() => { | ||
'use strict' | ||
t.r(i), t.d(i, { default: () => e }) | ||
const e = { | ||
flipY: t(7225), | ||
ratio: t(9357), | ||
rotate: t(1904), | ||
rotateX: t(8535), | ||
rotateY: t(5422), | ||
rotateZ: t(9174), | ||
scale: t(8457), | ||
linearizeDepth: t(7358), | ||
} | ||
})(), | ||
i | ||
) | ||
})() | ||
}) |
@@ -9,2 +9,3 @@ import bilateralBlur from './bilateralBlur.glsl' | ||
import noiseBlur from './noiseBlur.glsl' | ||
import laplacian from './filter/laplacian.glsl' | ||
@@ -20,2 +21,3 @@ export default { | ||
noiseBlur, | ||
laplacian, | ||
} |
22
index.js
@@ -1,11 +0,11 @@ | ||
export { default as animation } from './animation' | ||
export { default as color } from './color' | ||
export { default as distort } from './distort' | ||
export { default as draw } from './draw' | ||
export { default as filter } from './filter' | ||
export { default as generative } from './generative' | ||
export { default as math } from './math' | ||
export { default as operation } from './operation' | ||
export { default as sdf } from './sdf' | ||
export { default as space } from './space' | ||
export { default as sample } from './sample' | ||
export { default as animation } from './animation/index.js' | ||
export { default as color } from './color/index.js' | ||
export { default as distort } from './distort/index.js' | ||
export { default as draw } from './draw/index.js' | ||
export { default as filter } from './filter/index.js' | ||
export { default as generative } from './generative/index.js' | ||
export { default as math } from './math/index.js' | ||
export { default as operation } from './operation/index.js' | ||
export { default as sdf } from './sdf/index.js' | ||
export { default as space } from './space/index.js' | ||
export { default as sample } from './sample/index.js' |
@@ -26,2 +26,3 @@ import adaptiveThreshold from './adaptiveThreshold.glsl' | ||
import taylorInvSqrt from './taylorInvSqrt.glsl' | ||
import absi from './absi.glsl' | ||
@@ -36,2 +37,3 @@ export default { | ||
map, | ||
absi, | ||
permute, | ||
@@ -38,0 +40,0 @@ powFast, |
{ | ||
"name": "lygia", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "lygia, it's a granular and multi-language shader library designed for performance and flexibility", | ||
@@ -9,2 +9,3 @@ "main": "dist/umd/lygia.main.js", | ||
"module": "dist/module/lygia.main.js", | ||
"type": "module", | ||
"scripts": { | ||
@@ -11,0 +12,0 @@ "build": "rm -rf dist/* && webpack", |
@@ -13,2 +13,3 @@ import circleSDF from './circleSDF.glsl' | ||
import vesicaSDF from './vesicaSDF.glsl' | ||
import rhombSDF from './rhombSDF.glsl' | ||
@@ -28,2 +29,3 @@ export default { | ||
vesicaSDF, | ||
rhombSDF, | ||
} |
@@ -1,2 +0,3 @@ | ||
const path = require('path') | ||
import path from 'path' | ||
const __dirname = path.resolve() | ||
@@ -29,3 +30,2 @@ const config = { | ||
} | ||
const targetModule = { | ||
@@ -53,6 +53,5 @@ output: { | ||
} | ||
module.exports = [ | ||
export default [ | ||
Object.assign({}, config, targetUmd), | ||
Object.assign({}, config, targetModule), | ||
] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2601999
324
10606
Yes
1