@paper-design/shaders 0.0.25 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/get-shader-color-from-string.d.ts +1 -1
  2. package/dist/get-shader-color-from-string.js +93 -0
  3. package/dist/get-shader-color-from-string.js.map +7 -0
  4. package/dist/get-shader-noise-texture.d.ts +1 -0
  5. package/dist/get-shader-noise-texture.js +23 -0
  6. package/dist/get-shader-noise-texture.js.map +7 -0
  7. package/dist/index.d.ts +30 -16
  8. package/dist/index.js +96 -1315
  9. package/dist/index.js.map +4 -4
  10. package/dist/shader-color-spaces.d.ts +6 -0
  11. package/dist/shader-color-spaces.js +96 -0
  12. package/dist/shader-color-spaces.js.map +7 -0
  13. package/dist/shader-mount.d.ts +48 -17
  14. package/dist/shader-mount.js +568 -0
  15. package/dist/shader-mount.js.map +7 -0
  16. package/dist/shader-sizing.d.ts +35 -0
  17. package/dist/shader-sizing.js +196 -0
  18. package/dist/shader-sizing.js.map +7 -0
  19. package/dist/shader-utils.d.ts +5 -0
  20. package/dist/shader-utils.js +59 -0
  21. package/dist/shader-utils.js.map +7 -0
  22. package/dist/shaders/dithering.d.ts +47 -0
  23. package/dist/shaders/dithering.js +197 -0
  24. package/dist/shaders/dithering.js.map +7 -0
  25. package/dist/shaders/dot-grid.d.ts +33 -20
  26. package/dist/shaders/dot-grid.js +100 -0
  27. package/dist/shaders/dot-grid.js.map +7 -0
  28. package/dist/shaders/dot-orbit.d.ts +27 -18
  29. package/dist/shaders/dot-orbit.js +120 -0
  30. package/dist/shaders/dot-orbit.js.map +7 -0
  31. package/dist/shaders/god-rays.d.ts +35 -26
  32. package/dist/shaders/god-rays.js +134 -0
  33. package/dist/shaders/god-rays.js.map +7 -0
  34. package/dist/shaders/grain-gradient.d.ts +25 -0
  35. package/dist/shaders/grain-gradient.js +219 -0
  36. package/dist/shaders/grain-gradient.js.map +7 -0
  37. package/dist/shaders/liquid-metal.d.ts +19 -0
  38. package/dist/shaders/liquid-metal.js +224 -0
  39. package/dist/shaders/liquid-metal.js.map +7 -0
  40. package/dist/shaders/mesh-gradient.d.ts +23 -13
  41. package/dist/shaders/mesh-gradient.js +97 -0
  42. package/dist/shaders/mesh-gradient.js.map +7 -0
  43. package/dist/shaders/metaballs.d.ts +22 -15
  44. package/dist/shaders/metaballs.js +108 -0
  45. package/dist/shaders/metaballs.js.map +7 -0
  46. package/dist/shaders/neuro-noise.d.ts +13 -8
  47. package/dist/shaders/neuro-noise.js +66 -0
  48. package/dist/shaders/neuro-noise.js.map +7 -0
  49. package/dist/shaders/perlin-noise.d.ts +26 -15
  50. package/dist/shaders/perlin-noise.js +193 -0
  51. package/dist/shaders/perlin-noise.js.map +7 -0
  52. package/dist/shaders/pulsing-border.d.ts +54 -0
  53. package/dist/shaders/pulsing-border.js +218 -0
  54. package/dist/shaders/pulsing-border.js.map +7 -0
  55. package/dist/shaders/simplex-noise.d.ts +29 -0
  56. package/dist/shaders/simplex-noise.js +103 -0
  57. package/dist/shaders/simplex-noise.js.map +7 -0
  58. package/dist/shaders/smoke-ring.d.ts +34 -12
  59. package/dist/shaders/smoke-ring.js +141 -0
  60. package/dist/shaders/smoke-ring.js.map +7 -0
  61. package/dist/shaders/spiral.d.ts +28 -18
  62. package/dist/shaders/spiral.js +75 -0
  63. package/dist/shaders/spiral.js.map +7 -0
  64. package/dist/shaders/swirl.d.ts +26 -0
  65. package/dist/shaders/swirl.js +80 -0
  66. package/dist/shaders/swirl.js.map +7 -0
  67. package/dist/shaders/voronoi.d.ts +39 -29
  68. package/dist/shaders/voronoi.js +143 -0
  69. package/dist/shaders/voronoi.js.map +7 -0
  70. package/dist/shaders/warp.d.ts +43 -32
  71. package/dist/shaders/warp.js +124 -0
  72. package/dist/shaders/warp.js.map +7 -0
  73. package/dist/shaders/waves.d.ts +25 -15
  74. package/dist/shaders/waves.js +60 -0
  75. package/dist/shaders/waves.js.map +7 -0
  76. package/dist/types.d.ts +3 -0
  77. package/dist/types.js +6 -0
  78. package/dist/types.js.map +7 -0
  79. package/package.json +2 -1
  80. package/dist/get-shader-color-from-string.test.d.ts +0 -1
  81. package/dist/shaders/stepped-simplex-noise.d.ts +0 -24
package/dist/index.js CHANGED
@@ -1,1316 +1,97 @@
1
- /***** Paper Shaders: https://github.com/paper-design/shaders *****/
2
- function y(o){return"paperShaderMount"in o}var x=class{mountToDiv;canvas;gl;program=null;uniformLocations={};fragmentShader;rafId=null;lastRenderTime=0;totalFrameTime=0;speed=0;providedUniforms;hasBeenDisposed=!1;resolutionChanged=!0;textures=new Map;maxResolution=0;constructor(e,t,r={},i,a=0,s=0,u=1920){let n=document.createElement("canvas");e.style.contain="strict",e.style.position="relative",n.style.position="absolute",n.style.inset="0",n.style.zIndex="-1",n.style.width="100%",n.style.height="100%",this.canvas=n,this.mountToDiv=e,e.appendChild(n),this.fragmentShader=t,this.providedUniforms=r,this.totalFrameTime=s,this.maxResolution=u;let l=n.getContext("webgl2",i);if(!l)throw new Error("WebGL not supported");this.gl=l,this.initProgram(),this.setupPositionAttribute(),this.setupUniforms(),this.setUniformValues(this.providedUniforms),this.setupResizeObserver(),this.setSpeed(a),this.canvas.setAttribute("data-paper-shaders","true"),this.mountToDiv.paperShaderMount=this}initProgram=()=>{let e=R(this.gl,S,this.fragmentShader);e&&(this.program=e)};setupPositionAttribute=()=>{let e=this.gl.getAttribLocation(this.program,"a_position"),t=this.gl.createBuffer();this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t);let r=[-1,-1,1,-1,-1,1,-1,1,1,-1,1,1];this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array(r),this.gl.STATIC_DRAW),this.gl.enableVertexAttribArray(e),this.gl.vertexAttribPointer(e,2,this.gl.FLOAT,!1,0,0)};setupUniforms=()=>{let e={u_time:this.gl.getUniformLocation(this.program,"u_time"),u_pixelRatio:this.gl.getUniformLocation(this.program,"u_pixelRatio"),u_resolution:this.gl.getUniformLocation(this.program,"u_resolution")};Object.entries(this.providedUniforms).forEach(([t,r])=>{if(e[t]=this.gl.getUniformLocation(this.program,t),r instanceof HTMLImageElement){let i=`${t}_aspect_ratio`;e[i]=this.gl.getUniformLocation(this.program,i)}}),this.uniformLocations=e};resizeObserver=null;setupResizeObserver=()=>{this.resizeObserver=new ResizeObserver(()=>this.handleResize()),this.resizeObserver.observe(this.mountToDiv),this.handleResize()};renderScale=1;handleResize=()=>{let e=this.mountToDiv.clientWidth,t=this.mountToDiv.clientHeight,r=this.maxResolution,i=Math.max(2,window.devicePixelRatio);this.renderScale=Math.min(1,r/Math.max(e,t))*i;let a=e*this.renderScale,s=t*this.renderScale;(this.canvas.width!==a||this.canvas.height!==s)&&(this.canvas.width=a,this.canvas.height=s,this.resolutionChanged=!0,this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.render(performance.now()))};render=e=>{if(this.hasBeenDisposed)return;if(this.program===null){console.warn("Tried to render before program or gl was initialized");return}let t=e-this.lastRenderTime;this.lastRenderTime=e,this.speed!==0&&(this.totalFrameTime+=t*this.speed),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.useProgram(this.program),this.gl.uniform1f(this.uniformLocations.u_time,this.totalFrameTime*.001),this.resolutionChanged&&(this.gl.uniform2f(this.uniformLocations.u_resolution,this.gl.canvas.width,this.gl.canvas.height),this.gl.uniform1f(this.uniformLocations.u_pixelRatio,this.renderScale),this.resolutionChanged=!1),this.gl.drawArrays(this.gl.TRIANGLES,0,6),this.speed!==0?this.requestRender():this.rafId=null};requestRender=()=>{this.rafId!==null&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(this.render)};setTextureUniform=(e,t)=>{if(!t.complete||t.naturalWidth===0)throw new Error(`Image for uniform ${e} must be fully loaded`);let r=this.textures.get(e);r&&this.gl.deleteTexture(r);let i=this.gl.createTexture();this.gl.bindTexture(this.gl.TEXTURE_2D,i),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,t);let a=this.gl.getError();if(a!==this.gl.NO_ERROR||i===null){console.error("WebGL error when uploading texture:",a);return}this.textures.set(e,i);let s=this.uniformLocations[e];if(s){let u=this.textures.size-1;this.gl.useProgram(this.program),this.gl.activeTexture(this.gl.TEXTURE0+u),this.gl.bindTexture(this.gl.TEXTURE_2D,i),this.gl.uniform1i(s,u);let n=`${e}_aspect_ratio`,l=this.uniformLocations[n];if(l){let m=t.naturalWidth/t.naturalHeight;this.gl.uniform1f(l,m)}}};setUniformValues=e=>{this.gl.useProgram(this.program),Object.entries(e).forEach(([t,r])=>{let i=this.uniformLocations[t];if(!i){console.warn(`Uniform location for ${t} not found`);return}if(r instanceof HTMLImageElement)this.setTextureUniform(t,r);else if(Array.isArray(r))switch(r.length){case 2:this.gl.uniform2fv(i,r);break;case 3:this.gl.uniform3fv(i,r);break;case 4:this.gl.uniform4fv(i,r);break;default:r.length===9?this.gl.uniformMatrix3fv(i,!1,r):r.length===16?this.gl.uniformMatrix4fv(i,!1,r):console.warn(`Unsupported uniform array length: ${r.length}`)}else typeof r=="number"?this.gl.uniform1f(i,r):typeof r=="boolean"?this.gl.uniform1i(i,r?1:0):console.warn(`Unsupported uniform type for ${t}: ${typeof r}`)})};getCurrentFrameTime=()=>this.totalFrameTime;setFrame=e=>{this.totalFrameTime=e,this.lastRenderTime=performance.now(),this.render(performance.now())};setSpeed=(e=1)=>{this.speed=e,this.rafId===null&&e!==0&&(this.lastRenderTime=performance.now(),this.rafId=requestAnimationFrame(this.render)),this.rafId!==null&&e===0&&(cancelAnimationFrame(this.rafId),this.rafId=null)};setUniforms=e=>{this.providedUniforms={...this.providedUniforms,...e},this.setUniformValues(e),this.render(performance.now())};dispose=()=>{this.hasBeenDisposed=!0,this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.gl&&this.program&&(this.textures.forEach(e=>{this.gl.deleteTexture(e)}),this.textures.clear(),this.gl.deleteProgram(this.program),this.program=null,this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,null),this.gl.bindRenderbuffer(this.gl.RENDERBUFFER,null),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),this.gl.getError()),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.uniformLocations={},this.mountToDiv.paperShaderMount=void 0}},S=`#version 300 es
3
- layout(location = 0) in vec4 a_position;
4
-
5
- void main() {
6
- gl_Position = a_position;
7
- }
8
- `;function b(o,e,t){let r=o.createShader(e);return r?(o.shaderSource(r,t),o.compileShader(r),o.getShaderParameter(r,o.COMPILE_STATUS)?r:(console.error("An error occurred compiling the shaders: "+o.getShaderInfoLog(r)),o.deleteShader(r),null)):null}function R(o,e,t){let r=b(o,o.VERTEX_SHADER,e),i=b(o,o.FRAGMENT_SHADER,t);if(!r||!i)return null;let a=o.createProgram();return a?(o.attachShader(a,r),o.attachShader(a,i),o.linkProgram(a),o.getProgramParameter(a,o.LINK_STATUS)?(o.detachShader(a,r),o.detachShader(a,i),o.deleteShader(r),o.deleteShader(i),a):(console.error("Unable to initialize the shader program: "+o.getProgramInfoLog(a)),o.deleteProgram(a),o.deleteShader(r),o.deleteShader(i),null)):null}var w=`#version 300 es
9
- precision highp float;
10
-
11
- uniform float u_pixelRatio;
12
- uniform vec2 u_resolution;
13
- uniform float u_time;
14
-
15
- uniform vec4 u_color1;
16
- uniform vec4 u_color2;
17
- uniform vec4 u_color3;
18
- uniform vec4 u_color4;
19
-
20
- out vec4 fragColor;
21
-
22
- #define S(a,b,t) smoothstep(a,b,t)
23
-
24
- mat2 Rot(float a) {
25
- float s = sin(a);
26
- float c = cos(a);
27
- return mat2(c, -s, s, c);
28
- }
29
-
30
- vec2 hash(vec2 p) {
31
- vec3 p3 = fract(vec3(p.xyx) * vec3(.1031, .1030, .0973));
32
- p3 += dot(p3, p3.yzx + 33.33);
33
- return fract((p3.xx+p3.yz)*p3.zy);
34
- }
35
-
36
- float noise( in vec2 p ) {
37
- vec2 i = floor( p );
38
- vec2 f = fract( p );
39
- vec2 u = f*f*(3.0-2.0*f);
40
-
41
- float n = mix( mix( dot( -1.0+2.0*hash( i + vec2(0.0,0.0) ), f - vec2(0.0,0.0) ),
42
- dot( -1.0+2.0*hash( i + vec2(1.0,0.0) ), f - vec2(1.0,0.0) ), u.x),
43
- mix( dot( -1.0+2.0*hash( i + vec2(0.0,1.0) ), f - vec2(0.0,1.0) ),
44
- dot( -1.0+2.0*hash( i + vec2(1.0,1.0) ), f - vec2(1.0,1.0) ), u.x), u.y);
45
- return 0.5 + 0.5*n;
46
- }
47
-
48
-
49
- void main() {
50
- vec2 uv = gl_FragCoord.xy / u_resolution.xy;
51
- float ratio = u_resolution.x / u_resolution.y;
52
-
53
- uv /= u_pixelRatio;
54
-
55
- vec2 tuv = uv;
56
- tuv -= .5;
57
-
58
- // rotate with Noise
59
- float degree = noise(vec2(u_time, tuv.x * tuv.y));
60
-
61
- tuv.y *= 1./ratio;
62
- tuv *= Rot(radians((degree-.5)*720.+180.));
63
- tuv.y *= ratio;
64
-
65
-
66
- // Wave warp with sin
67
- float frequency = 5.;
68
- float amplitude = 30.;
69
- float speed = u_time * 2.;
70
- tuv.x += sin(tuv.y*frequency+speed)/amplitude;
71
- tuv.y += sin(tuv.x*frequency*1.5+speed)/(amplitude*.5);
72
-
73
-
74
- float proportion_1 = S(-.3, .2, (tuv*Rot(radians(-5.))).x);
75
- vec3 layer1_color = mix(u_color1.rgb * u_color1.a, u_color2.rgb * u_color2.a, proportion_1);
76
- float layer1_opacity = mix(u_color1.a, u_color2.a, proportion_1);
77
- vec3 layer2_color = mix(u_color3.rgb * u_color3.a, u_color4.rgb * u_color4.a, proportion_1);
78
- float layer2_opacity = mix(u_color3.a, u_color4.a, proportion_1);
79
-
80
- float proportion_2 = S(.5, -.3, tuv.y);
81
- vec3 color = mix(layer1_color, layer2_color, proportion_2);
82
- float opacity = mix(layer1_opacity, layer2_opacity, proportion_2);
83
-
84
- fragColor = vec4(color, opacity);
85
- }
86
- `;var z=`#version 300 es
87
- precision highp float;
88
-
89
- uniform float u_pixelRatio;
90
- uniform vec2 u_resolution;
91
- uniform float u_time;
92
-
93
- uniform float u_scale;
94
-
95
- uniform vec4 u_colorInner;
96
- uniform vec4 u_colorOuter;
97
- uniform float u_noiseScale;
98
- uniform float u_thickness;
99
-
100
- out vec4 fragColor;
101
-
102
- #define TWO_PI 6.28318530718
103
- #define PI 3.14159265358979323846
104
-
105
- float random(in vec2 st) {
106
- return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453123);
107
- }
108
- float noise(vec2 st) {
109
- vec2 i = floor(st);
110
- vec2 f = fract(st);
111
- float a = random(i);
112
- float b = random(i + vec2(1.0, 0.0));
113
- float c = random(i + vec2(0.0, 1.0));
114
- float d = random(i + vec2(1.0, 1.0));
115
-
116
- // Smoothstep for interpolation
117
- vec2 u = f * f * (3.0 - 2.0 * f);
118
-
119
- // Do the interpolation as two nested mix operations
120
- // If you try to do this in one big operation, there's enough precision loss to be off by 1px at cell boundaries
121
- float x1 = mix(a, b, u.x);
122
- float x2 = mix(c, d, u.x);
123
- return mix(x1, x2, u.y);
124
-
125
- }
126
- float fbm(in vec2 n) {
127
- float total = 0.0, amplitude = .4;
128
- for (int i = 0; i < 12; i++) {
129
- total += noise(n) * amplitude;
130
- n += n;
131
- amplitude *= 0.6;
132
- }
133
- return total;
134
- }
135
-
136
- float get_ring_shape(vec2 uv, float innerRadius, float outerRadius) {
137
- float distance = length(uv);
138
- float line_width = outerRadius - innerRadius;
139
- float ringValue = smoothstep(innerRadius, innerRadius + .8 * line_width, distance);
140
- ringValue -= smoothstep(outerRadius, outerRadius + 1.2 * line_width, distance);
141
- return clamp(ringValue, 0., 1.);
142
- }
143
-
144
- void main() {
145
- vec2 uv = gl_FragCoord.xy / u_resolution.xy;
146
- float ratio = u_resolution.x / u_resolution.y;
147
-
148
- uv -= .5;
149
- float scale = .5 * u_scale + 1e-4;
150
- uv *= (1. - step(1. - scale, 1.) / scale);
151
- uv *= 1.5;
152
- uv.x *= ratio;
153
-
154
- float t = u_time;
155
-
156
- float atg = atan(uv.y, uv.x);
157
- float angle = (atg + PI) / TWO_PI;
158
-
159
- vec2 polar_uv = vec2(atg, .1 * t - (.5 * length(uv)) + 1. / pow(length(uv), .5));
160
- polar_uv *= u_noiseScale;
161
-
162
- float noise_left = fbm(polar_uv + mod(.05 * t, 35.));
163
- polar_uv.x = mod(polar_uv.x, u_noiseScale * TWO_PI);
164
- float noise_right = fbm(polar_uv + mod(.05 * t, 35.));
165
- float noise = mix(noise_right, noise_left, smoothstep(-.2, .2, uv.x));
166
-
167
- float center_shape = 1. - pow(smoothstep(2., .0, length(uv)), 50.);
168
-
169
- float radius = .4 - .25 * u_thickness;
170
- float thickness = u_thickness;
171
- thickness = pow(thickness, 2.);
172
-
173
- float ring_shape = get_ring_shape(uv * (.5 + .6 * noise), radius - .2 * thickness, radius + .5 * thickness);
174
-
175
- float ring_shape_outer = 1. - pow(ring_shape, 7.);
176
- ring_shape_outer *= ring_shape;
177
-
178
- float ring_shape_inner = ring_shape - ring_shape_outer;
179
- ring_shape_inner *= ring_shape;
180
-
181
- float opacity = ring_shape_inner * u_colorInner.a;
182
- opacity += ring_shape_outer * u_colorOuter.a;
183
-
184
- vec3 color = u_colorOuter.rgb * ring_shape_outer * u_colorOuter.a;
185
- color += u_colorInner.rgb * ring_shape_inner * u_colorInner.a;
186
-
187
- fragColor = vec4(color, opacity);
188
- }
189
- `;var C=`#version 300 es
190
- precision highp float;
191
-
192
- uniform float u_time;
193
- uniform float u_pixelRatio;
194
- uniform vec2 u_resolution;
195
-
196
- uniform float u_scale;
197
- uniform vec4 u_colorFront;
198
- uniform vec4 u_colorBack;
199
- uniform float u_brightness;
200
-
201
- out vec4 fragColor;
202
-
203
- vec2 rotate(vec2 uv, float th) {
204
- return mat2(cos(th), sin(th), -sin(th), cos(th)) * uv;
205
- }
206
-
207
- float neuro_shape(vec2 uv, float t) {
208
- vec2 sine_acc = vec2(0.);
209
- vec2 res = vec2(0.);
210
- float scale = 8.;
211
-
212
- for (int j = 0; j < 15; j++) {
213
- uv = rotate(uv, 1.);
214
- sine_acc = rotate(sine_acc, 1.);
215
- vec2 layer = uv * scale + float(j) + sine_acc - t;
216
- sine_acc += sin(layer);
217
- res += (.5 + .5 * cos(layer)) / scale;
218
- scale *= (1.2);
219
- }
220
- return res.x + res.y;
221
- }
222
-
223
- void main() {
224
- vec2 uv = gl_FragCoord.xy / u_resolution.xy;
225
-
226
- uv -= .5;
227
- float scale = .5 * u_scale + 1e-4;
228
- uv *= (.001 * (1. - step(1. - scale, 1.) / scale));
229
- uv *= u_resolution;
230
- uv /= u_pixelRatio;
231
- uv += .5;
232
-
233
- float t = u_time;
234
-
235
- float noise = neuro_shape(uv, t);
236
-
237
- noise = u_brightness * pow(noise, 3.);
238
- noise += pow(noise, 12.);
239
- noise = max(.0, noise - .5);
240
-
241
- vec3 color = mix(u_colorBack.rgb * u_colorBack.a, u_colorFront.rgb * u_colorFront.a, noise);
242
- float opacity = mix(u_colorBack.a, u_colorFront.a, noise);
243
-
244
- fragColor = vec4(color, opacity);
245
- }
246
- `;var T=`#version 300 es
247
- precision highp float;
248
-
249
- uniform float u_time;
250
- uniform float u_pixelRatio;
251
- uniform vec2 u_resolution;
252
-
253
- uniform float u_scale;
254
- uniform vec4 u_color1;
255
- uniform vec4 u_color2;
256
- uniform vec4 u_color3;
257
- uniform vec4 u_color4;
258
- uniform float u_dotSize;
259
- uniform float u_dotSizeRange;
260
- uniform float u_spreading;
261
-
262
- out vec4 fragColor;
263
-
264
- #define TWO_PI 6.28318530718
265
-
266
- float random(in vec2 st) {
267
- return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453123);
268
- }
269
- vec2 random2(vec2 p) {
270
- return vec2(random(p), random(200. * p));
271
- }
272
-
273
- vec3 get_voronoi_shape(vec2 _uv, float time) {
274
- vec2 i_uv = floor(_uv);
275
- vec2 f_uv = fract(_uv);
276
-
277
- float min_dist = 1.;
278
- vec2 cell_randomizer = vec2(0.);
279
- for (int y = -1; y <= 1; y++) {
280
- for (int x = -1; x <= 1; x++) {
281
- vec2 tile_offset = vec2(float(x), float(y));
282
- vec2 rand = random2(i_uv + tile_offset);
283
- vec2 cell_center = .5 + 1e-4 + .25 * clamp(u_spreading, 0., 1.) * sin(time + TWO_PI * rand);
284
- float dist = length(tile_offset + cell_center - f_uv);
285
- if (dist < min_dist) {
286
- min_dist = dist;
287
- cell_randomizer = rand;
288
- }
289
- min_dist = min(min_dist, dist);
290
- }
291
- }
292
-
293
- return vec3(min_dist, cell_randomizer);
294
- }
295
-
296
- void main() {
297
- vec2 uv = gl_FragCoord.xy / u_resolution.xy;
298
-
299
- uv -= .5;
300
- float scale = .5 * u_scale + 1e-4;
301
- uv *= (.02 * (1. - step(1. - scale, 1.) / scale));
302
- uv *= u_resolution;
303
- uv /= u_pixelRatio;
304
- uv += .5;
305
-
306
- float t = u_time;
307
-
308
- vec3 voronoi = get_voronoi_shape(uv, t) + 1e-4;
309
-
310
- float radius = .25 * clamp(u_dotSize, 0., 1.) - .5 * clamp(u_dotSizeRange, 0., 1.) * voronoi[2];
311
- float dist = voronoi[0];
312
- float edge_width = fwidth(dist);
313
- float shape = smoothstep(radius + edge_width, radius - edge_width, dist);
314
-
315
- float color_randomizer = voronoi[1];
316
-
317
- float opacity =
318
- u_color1.a * step(0.0, color_randomizer) * step(color_randomizer, 0.25) +
319
- u_color2.a * step(0.25, color_randomizer) * step(color_randomizer, 0.5) +
320
- u_color3.a * step(0.5, color_randomizer) * step(color_randomizer, 0.75) +
321
- u_color4.a * step(0.75, color_randomizer) * step(color_randomizer, 1.0);
322
-
323
- opacity *= shape;
324
-
325
- vec3 color =
326
- u_color1.rgb * step(0.0, color_randomizer) * step(color_randomizer, 0.25) +
327
- u_color2.rgb * step(0.25, color_randomizer) * step(color_randomizer, 0.5) +
328
- u_color3.rgb * step(0.5, color_randomizer) * step(color_randomizer, 0.75) +
329
- u_color4.rgb * step(0.75, color_randomizer) * step(color_randomizer, 1.0);
330
-
331
- fragColor = vec4(color * opacity, opacity);
332
- }
333
- `;var I={Circle:0,Diamond:1,Square:2,Triangle:3},P=`#version 300 es
334
- precision highp float;
335
-
336
- uniform vec2 u_resolution;
337
- uniform float u_pixelRatio;
338
-
339
- uniform vec4 u_colorFill;
340
- uniform vec4 u_colorStroke;
341
- uniform float u_dotSize;
342
- uniform float u_gridSpacingX;
343
- uniform float u_gridSpacingY;
344
- uniform float u_strokeWidth;
345
- uniform float u_sizeRange;
346
- uniform float u_opacityRange;
347
- uniform float u_shape;
348
-
349
- out vec4 fragColor;
350
-
351
- #define TWO_PI 6.28318530718
352
- #define PI 3.14159265358979323846
353
-
354
- float hash(vec2 st) {
355
- return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453123);
356
- }
357
-
358
- vec3 permute(vec3 x) { return mod(((x * 34.0) + 1.0) * x, 289.0); }
359
-
360
- float snoise(vec2 v) {
361
- const vec4 C = vec4(0.211324865405187, 0.366025403784439,
362
- -0.577350269189626, 0.024390243902439);
363
- vec2 i = floor(v + dot(v, C.yy));
364
- vec2 x0 = v - i + dot(i, C.xx);
365
- vec2 i1;
366
- i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
367
- vec4 x12 = x0.xyxy + C.xxzz;
368
- x12.xy -= i1;
369
- i = mod(i, 289.0);
370
- vec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0))
371
- + i.x + vec3(0.0, i1.x, 1.0));
372
- vec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy),
373
- dot(x12.zw, x12.zw)), 0.0);
374
- m = m * m;
375
- m = m * m;
376
- vec3 x = 2.0 * fract(p * C.www) - 1.0;
377
- vec3 h = abs(x) - 0.5;
378
- vec3 ox = floor(x + 0.5);
379
- vec3 a0 = x - ox;
380
- m *= 1.79284291400159 - 0.85373472095314 * (a0 * a0 + h * h);
381
- vec3 g;
382
- g.x = a0.x * x0.x + h.x * x0.y;
383
- g.yz = a0.yz * x12.xz + h.yz * x12.yw;
384
- return 130.0 * dot(m, g);
385
- }
386
- float polygon(vec2 p, float N, float rot) {
387
- float a = atan(p.x, p.y) + rot;
388
- float r = TWO_PI / float(N);
389
-
390
- return cos(floor(.5 + a / r) * r - a) * length(p);
391
- }
392
-
393
- void main() {
394
- vec2 uv = gl_FragCoord.xy;
395
- uv.y = u_resolution.y - uv.y;
396
-
397
- uv /= u_pixelRatio;
398
-
399
- vec2 grid = fract(uv / vec2(u_gridSpacingX, u_gridSpacingY)) + 1e-4;
400
- vec2 grid_idx = floor(uv / vec2(u_gridSpacingX, u_gridSpacingY));
401
- float sizeRandomizer = .5 + .8 * snoise(2. * vec2(grid_idx.x * 100., grid_idx.y));
402
- float opacity_randomizer = .5 + .7 * snoise(2. * vec2(grid_idx.y, grid_idx.x));
403
-
404
- vec2 center = vec2(0.5) - 1e-3;
405
- vec2 p = (grid - center) * vec2(u_gridSpacingX, u_gridSpacingY);
406
-
407
- float baseSize = u_dotSize * (1. - sizeRandomizer * u_sizeRange);
408
- float strokeWidth = u_strokeWidth;
409
-
410
- float dist;
411
- if (u_shape < 0.5) {
412
- // Circle
413
- dist = length(p);
414
- } else if (u_shape < 1.5) {
415
- // Diamond
416
- strokeWidth *= 1.5;
417
- dist = polygon(1.5 * p, 4., .25 * PI);
418
- } else if (u_shape < 2.5) {
419
- // Square
420
- dist = polygon(1.03 * p, 4., 1e-3);
421
- } else {
422
- // Triangle
423
- strokeWidth *= 1.5;
424
- p = p * 2. - 1.;
425
- p *= .9;
426
- p.y -= .75 * baseSize;
427
- dist = polygon(p, 3., 1e-3);
428
- }
429
-
430
- float edgeWidth = fwidth(dist);
431
- float shapeOuter = smoothstep(baseSize + edgeWidth + strokeWidth, baseSize - edgeWidth + strokeWidth, dist);
432
- float shapeInner = smoothstep(baseSize + edgeWidth, baseSize - edgeWidth, dist);
433
- float stroke = clamp(shapeOuter - shapeInner, 0., 1.);
434
-
435
- float dot_opacity = max(0., 1. - opacity_randomizer * u_opacityRange);
436
-
437
- vec3 color = u_colorFill.rgb * u_colorFill.a * dot_opacity * shapeInner;
438
- color = mix(color, u_colorStroke.rgb, u_colorStroke.a * dot_opacity * stroke);
439
-
440
- float opacity = u_colorFill.a * shapeInner * dot_opacity;
441
- opacity += u_colorStroke.a * stroke * dot_opacity;
442
-
443
- fragColor = vec4(color, opacity);
444
- }
445
- `;var F=`#version 300 es
446
- precision highp float;
447
-
448
- uniform float u_time;
449
- uniform float u_pixelRatio;
450
- uniform vec2 u_resolution;
451
-
452
- uniform float u_scale;
453
-
454
- uniform vec4 u_color1;
455
- uniform vec4 u_color2;
456
- uniform vec4 u_color3;
457
- uniform vec4 u_color4;
458
- uniform vec4 u_color5;
459
- uniform float u_steps_number;
460
-
461
- out vec4 fragColor;
462
-
463
- vec3 permute(vec3 x) { return mod(((x * 34.0) + 1.0) * x, 289.0); }
464
- float snoise(vec2 v) {
465
- const vec4 C = vec4(0.211324865405187, 0.366025403784439,
466
- -0.577350269189626, 0.024390243902439);
467
- vec2 i = floor(v + dot(v, C.yy));
468
- vec2 x0 = v - i + dot(i, C.xx);
469
- vec2 i1;
470
- i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
471
- vec4 x12 = x0.xyxy + C.xxzz;
472
- x12.xy -= i1;
473
- i = mod(i, 289.0);
474
- vec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0))
475
- + i.x + vec3(0.0, i1.x, 1.0));
476
- vec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy),
477
- dot(x12.zw, x12.zw)), 0.0);
478
- m = m * m;
479
- m = m * m;
480
- vec3 x = 2.0 * fract(p * C.www) - 1.0;
481
- vec3 h = abs(x) - 0.5;
482
- vec3 ox = floor(x + 0.5);
483
- vec3 a0 = x - ox;
484
- m *= 1.79284291400159 - 0.85373472095314 * (a0 * a0 + h * h);
485
- vec3 g;
486
- g.x = a0.x * x0.x + h.x * x0.y;
487
- g.yz = a0.yz * x12.xz + h.yz * x12.yw;
488
- return 130.0 * dot(m, g);
489
- }
490
-
491
- float get_noise(vec2 uv, float t) {
492
- float noise = .5 * snoise(uv - vec2(0., .3 * t));
493
- noise += .5 * snoise(2. * uv + vec2(0., .32 * t));
494
-
495
- return noise;
496
- }
497
-
498
- vec4 getColor(int index) {
499
- if (index == 0) return u_color1;
500
- if (index == 1) return u_color2;
501
- if (index == 2) return u_color3;
502
- if (index == 3) return u_color4;
503
- if (index == 4) return u_color5;
504
- return u_color1;
505
- }
506
-
507
- void main() {
508
- vec2 uv = gl_FragCoord.xy / u_resolution.xy;
509
-
510
- uv -= .5;
511
- float scale = .5 * u_scale + 1e-4;
512
- uv *= (.0008 * (1. - step(1. - scale, 1.) / scale));
513
- uv *= u_resolution;
514
- uv /= u_pixelRatio;
515
- uv += .5;
516
-
517
- float t = u_time;
518
-
519
- float noise = .5 + .5 * get_noise(uv, t);
520
- noise = floor(noise * u_steps_number) / u_steps_number;
521
-
522
- vec3 color = u_color1.rgb * u_color1.a;
523
- float opacity = u_color1.a;
524
- for (int i = 0; i < 5; i++) {
525
- vec4 next_c = getColor(i + 1);
526
- float proportion = smoothstep((float(i) + .5) / 5., (float(i) + 2.) / 5., noise);
527
- color = mix(color, next_c.rgb * next_c.a, proportion);
528
- opacity = mix(opacity, next_c.a, proportion);
529
- }
530
- fragColor = vec4(color, opacity);
531
- }
532
- `;var k=`#version 300 es
533
- precision highp float;
534
-
535
- uniform float u_time;
536
- uniform float u_pixelRatio;
537
- uniform vec2 u_resolution;
538
-
539
- uniform float u_scale;
540
- uniform vec4 u_color1;
541
- uniform vec4 u_color2;
542
- uniform vec4 u_color3;
543
- uniform float u_ballSize;
544
- uniform float u_visibilityRange;
545
-
546
- #define TWO_PI 6.28318530718
547
-
548
- out vec4 fragColor;
549
-
550
- float hash(float x) {
551
- return fract(sin(x) * 43758.5453123);
552
- }
553
- float lerp(float a, float b, float t) {
554
- return a + t * (b - a);
555
- }
556
- float noise(float x) {
557
- float i = floor(x);
558
- float f = fract(x);
559
- float u = f * f * (3.0 - 2.0 * f); // Smoothstep function for interpolation
560
- return lerp(hash(i), hash(i + 1.0), u);
561
- }
562
-
563
- float get_ball_shape(vec2 uv, vec2 c, float p) {
564
- float s = .5 * length(uv - c);
565
- s = 1. - clamp(s, 0., 1.);
566
- s = pow(s, p);
567
- return s;
568
- }
569
-
570
- void main() {
571
- vec2 uv = gl_FragCoord.xy / u_resolution.xy;
572
- float ratio = u_resolution.x / u_resolution.y;
573
-
574
- uv -= .5;
575
- float scale = .5 * u_scale + 1e-4;
576
- uv *= (9. * (1. - step(1. - scale, 1.) / scale));
577
- uv += .5;
578
- uv.x *= ratio;
579
-
580
- float t = u_time;
581
-
582
- vec3 total_color = vec3(0.);
583
- float total_shape = 0.;
584
-
585
- const int max_balls_number = 15;
586
- for (int i = 0; i < max_balls_number; i++) {
587
- vec2 pos = vec2(.5) + 1e-4;
588
- float idx_fract = float(i) / float(max_balls_number);
589
- float angle = TWO_PI * idx_fract;
590
-
591
- float speed = 1. - .2 * idx_fract;
592
- float noiseX = noise(angle * 10. + float(i) + t * speed);
593
- float noiseY = noise(angle * 20. + float(i) - t * speed);
594
-
595
- pos += 7. * (vec2(noiseX, noiseY) - .5);
596
-
597
- vec4 ball_color;
598
- if (i % 3 == 0) {
599
- ball_color = u_color1;
600
- } else if (i % 3 == 1) {
601
- ball_color = u_color2;
602
- } else {
603
- ball_color = u_color3;
604
- }
605
-
606
- float shape = get_ball_shape(uv, pos, 6. - 4. * u_ballSize) * ball_color.a;
607
-
608
- shape *= smoothstep((float(i) - 1.) / float(max_balls_number), idx_fract, u_visibilityRange);
609
-
610
- total_color += ball_color.rgb * shape;
611
- total_shape += shape;
612
- }
613
-
614
- total_color /= max(total_shape, 1e-4);
615
-
616
- float edge_width = fwidth(total_shape);
617
- float final_shape = smoothstep(.4, .4 + edge_width, total_shape);
618
-
619
- vec3 color = total_color * final_shape;
620
- float opacity = final_shape;
621
-
622
- if (opacity < .01) {
623
- discard;
624
- }
625
-
626
- fragColor = vec4(color, opacity);
627
- }
628
- `;var U=`#version 300 es
629
- precision highp float;
630
-
631
- uniform float u_time;
632
- uniform float u_pixelRatio;
633
- uniform vec2 u_resolution;
634
-
635
- uniform float u_scale;
636
- uniform vec4 u_color;
637
- uniform float u_proportion;
638
- uniform float u_softness;
639
- uniform float u_octaveCount;
640
- uniform float u_persistence;
641
- uniform float u_lacunarity;
642
-
643
- out vec4 fragColor;
644
-
645
- #define TWO_PI 6.28318530718
646
-
647
- uint hash(uint x, uint seed) {
648
- const uint m = 0x5bd1e995U;
649
- uint hash = seed;
650
- // process input
651
- uint k = x;
652
- k *= m;
653
- k ^= k >> 24;
654
- k *= m;
655
- hash *= m;
656
- hash ^= k;
657
- // some final mixing
658
- hash ^= hash >> 13;
659
- hash *= m;
660
- hash ^= hash >> 15;
661
- return hash;
662
- }
663
-
664
- uint hash(uvec3 x, uint seed){
665
- const uint m = 0x5bd1e995U;
666
- uint hash = seed;
667
- // process first vector element
668
- uint k = x.x;
669
- k *= m;
670
- k ^= k >> 24;
671
- k *= m;
672
- hash *= m;
673
- hash ^= k;
674
- // process second vector element
675
- k = x.y;
676
- k *= m;
677
- k ^= k >> 24;
678
- k *= m;
679
- hash *= m;
680
- hash ^= k;
681
- // process third vector element
682
- k = x.z;
683
- k *= m;
684
- k ^= k >> 24;
685
- k *= m;
686
- hash *= m;
687
- hash ^= k;
688
- // some final mixing
689
- hash ^= hash >> 13;
690
- hash *= m;
691
- hash ^= hash >> 15;
692
- return hash;
693
- }
694
-
695
-
696
- vec3 gradientdy(uint hash) {
697
- switch (int(hash) & 15) { // look at the last four bits to pick a gradient dy
698
- case 0:
699
- return vec3(1, 1, 0);
700
- case 1:
701
- return vec3(-1, 1, 0);
702
- case 2:
703
- return vec3(1, -1, 0);
704
- case 3:
705
- return vec3(-1, -1, 0);
706
- case 4:
707
- return vec3(1, 0, 1);
708
- case 5:
709
- return vec3(-1, 0, 1);
710
- case 6:
711
- return vec3(1, 0, -1);
712
- case 7:
713
- return vec3(-1, 0, -1);
714
- case 8:
715
- return vec3(0, 1, 1);
716
- case 9:
717
- return vec3(0, -1, 1);
718
- case 10:
719
- return vec3(0, 1, -1);
720
- case 11:
721
- return vec3(0, -1, -1);
722
- case 12:
723
- return vec3(1, 1, 0);
724
- case 13:
725
- return vec3(-1, 1, 0);
726
- case 14:
727
- return vec3(0, -1, 1);
728
- case 15:
729
- return vec3(0, -1, -1);
730
- }
731
- }
732
-
733
- float interpolate(float value1, float value2, float value3, float value4, float value5, float value6, float value7, float value8, vec3 t) {
734
- return mix(
735
- mix(mix(value1, value2, t.x), mix(value3, value4, t.x), t.y),
736
- mix(mix(value5, value6, t.x), mix(value7, value8, t.x), t.y),
737
- t.z
738
- );
739
- }
740
-
741
- vec3 fade(vec3 t) {
742
- return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);
743
- }
744
-
745
- float perlinNoise(vec3 position, uint seed) {
746
- position += 1e+4;
747
- vec3 floorPosition = floor(position);
748
- vec3 fractPosition = fract(position);
749
- uvec3 cellCoordinates = uvec3(floorPosition);
750
- float value1 = dot(gradientdy(hash(cellCoordinates, seed)), fractPosition);
751
- float value2 = dot(gradientdy(hash((cellCoordinates + uvec3(1, 0, 0)), seed)), fractPosition - vec3(1, 0, 0));
752
- float value3 = dot(gradientdy(hash((cellCoordinates + uvec3(0, 1, 0)), seed)), fractPosition - vec3(0, 1, 0));
753
- float value4 = dot(gradientdy(hash((cellCoordinates + uvec3(1, 1, 0)), seed)), fractPosition - vec3(1, 1, 0));
754
- float value5 = dot(gradientdy(hash((cellCoordinates + uvec3(0, 0, 1)), seed)), fractPosition - vec3(0, 0, 1));
755
- float value6 = dot(gradientdy(hash((cellCoordinates + uvec3(1, 0, 1)), seed)), fractPosition - vec3(1, 0, 1));
756
- float value7 = dot(gradientdy(hash((cellCoordinates + uvec3(0, 1, 1)), seed)), fractPosition - vec3(0, 1, 1));
757
- float value8 = dot(gradientdy(hash((cellCoordinates + uvec3(1, 1, 1)), seed)), fractPosition - vec3(1, 1, 1));
758
- return interpolate(value1, value2, value3, value4, value5, value6, value7, value8, fade(fractPosition));
759
- }
760
-
761
- float p_noise(vec3 position, int octaveCount, float persistence, float lacunarity) {
762
- float value = 0.0;
763
- float amplitude = 1.0;
764
- float currentFrequency = 10.;
765
- uint currentSeed = uint(0);
766
- for (int i = 0; i < octaveCount; i++) {
767
- currentSeed = hash(currentSeed, 0x0U);
768
- value += perlinNoise(position * currentFrequency, currentSeed) * amplitude;
769
- amplitude *= persistence;
770
- currentFrequency *= lacunarity;
771
- }
772
- return value;
773
- }
774
-
775
- float get_max_amp(float persistence, float octaveCount) {
776
- persistence *= .999;
777
- return (1. - pow(persistence, octaveCount)) / (1. - persistence);
778
- }
779
-
780
- void main() {
781
-
782
- vec2 uv = gl_FragCoord.xy / u_resolution.xy;
783
- float t = .2 * u_time;
784
-
785
- uv -= .5;
786
- uv *= (.004 * u_scale * u_resolution);
787
- uv /= u_pixelRatio;
788
- uv += .5;
789
-
790
- vec3 p = vec3(uv, t);
791
-
792
- float oct_count = max(0., floor(u_octaveCount));
793
- float persistence = clamp(u_persistence, 0., 1.);
794
- float noise = p_noise(p, int(oct_count), persistence, u_lacunarity);
795
-
796
- float max_amp = get_max_amp(persistence, oct_count);
797
- float noise_normalized = (noise + max_amp) / (2. * max_amp) + (u_proportion - .5);
798
- float sharpness = clamp(u_softness, 0., 1.);
799
- float smooth_w = 0.5 * fwidth(noise_normalized);
800
- float sharp_noise = smoothstep(
801
- .5 - .5 * sharpness - smooth_w,
802
- .5 + .5 * sharpness + smooth_w,
803
- noise_normalized
804
- );
805
-
806
- vec3 color = u_color.rgb * u_color.a * sharp_noise;
807
- float opacity = u_color.a * sharp_noise;
808
-
809
- fragColor = vec4(color, opacity);
810
- }
811
- `;var W=`#version 300 es
812
- precision highp float;
813
-
814
- uniform float u_time;
815
- uniform float u_pixelRatio;
816
- uniform vec2 u_resolution;
817
-
818
- uniform float u_scale;
819
-
820
- uniform vec4 u_colorCell1;
821
- uniform vec4 u_colorCell2;
822
- uniform vec4 u_colorCell3;
823
- uniform vec4 u_colorMid;
824
-
825
- uniform float u_colorGradient;
826
- uniform float u_distance;
827
- uniform float u_edgesSize;
828
- uniform float u_edgesSoftness;
829
- uniform float u_middleSize;
830
- uniform float u_middleSoftness;
831
-
832
- #define TWO_PI 6.28318530718
833
-
834
- out vec4 fragColor;
835
-
836
- vec2 hash(vec2 p) {
837
- p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));
838
- return fract(sin(p) * 18.5453);
839
- }
840
-
841
- float smin(float angle, float b, float k) {
842
- float h = clamp(.5 + .5 * (b - angle) / k, 0., 1.);
843
- return mix(b, angle, h) - k * h * (1. - h);
844
- }
845
-
846
- vec4 blend_colors(vec4 c1, vec4 c2, vec4 c3, vec2 randomizer) {
847
- vec3 color1 = c1.rgb * c1.a;
848
- vec3 color2 = c2.rgb * c2.a;
849
- vec3 color3 = c3.rgb * c3.a;
850
-
851
- float mixer = clamp(u_colorGradient, 0., 1.);
852
- float r1 = smoothstep(.5 - .5 * mixer, .5 + .5 * mixer, randomizer[0]);
853
- float r2 = smoothstep(.6 - .6 * mixer, .6 + .4 * mixer, randomizer[1]);
854
- vec3 blended_color_2 = mix(color1, color2, r1);
855
- float blended_opacity_2 = mix(c1.a, c2.a, r1);
856
- vec3 c = mix(blended_color_2, color3, r2);
857
- float o = mix(blended_opacity_2, c3.a, r2);
858
-
859
- return vec4(c, o);
860
- }
861
-
862
- void main() {
863
- vec2 uv = gl_FragCoord.xy / u_resolution.xy;
864
- float t = u_time;
865
- uv -= .5;
866
- uv *= (.01 * u_scale * u_resolution);
867
- uv /= u_pixelRatio;
868
- uv += .5;
869
-
870
- vec2 i_uv = floor(uv);
871
- vec2 f_uv = fract(uv);
872
-
873
- vec2 randomizer = vec2(0.);
874
- vec3 distance = vec3(1.);
875
-
876
- for (int y = -1; y <= 1; y++) {
877
- for (int x = -1; x <= 1; x++) {
878
- vec2 tile_offset = vec2(float(x), float(y));
879
- vec2 o = hash(i_uv + tile_offset);
880
- tile_offset += (.5 + clamp(u_distance, 0., .5) * sin(t + TWO_PI * o)) - f_uv;
881
-
882
- float dist = dot(tile_offset, tile_offset);
883
- float old_min_dist = distance.x;
884
-
885
- distance.z = max(distance.x, max(distance.y, min(distance.z, dist)));
886
- distance.y = max(distance.x, min(distance.y, dist));
887
- distance.x = min(distance.x, dist);
888
-
889
- if (old_min_dist > distance.x) {
890
- randomizer = o;
891
- }
892
- }
893
- }
894
-
895
- distance = sqrt(distance);
896
-
897
- distance = sqrt(distance);
898
- float cell_shape = min(smin(distance.z, distance.y, .1) - distance.x, 1.);
899
-
900
- float dot_shape = pow(distance.x, 2.) / (2. * clamp(u_middleSize, 0., 1.) + 1e-4);
901
- float dot_edge_width = fwidth(dot_shape);
902
- float dotSharp = clamp(1. - u_middleSoftness, 0., 1.);
903
- dot_shape = 1. - smoothstep(.5 * dotSharp - dot_edge_width, 1. - .5 * dotSharp, dot_shape);
904
-
905
- float cell_edge_width = fwidth(distance.x);
906
- float w = .7 * (clamp(u_edgesSize, 0., 1.) - .1);
907
- float edgeSharp = clamp(u_edgesSoftness, 0., 1.);
908
- cell_shape = smoothstep(w - cell_edge_width, w + edgeSharp, cell_shape);
909
-
910
- dot_shape *= cell_shape;
911
-
912
- vec4 cell_mix = blend_colors(u_colorCell1, u_colorCell2, u_colorCell3, randomizer);
913
-
914
- vec3 color = cell_mix.rgb * cell_shape;
915
- float opacity = cell_mix.a * cell_shape;
916
-
917
- color = mix(color, u_colorMid.rgb * u_colorMid.a, dot_shape);
918
- opacity = mix(opacity, u_colorMid.a, dot_shape);
919
-
920
- fragColor = vec4(color, opacity);
921
- }
922
- `;var E=`#version 300 es
923
- precision highp float;
924
-
925
- uniform float u_pixelRatio;
926
- uniform vec2 u_resolution;
927
-
928
- uniform float u_scale;
929
- uniform float u_rotation;
930
-
931
- uniform vec4 u_color;
932
- uniform float u_shape;
933
- uniform float u_frequency;
934
- uniform float u_amplitude;
935
- uniform float u_spacing;
936
- uniform float u_dutyCycle;
937
- uniform float u_softness;
938
-
939
- #define TWO_PI 6.28318530718
940
- #define PI 3.14159265358979323846
941
-
942
- out vec4 fragColor;
943
-
944
- vec2 rotate(vec2 uv, float th) {
945
- return mat2(cos(th), sin(th), -sin(th), cos(th)) * uv;
946
- }
947
-
948
- void main() {
949
- vec2 uv = gl_FragCoord.xy / u_resolution.xy;
950
-
951
- uv -= .5;
952
- uv *= (.02 * max(0., u_scale) * u_resolution);
953
- uv = rotate(uv, u_rotation * .5 * PI);
954
- uv /= u_pixelRatio;
955
- uv += .5;
956
-
957
- float wave = .5 * cos(uv.x * u_frequency * TWO_PI);
958
- float zigzag = 2. * abs(fract(uv.x * u_frequency) - .5);
959
- float irregular = sin(uv.x * .25 * u_frequency * TWO_PI) * cos(uv.x * u_frequency * TWO_PI);
960
- float irregular2 = .75 * (sin(uv.x * u_frequency * TWO_PI) + .5 * cos(uv.x * .5 * u_frequency * TWO_PI));
961
-
962
- float offset = mix(zigzag, wave, smoothstep(0., 1., u_shape));
963
- offset = mix(offset, irregular, smoothstep(1., 2., u_shape));
964
- offset = mix(offset, irregular2, smoothstep(2., 3., u_shape));
965
- offset *= 2. * u_amplitude;
966
-
967
- float spacing = .02 + .98 * u_spacing;
968
- float shape = .5 + .5 * sin((uv.y + offset) * PI / spacing);
969
-
970
- float edge_width = .02 / (1. + abs(shape)) * (.001 + u_scale);
971
- edge_width += .5 * max(0., u_softness);
972
- float dc = clamp(1. - u_dutyCycle, 0., 1.);
973
- float s = smoothstep(dc - edge_width, dc + edge_width, shape);
974
-
975
- vec3 color = u_color.rgb * u_color.a * s;
976
- float opacity = u_color.a * s;
977
-
978
- fragColor = vec4(color, opacity);
979
- }
980
- `;var D={Checks:0,Stripes:1,Edge:2},O=`#version 300 es
981
- precision highp float;
982
-
983
- uniform float u_time;
984
- uniform float u_pixelRatio;
985
- uniform vec2 u_resolution;
986
-
987
- uniform float u_scale;
988
- uniform float u_rotation;
989
- uniform vec4 u_color1;
990
- uniform vec4 u_color2;
991
- uniform vec4 u_color3;
992
- uniform float u_proportion;
993
- uniform float u_softness;
994
- uniform float u_shape;
995
- uniform float u_shapeScale;
996
- uniform float u_distortion;
997
- uniform float u_swirl;
998
- uniform float u_swirlIterations;
999
-
1000
-
1001
- out vec4 fragColor;
1002
-
1003
- #define TWO_PI 6.28318530718
1004
- #define PI 3.14159265358979323846
1005
-
1006
- vec2 rotate(vec2 uv, float th) {
1007
- return mat2(cos(th), sin(th), -sin(th), cos(th)) * uv;
1008
- }
1009
-
1010
- float random(vec2 st) {
1011
- return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453123);
1012
- }
1013
- float noise(vec2 st) {
1014
- vec2 i = floor(st);
1015
- vec2 f = fract(st);
1016
- float a = random(i);
1017
- float b = random(i + vec2(1.0, 0.0));
1018
- float c = random(i + vec2(0.0, 1.0));
1019
- float d = random(i + vec2(1.0, 1.0));
1020
-
1021
- // Smoothstep for interpolation
1022
- vec2 u = f * f * (3.0 - 2.0 * f);
1023
-
1024
- // Do the interpolation as two nested mix operations
1025
- // If you try to do this in one big operation, there's enough precision loss to be off by 1px at cell boundaries
1026
- float x1 = mix(a, b, u.x);
1027
- float x2 = mix(c, d, u.x);
1028
- return mix(x1, x2, u.y);
1029
-
1030
- }
1031
-
1032
- vec4 blend_colors(vec4 c1, vec4 c2, vec4 c3, float mixer, float edgesWidth, float edge_blur) {
1033
- vec3 color1 = c1.rgb * c1.a;
1034
- vec3 color2 = c2.rgb * c2.a;
1035
- vec3 color3 = c3.rgb * c3.a;
1036
-
1037
- float r1 = smoothstep(.0 + .35 * edgesWidth, .7 - .35 * edgesWidth + .5 * edge_blur, mixer);
1038
- float r2 = smoothstep(.3 + .35 * edgesWidth, 1. - .35 * edgesWidth + edge_blur, mixer);
1039
-
1040
- vec3 blended_color_2 = mix(color1, color2, r1);
1041
- float blended_opacity_2 = mix(c1.a, c2.a, r1);
1042
-
1043
- vec3 c = mix(blended_color_2, color3, r2);
1044
- float o = mix(blended_opacity_2, c3.a, r2);
1045
- return vec4(c, o);
1046
- }
1047
-
1048
- void main() {
1049
- vec2 uv = gl_FragCoord.xy / u_resolution.xy;
1050
- vec2 uv_original = uv;
1051
-
1052
- float t = .5 * u_time;
1053
-
1054
- float noise_scale = .0005 + .006 * u_scale;
1055
-
1056
- uv -= .5;
1057
- uv *= (noise_scale * u_resolution);
1058
- uv = rotate(uv, u_rotation * .5 * PI);
1059
- uv /= u_pixelRatio;
1060
- uv += .5;
1061
-
1062
- float n1 = noise(uv * 1. + t);
1063
- float n2 = noise(uv * 2. - t);
1064
- float angle = n1 * TWO_PI;
1065
- uv.x += 4. * u_distortion * n2 * cos(angle);
1066
- uv.y += 4. * u_distortion * n2 * sin(angle);
1067
-
1068
- float iterations_number = ceil(clamp(u_swirlIterations, 1., 30.));
1069
- for (float i = 1.; i <= iterations_number; i++) {
1070
- uv.x += clamp(u_swirl, 0., 2.) / i * cos(t + i * 1.5 * uv.y);
1071
- uv.y += clamp(u_swirl, 0., 2.) / i * cos(t + i * 1. * uv.x);
1072
- }
1073
-
1074
- float proportion = clamp(u_proportion, 0., 1.);
1075
-
1076
- float shape = 0.;
1077
- float mixer = 0.;
1078
- if (u_shape < .5) {
1079
- vec2 checks_shape_uv = uv * (.5 + 3.5 * u_shapeScale);
1080
- shape = .5 + .5 * sin(checks_shape_uv.x) * cos(checks_shape_uv.y);
1081
- mixer = shape + .48 * sign(proportion - .5) * pow(abs(proportion - .5), .5);
1082
- } else if (u_shape < 1.5) {
1083
- vec2 stripes_shape_uv = uv * (.25 + 3. * u_shapeScale);
1084
- float f = fract(stripes_shape_uv.y);
1085
- shape = smoothstep(.0, .55, f) * smoothstep(1., .45, f);
1086
- mixer = shape + .48 * sign(proportion - .5) * pow(abs(proportion - .5), .5);
1087
- } else {
1088
- float sh = 1. - uv.y;
1089
- sh -= .5;
1090
- sh /= (noise_scale * u_resolution.y);
1091
- sh += .5;
1092
- float shape_scaling = .2 * (1. - u_shapeScale);
1093
- shape = smoothstep(.45 - shape_scaling, .55 + shape_scaling, sh + .3 * (proportion - .5));
1094
- mixer = shape;
1095
- }
1096
-
1097
- vec4 color_mix = blend_colors(u_color1, u_color2, u_color3, mixer, 1. - clamp(u_softness, 0., 1.), .01 + .01 * u_scale);
1098
-
1099
- fragColor = vec4(color_mix.rgb, color_mix.a);
1100
- }
1101
- `;var L=`#version 300 es
1102
- precision highp float;
1103
-
1104
- uniform float u_time;
1105
- uniform float u_pixelRatio;
1106
- uniform vec2 u_resolution;
1107
-
1108
- uniform vec4 u_colorBack;
1109
- uniform vec4 u_color1;
1110
- uniform vec4 u_color2;
1111
- uniform vec4 u_color3;
1112
-
1113
- uniform float u_offsetX;
1114
- uniform float u_offsetY;
1115
-
1116
- uniform float u_frequency;
1117
- uniform float u_spotty;
1118
- uniform float u_midSize;
1119
- uniform float u_midIntensity;
1120
- uniform float u_density;
1121
- uniform float u_blending;
1122
-
1123
- out vec4 fragColor;
1124
-
1125
- #define TWO_PI 6.28318530718
1126
-
1127
- float random(vec2 uv) {
1128
- return fract(sin(dot(uv, vec2(12.9898, 78.233))) * 43758.5453123);
1129
- }
1130
-
1131
- vec2 rotate(vec2 uv, float th) {
1132
- return mat2(cos(th), sin(th), -sin(th), cos(th)) * uv;
1133
- }
1134
-
1135
- float noise(vec2 uv) {
1136
- vec2 i = floor(uv);
1137
- vec2 f = fract(uv);
1138
-
1139
- float a = random(i);
1140
- float b = random(i + vec2(1.0, 0.0));
1141
- float c = random(i + vec2(0.0, 1.0));
1142
- float d = random(i + vec2(1.0, 1.0));
1143
-
1144
- vec2 u = f * f * (3.0 - 2.0 * f);
1145
-
1146
- float x1 = mix(a, b, u.x);
1147
- float x2 = mix(c, d, u.x);
1148
- return mix(x1, x2, u.y);
1149
- }
1150
-
1151
- float get_noise_shape(vec2 uv, float r, float freq, float density, float time) {
1152
- uv = rotate(uv, .05 * time);
1153
- float a = atan(uv.y, uv.x);
1154
- r -= 3. * time;
1155
- vec2 left = vec2(a * freq, r);
1156
- vec2 right = vec2(mod(a, TWO_PI) * freq, r);
1157
- float n_left = pow(noise(left), density);
1158
- float n_right = pow(noise(right), density);
1159
- float shape = mix(n_right, n_left, smoothstep(-.2, .2, uv.x));
1160
- return shape;
1161
- }
1162
-
1163
- void main() {
1164
- vec2 uv = gl_FragCoord.xy / u_resolution.xy;
1165
- float ratio = u_resolution.x / u_resolution.y;
1166
-
1167
- uv -= .5;
1168
- uv += vec2(-u_offsetX, u_offsetY);
1169
- uv.x *= ratio;
1170
-
1171
- float t = .2 * u_time;
1172
-
1173
- float radius = length(uv);
1174
- float spots = 4. * abs(u_spotty);
1175
- float density = 4. - 3. * clamp(u_density, 0., 1.);
1176
-
1177
- float rays1 = get_noise_shape(uv, radius * spots, 5. * u_frequency, density, t);
1178
- rays1 *= get_noise_shape(uv, .5 + .75 * radius * spots, 4. * u_frequency, density, -.5 * t);
1179
-
1180
- float rays2 = get_noise_shape(uv, 1.5 * radius, 12. * u_frequency, density, t);
1181
- rays2 *= get_noise_shape(uv, -.5 + 1.1 * radius * spots, 7. * u_frequency, density, .75 * t);
1182
-
1183
- float rays3 = get_noise_shape(uv, 2. * radius * spots, 10. * u_frequency, density, t);
1184
- rays3 *= get_noise_shape(uv, 1.1 * radius, 12. * u_frequency, density, .2 * t);
1185
-
1186
- float mid_shape = smoothstep(1. * abs(u_midSize), .05 * abs(u_midSize), radius);
1187
- rays3 = mix(rays3, 1., (.5 + .5 * rays1) * u_midIntensity * pow(mid_shape, 7.));
1188
- rays2 = mix(rays2, 1., (.5 + .5 * rays3) * u_midIntensity * pow(mid_shape, 3.));
1189
- rays1 = mix(rays1, 1., u_midIntensity * pow(mid_shape, 5.));
1190
-
1191
- float opacity = rays2 * u_color2.a;
1192
- opacity += rays3 * u_color3.a;
1193
- opacity += rays1 * u_color1.a;
1194
- opacity += u_colorBack.a * (1.0 - rays1 * u_color1.a - rays2 * u_color2.a - rays3 * u_color3.a);
1195
- opacity = clamp(opacity, 0.0, 1.0);
1196
-
1197
- vec3 added_color = u_colorBack.rgb * (1. - (rays1 + rays2 + rays3)) * u_colorBack.a;
1198
- added_color += u_color1.rgb * rays1 * u_color1.a;
1199
- added_color += u_color2.rgb * rays2 * u_color2.a;
1200
- added_color += u_color3.rgb * rays3 * u_color3.a;
1201
-
1202
- added_color += u_colorBack.rgb * rays1 * (1.0 - u_color1.a) * u_colorBack.a;
1203
- added_color += u_colorBack.rgb * rays2 * (1.0 - u_color2.a) * u_colorBack.a;
1204
- added_color += u_colorBack.rgb * rays3 * (1.0 - u_color3.a) * u_colorBack.a;
1205
-
1206
- vec3 mixed_color = mix(u_colorBack.rgb * u_colorBack.a, u_color2.rgb, rays2 * u_color2.a);
1207
- mixed_color = mix(mixed_color, u_color3.rgb, rays3 * u_color3.a);
1208
- mixed_color = mix(mixed_color, u_color1.rgb, rays1 * u_color1.a);
1209
-
1210
- vec3 color = mix(mixed_color, added_color, clamp(u_blending, 0., 1.));
1211
-
1212
- fragColor = vec4(color, opacity);
1213
- }
1214
- `;var A=`#version 300 es
1215
- precision highp float;
1216
-
1217
- uniform float u_scale;
1218
- uniform float u_offsetX;
1219
- uniform float u_offsetY;
1220
-
1221
- uniform vec4 u_color1;
1222
- uniform vec4 u_color2;
1223
- uniform float u_spiralDensity;
1224
- uniform float u_spiralDistortion;
1225
- uniform float u_strokeWidth;
1226
- uniform float u_strokeCap;
1227
- uniform float u_strokeTaper;
1228
-
1229
- uniform float u_noiseFreq;
1230
- uniform float u_noisePower;
1231
- uniform float u_softness;
1232
-
1233
- uniform float u_time;
1234
- uniform float u_pixelRatio;
1235
- uniform vec2 u_resolution;
1236
-
1237
- #define TWO_PI 6.28318530718
1238
- #define PI 3.14159265358979323846
1239
-
1240
- out vec4 fragColor;
1241
-
1242
- vec3 permute(vec3 x) { return mod(((x * 34.0) + 1.0) * x, 289.0); }
1243
-
1244
- float snoise(vec2 v) {
1245
- const vec4 C = vec4(0.211324865405187, 0.366025403784439,
1246
- -0.577350269189626, 0.024390243902439);
1247
- vec2 i = floor(v + dot(v, C.yy));
1248
- vec2 x0 = v - i + dot(i, C.xx);
1249
- vec2 i1;
1250
- i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
1251
- vec4 x12 = x0.xyxy + C.xxzz;
1252
- x12.xy -= i1;
1253
- i = mod(i, 289.0);
1254
- vec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0))
1255
- + i.x + vec3(0.0, i1.x, 1.0));
1256
- vec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy),
1257
- dot(x12.zw, x12.zw)), 0.0);
1258
- m = m * m;
1259
- m = m * m;
1260
- vec3 x = 2.0 * fract(p * C.www) - 1.0;
1261
- vec3 h = abs(x) - 0.5;
1262
- vec3 ox = floor(x + 0.5);
1263
- vec3 a0 = x - ox;
1264
- m *= 1.79284291400159 - 0.85373472095314 * (a0 * a0 + h * h);
1265
- vec3 g;
1266
- g.x = a0.x * x0.x + h.x * x0.y;
1267
- g.yz = a0.yz * x12.xz + h.yz * x12.yw;
1268
- return 130.0 * dot(m, g);
1269
- }
1270
-
1271
- void main() {
1272
- vec2 uv = gl_FragCoord.xy / u_resolution.xy;
1273
- float ratio = u_resolution.x / u_resolution.y;
1274
-
1275
- uv -= .5;
1276
- uv += vec2(-u_offsetX, u_offsetY);
1277
-
1278
- uv *= (.4 + 15. * u_scale);
1279
- uv.x *= ratio;
1280
-
1281
- float t = u_time;
1282
-
1283
- float l = length(uv);
1284
- float angle = atan(uv.y, uv.x) - 2. * t;
1285
- float angle_norm = angle / TWO_PI;
1286
-
1287
- angle_norm += .125 * u_noisePower * snoise(.5 * u_noiseFreq * uv);
1288
-
1289
- float offset = pow(l, 1. - clamp(u_spiralDensity, 0., 1.)) + angle_norm;
1290
-
1291
- float stripe_map = fract(offset);
1292
- stripe_map -= .5 * u_strokeTaper * l;
1293
-
1294
- stripe_map += .25 * u_noisePower * snoise(u_noiseFreq * uv);
1295
-
1296
- float shape = 2. * abs(stripe_map - .5);
1297
-
1298
- shape *= (1. + u_spiralDistortion * sin(4. * l - t) * cos(PI + l + t));
1299
-
1300
- float stroke_width = clamp(u_strokeWidth, fwidth(l), 1. - fwidth(l));
1301
-
1302
- float edge_width = min(fwidth(l), fwidth(offset));
1303
-
1304
- float mid = 1. - smoothstep(.0, .9, l);
1305
- mid = pow(mid, 2.);
1306
- shape -= .5 * u_strokeCap * mid;
1307
-
1308
- shape = smoothstep(stroke_width - edge_width - u_softness, stroke_width + edge_width + u_softness, shape);
1309
-
1310
- vec3 color = mix(u_color1.rgb * u_color1.a, u_color2.rgb * u_color2.a, shape);
1311
- float opacity = mix(u_color1.a, u_color2.a, shape);
1312
-
1313
- fragColor = vec4(color, opacity);
1314
- }
1315
- `;function d(o,e=[0,0,0,1]){if(Array.isArray(o))return o.length===4?o:o.length===3?[...o,1]:d(e);if(typeof o!="string")return d(e);let t,r,i,a=1;if(o.startsWith("#"))[t,r,i,a]=M(o);else if(o.startsWith("rgb"))[t,r,i,a]=G(o);else if(o.startsWith("hsl"))[t,r,i,a]=q(B(o));else return console.error("Unsupported color format",o),d(e);return[p(t,0,1),p(r,0,1),p(i,0,1),p(a,0,1)]}function M(o){o=o.replace(/^#/,""),o.length===3&&(o=o.split("").map(a=>a+a).join("")),o.length===6&&(o=o+"ff");let e=parseInt(o.slice(0,2),16)/255,t=parseInt(o.slice(2,4),16)/255,r=parseInt(o.slice(4,6),16)/255,i=parseInt(o.slice(6,8),16)/255;return[e,t,r,i]}function G(o){let e=o.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([0-9.]+))?\s*\)$/i);return e?[parseInt(e[1]??"0")/255,parseInt(e[2]??"0")/255,parseInt(e[3]??"0")/255,e[4]===void 0?1:parseFloat(e[4])]:[0,0,0,1]}function B(o){let e=o.match(/^hsla?\s*\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*([0-9.]+))?\s*\)$/i);return e?[parseInt(e[1]??"0"),parseInt(e[2]??"0"),parseInt(e[3]??"0"),e[4]===void 0?1:parseFloat(e[4])]:[0,0,0,1]}function q(o){let[e,t,r,i]=o,a=e/360,s=t/100,u=r/100,n,l,m;if(t===0)n=l=m=u;else{let h=(f,g,c)=>(c<0&&(c+=1),c>1&&(c-=1),c<.16666666666666666?f+(g-f)*6*c:c<.5?g:c<.6666666666666666?f+(g-f)*(.6666666666666666-c)*6:f),_=u<.5?u*(1+s):u+s-u*s,v=2*u-_;n=h(v,_,a+1/3),l=h(v,_,a),m=h(v,_,a-1/3)}return[n,l,m,i]}var p=(o,e,t)=>Math.min(Math.max(o,e),t);export{I as DotGridShapes,D as PatternShapes,x as ShaderMount,P as dotGridFragmentShader,T as dotOrbitFragmentShader,d as getShaderColorFromString,L as godRaysFragmentShader,y as isPaperShaderDivWrapper,w as meshGradientFragmentShader,k as metaballsFragmentShader,C as neuroNoiseFragmentShader,U as perlinNoiseFragmentShader,z as smokeRingFragmentShader,A as spiralFragmentShader,F as steppedSimplexNoiseFragmentShader,W as voronoiFragmentShader,O as warpFragmentShader,E as wavesFragmentShader};
1
+ /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
2
+ * Paper Shaders *
3
+ * https://github.com/paper-design/shaders *
4
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * */
5
+
6
+ import { ShaderMount, isPaperShaderElement } from "./shader-mount";
7
+ import {
8
+ defaultObjectSizing,
9
+ defaultPatternSizing,
10
+ ShaderFitOptions
11
+ } from "./shader-sizing";
12
+ import {
13
+ meshGradientFragmentShader,
14
+ meshGradientMeta
15
+ } from "./shaders/mesh-gradient";
16
+ import {
17
+ smokeRingMeta,
18
+ smokeRingFragmentShader
19
+ } from "./shaders/smoke-ring";
20
+ import { neuroNoiseFragmentShader } from "./shaders/neuro-noise";
21
+ import { dotOrbitMeta, dotOrbitFragmentShader } from "./shaders/dot-orbit";
22
+ import {
23
+ dotGridFragmentShader,
24
+ DotGridShapes
25
+ } from "./shaders/dot-grid";
26
+ import {
27
+ simplexNoiseMeta,
28
+ simplexNoiseFragmentShader
29
+ } from "./shaders/simplex-noise";
30
+ import {
31
+ metaballsMeta,
32
+ metaballsFragmentShader
33
+ } from "./shaders/metaballs";
34
+ import { perlinNoiseFragmentShader } from "./shaders/perlin-noise";
35
+ import { voronoiMeta, voronoiFragmentShader } from "./shaders/voronoi";
36
+ import { wavesFragmentShader } from "./shaders/waves";
37
+ import {
38
+ warpMeta,
39
+ warpFragmentShader,
40
+ WarpPatterns
41
+ } from "./shaders/warp";
42
+ import { godRaysMeta, godRaysFragmentShader } from "./shaders/god-rays";
43
+ import { spiralFragmentShader } from "./shaders/spiral";
44
+ import { swirlMeta, swirlFragmentShader } from "./shaders/swirl";
45
+ import { ditheringFragmentShader } from "./shaders/dithering";
46
+ import {
47
+ grainGradientFragmentShader,
48
+ grainGradientMeta
49
+ } from "./shaders/grain-gradient";
50
+ import { liquidMetalFragmentShader } from "./shaders/liquid-metal";
51
+ import {
52
+ pulsingBorderMeta,
53
+ pulsingBorderFragmentShader
54
+ } from "./shaders/pulsing-border";
55
+ import { getShaderColorFromString } from "./get-shader-color-from-string";
56
+ import { getShaderNoiseTexture } from "./get-shader-noise-texture";
57
+ export {
58
+ DotGridShapes,
59
+ ShaderFitOptions,
60
+ ShaderMount,
61
+ WarpPatterns,
62
+ defaultObjectSizing,
63
+ defaultPatternSizing,
64
+ ditheringFragmentShader,
65
+ dotGridFragmentShader,
66
+ dotOrbitFragmentShader,
67
+ dotOrbitMeta,
68
+ getShaderColorFromString,
69
+ getShaderNoiseTexture,
70
+ godRaysFragmentShader,
71
+ godRaysMeta,
72
+ grainGradientFragmentShader,
73
+ grainGradientMeta,
74
+ isPaperShaderElement,
75
+ liquidMetalFragmentShader,
76
+ meshGradientFragmentShader,
77
+ meshGradientMeta,
78
+ metaballsFragmentShader,
79
+ metaballsMeta,
80
+ neuroNoiseFragmentShader,
81
+ perlinNoiseFragmentShader,
82
+ pulsingBorderFragmentShader,
83
+ pulsingBorderMeta,
84
+ simplexNoiseFragmentShader,
85
+ simplexNoiseMeta,
86
+ smokeRingFragmentShader,
87
+ smokeRingMeta,
88
+ spiralFragmentShader,
89
+ swirlFragmentShader,
90
+ swirlMeta,
91
+ voronoiFragmentShader,
92
+ voronoiMeta,
93
+ warpFragmentShader,
94
+ warpMeta,
95
+ wavesFragmentShader
96
+ };
1316
97
  //# sourceMappingURL=index.js.map