shaders-oneshot 0.0.81-shared.1
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.
- package/LICENSE +201 -0
- package/NOTICE +5 -0
- package/README.md +7 -0
- package/dist/empty-pixel.d.ts +1 -0
- package/dist/empty-pixel.js +10 -0
- package/dist/empty-pixel.js.map +7 -0
- package/dist/get-shader-color-from-string.d.ts +3 -0
- package/dist/get-shader-color-from-string.js +101 -0
- package/dist/get-shader-color-from-string.js.map +7 -0
- package/dist/get-shader-color-from-string.test.d.ts +1 -0
- package/dist/get-shader-color-from-string.test.js +69 -0
- package/dist/get-shader-noise-texture.d.ts +1 -0
- package/dist/get-shader-noise-texture.js +18 -0
- package/dist/get-shader-noise-texture.js.map +7 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +194 -0
- package/dist/index.js.map +7 -0
- package/dist/shader-color-spaces.d.ts +6 -0
- package/dist/shader-color-spaces.js +96 -0
- package/dist/shader-color-spaces.js.map +7 -0
- package/dist/shader-mount.d.ts +199 -0
- package/dist/shader-mount.js +735 -0
- package/dist/shader-mount.js.map +7 -0
- package/dist/shader-sizing.d.ts +30 -0
- package/dist/shader-sizing.js +38 -0
- package/dist/shader-sizing.js.map +7 -0
- package/dist/shader-utils.d.ts +10 -0
- package/dist/shader-utils.js +131 -0
- package/dist/shader-utils.js.map +7 -0
- package/dist/shaders/color-panels.d.ts +70 -0
- package/dist/shaders/color-panels.js +224 -0
- package/dist/shaders/color-panels.js.map +7 -0
- package/dist/shaders/dithering.d.ts +62 -0
- package/dist/shaders/dithering.js +271 -0
- package/dist/shaders/dithering.js.map +7 -0
- package/dist/shaders/dot-grid.d.ts +65 -0
- package/dist/shaders/dot-grid.js +110 -0
- package/dist/shaders/dot-grid.js.map +7 -0
- package/dist/shaders/dot-orbit.d.ts +57 -0
- package/dist/shaders/dot-orbit.js +123 -0
- package/dist/shaders/dot-orbit.js.map +7 -0
- package/dist/shaders/fluted-glass.d.ts +112 -0
- package/dist/shaders/fluted-glass.js +361 -0
- package/dist/shaders/fluted-glass.js.map +7 -0
- package/dist/shaders/gem-smoke.d.ts +96 -0
- package/dist/shaders/gem-smoke.js +573 -0
- package/dist/shaders/gem-smoke.js.map +7 -0
- package/dist/shaders/god-rays.d.ts +67 -0
- package/dist/shaders/god-rays.js +133 -0
- package/dist/shaders/god-rays.js.map +7 -0
- package/dist/shaders/grain-gradient.d.ts +80 -0
- package/dist/shaders/grain-gradient.js +301 -0
- package/dist/shaders/grain-gradient.js.map +7 -0
- package/dist/shaders/halftone-cmyk.d.ts +104 -0
- package/dist/shaders/halftone-cmyk.js +295 -0
- package/dist/shaders/halftone-cmyk.js.map +7 -0
- package/dist/shaders/halftone-dots.d.ts +80 -0
- package/dist/shaders/halftone-dots.js +321 -0
- package/dist/shaders/halftone-dots.js.map +7 -0
- package/dist/shaders/heatmap.d.ts +66 -0
- package/dist/shaders/heatmap.js +384 -0
- package/dist/shaders/heatmap.js.map +7 -0
- package/dist/shaders/image-dithering.d.ts +64 -0
- package/dist/shaders/image-dithering.js +199 -0
- package/dist/shaders/image-dithering.js.map +7 -0
- package/dist/shaders/lens-distortion.d.ts +97 -0
- package/dist/shaders/lens-distortion.js +276 -0
- package/dist/shaders/lens-distortion.js.map +7 -0
- package/dist/shaders/liquid-metal.d.ts +89 -0
- package/dist/shaders/liquid-metal.js +633 -0
- package/dist/shaders/liquid-metal.js.map +7 -0
- package/dist/shaders/mesh-gradient.d.ts +52 -0
- package/dist/shaders/mesh-gradient.js +131 -0
- package/dist/shaders/mesh-gradient.js.map +7 -0
- package/dist/shaders/metaballs.d.ts +51 -0
- package/dist/shaders/metaballs.js +111 -0
- package/dist/shaders/metaballs.js.map +7 -0
- package/dist/shaders/neuro-noise.d.ts +47 -0
- package/dist/shaders/neuro-noise.js +77 -0
- package/dist/shaders/neuro-noise.js.map +7 -0
- package/dist/shaders/paper-texture.d.ts +109 -0
- package/dist/shaders/paper-texture.js +527 -0
- package/dist/shaders/paper-texture.js.map +7 -0
- package/dist/shaders/perlin-noise.d.ts +52 -0
- package/dist/shaders/perlin-noise.js +167 -0
- package/dist/shaders/perlin-noise.js.map +7 -0
- package/dist/shaders/pulsing-border.d.ts +98 -0
- package/dist/shaders/pulsing-border.js +239 -0
- package/dist/shaders/pulsing-border.js.map +7 -0
- package/dist/shaders/simplex-noise.d.ts +45 -0
- package/dist/shaders/simplex-noise.js +92 -0
- package/dist/shaders/simplex-noise.js.map +7 -0
- package/dist/shaders/smoke-ring.d.ts +61 -0
- package/dist/shaders/smoke-ring.js +133 -0
- package/dist/shaders/smoke-ring.js.map +7 -0
- package/dist/shaders/spiral.d.ts +61 -0
- package/dist/shaders/spiral.js +83 -0
- package/dist/shaders/spiral.js.map +7 -0
- package/dist/shaders/static-mesh-gradient.d.ts +63 -0
- package/dist/shaders/static-mesh-gradient.js +131 -0
- package/dist/shaders/static-mesh-gradient.js.map +7 -0
- package/dist/shaders/static-radial-gradient.d.ts +72 -0
- package/dist/shaders/static-radial-gradient.js +188 -0
- package/dist/shaders/static-radial-gradient.js.map +7 -0
- package/dist/shaders/swirl.d.ts +63 -0
- package/dist/shaders/swirl.js +104 -0
- package/dist/shaders/swirl.js.map +7 -0
- package/dist/shaders/voronoi.d.ts +65 -0
- package/dist/shaders/voronoi.js +139 -0
- package/dist/shaders/voronoi.js.map +7 -0
- package/dist/shaders/warp.d.ts +70 -0
- package/dist/shaders/warp.js +130 -0
- package/dist/shaders/warp.js.map +7 -0
- package/dist/shaders/water.d.ts +59 -0
- package/dist/shaders/water.js +122 -0
- package/dist/shaders/water.js.map +7 -0
- package/dist/shaders/waves.d.ts +53 -0
- package/dist/shaders/waves.js +66 -0
- package/dist/shaders/waves.js.map +7 -0
- package/dist/shared-webgl-renderer.d.ts +63 -0
- package/dist/shared-webgl-renderer.js +262 -0
- package/dist/shared-webgl-renderer.js.map +7 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +7 -0
- package/dist/vertex-shader.d.ts +2 -0
- package/dist/vertex-shader.js +160 -0
- package/dist/vertex-shader.js.map +7 -0
- package/package.json +29 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { vec4 } from '../types.js';
|
|
2
|
+
import type { ShaderMotionParams } from '../shader-mount.js';
|
|
3
|
+
import { type ShaderSizingParams, type ShaderSizingUniforms } from '../shader-sizing.js';
|
|
4
|
+
export declare const voronoiMeta: {
|
|
5
|
+
readonly maxColorCount: 5;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Anti-aliased animated Voronoi pattern with smooth and customizable edges.
|
|
9
|
+
*
|
|
10
|
+
* Double-pass Voronoi pattern cell edges.
|
|
11
|
+
* Original algorithm: https://www.shadertoy.com/view/ldl3W8
|
|
12
|
+
*
|
|
13
|
+
* Note: gaps can't be removed completely due to natural artifacts of Voronoi cells borders
|
|
14
|
+
*
|
|
15
|
+
* Fragment shader uniforms:
|
|
16
|
+
* - u_time (float): Animation time
|
|
17
|
+
* - u_scale (float): Overall zoom level, used for anti-aliasing calculations
|
|
18
|
+
* - u_colors (vec4[]): Up to 5 base cell colors in RGBA
|
|
19
|
+
* - u_colorsCount (float): Number of active colors
|
|
20
|
+
* - u_stepsPerColor (float): Number of extra colors between base colors, 1 = N colors, 2 = 2×N, etc., needs 2+ colors (1 to 3)
|
|
21
|
+
* - u_colorGlow (vec4): Color tint for radial inner shadow inside cells in RGBA, needs glow > 0
|
|
22
|
+
* - u_colorGap (vec4): Color used for cell borders/gaps in RGBA
|
|
23
|
+
* - u_distortion (float): Strength of noise-driven displacement of cell centers (0 to 0.5)
|
|
24
|
+
* - u_gap (float): Width of the border/gap between cells (0 to 0.1)
|
|
25
|
+
* - u_glow (float): Strength of the radial inner shadow inside cells, needs colorGlow alpha > 0 (0 to 1)
|
|
26
|
+
* - u_noiseTexture (sampler2D): Pre-computed randomizer source texture
|
|
27
|
+
*
|
|
28
|
+
* Vertex shader outputs (used in fragment shader):
|
|
29
|
+
* - v_patternUV (vec2): UV coordinates for pattern with global sizing (rotation, scale, offset, etc) applied
|
|
30
|
+
*
|
|
31
|
+
* Vertex shader uniforms:
|
|
32
|
+
* - u_resolution (vec2): Canvas resolution in pixels
|
|
33
|
+
* - u_pixelRatio (float): Device pixel ratio
|
|
34
|
+
* - u_originX (float): Reference point for positioning world width in the canvas (0 to 1)
|
|
35
|
+
* - u_originY (float): Reference point for positioning world height in the canvas (0 to 1)
|
|
36
|
+
* - u_worldWidth (float): Virtual width of the graphic before it's scaled to fit the canvas
|
|
37
|
+
* - u_worldHeight (float): Virtual height of the graphic before it's scaled to fit the canvas
|
|
38
|
+
* - u_fit (float): How to fit the rendered shader into the canvas dimensions (0 = none, 1 = contain, 2 = cover)
|
|
39
|
+
* - u_scale (float): Overall zoom level of the graphics (0.01 to 4)
|
|
40
|
+
* - u_rotation (float): Overall rotation angle of the graphics in degrees (0 to 360)
|
|
41
|
+
* - u_offsetX (float): Horizontal offset of the graphics center (-1 to 1)
|
|
42
|
+
* - u_offsetY (float): Vertical offset of the graphics center (-1 to 1)
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
export declare const voronoiFragmentShader: string;
|
|
46
|
+
export interface VoronoiUniforms extends ShaderSizingUniforms {
|
|
47
|
+
u_colors: vec4[];
|
|
48
|
+
u_colorsCount: number;
|
|
49
|
+
u_stepsPerColor: number;
|
|
50
|
+
u_colorGap: [number, number, number, number];
|
|
51
|
+
u_colorGlow: [number, number, number, number];
|
|
52
|
+
u_distortion: number;
|
|
53
|
+
u_gap: number;
|
|
54
|
+
u_glow: number;
|
|
55
|
+
u_noiseTexture?: HTMLImageElement;
|
|
56
|
+
}
|
|
57
|
+
export interface VoronoiParams extends ShaderSizingParams, ShaderMotionParams {
|
|
58
|
+
colors?: string[];
|
|
59
|
+
stepsPerColor?: number;
|
|
60
|
+
colorGap?: string;
|
|
61
|
+
colorGlow?: string;
|
|
62
|
+
distortion?: number;
|
|
63
|
+
gap?: number;
|
|
64
|
+
glow?: number;
|
|
65
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
2
|
+
* Paper Shaders *
|
|
3
|
+
* https://github.com/paper-design/shaders *
|
|
4
|
+
* * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
5
|
+
|
|
6
|
+
import {} from "../shader-sizing.js";
|
|
7
|
+
import { declarePI, textureRandomizerGB } from "../shader-utils.js";
|
|
8
|
+
const voronoiMeta = {
|
|
9
|
+
maxColorCount: 5
|
|
10
|
+
};
|
|
11
|
+
const voronoiFragmentShader = `#version 300 es
|
|
12
|
+
precision mediump float;
|
|
13
|
+
|
|
14
|
+
uniform float u_time;
|
|
15
|
+
|
|
16
|
+
uniform float u_scale;
|
|
17
|
+
|
|
18
|
+
uniform sampler2D u_noiseTexture;
|
|
19
|
+
|
|
20
|
+
uniform vec4 u_colors[${voronoiMeta.maxColorCount}];
|
|
21
|
+
uniform float u_colorsCount;
|
|
22
|
+
|
|
23
|
+
uniform float u_stepsPerColor;
|
|
24
|
+
uniform vec4 u_colorGlow;
|
|
25
|
+
uniform vec4 u_colorGap;
|
|
26
|
+
uniform float u_distortion;
|
|
27
|
+
uniform float u_gap;
|
|
28
|
+
uniform float u_glow;
|
|
29
|
+
|
|
30
|
+
in vec2 v_patternUV;
|
|
31
|
+
|
|
32
|
+
out vec4 fragColor;
|
|
33
|
+
|
|
34
|
+
${declarePI}
|
|
35
|
+
${textureRandomizerGB}
|
|
36
|
+
|
|
37
|
+
vec4 voronoi(vec2 x, float t) {
|
|
38
|
+
vec2 ip = floor(x);
|
|
39
|
+
vec2 fp = fract(x);
|
|
40
|
+
|
|
41
|
+
vec2 mg, mr;
|
|
42
|
+
float md = 8.;
|
|
43
|
+
float rand = 0.;
|
|
44
|
+
|
|
45
|
+
for (int j = -1; j <= 1; j++) {
|
|
46
|
+
for (int i = -1; i <= 1; i++) {
|
|
47
|
+
vec2 g = vec2(float(i), float(j));
|
|
48
|
+
vec2 o = randomGB(ip + g);
|
|
49
|
+
float raw_hash = o.x;
|
|
50
|
+
o = .5 + u_distortion * sin(t + TWO_PI * o);
|
|
51
|
+
vec2 r = g + o - fp;
|
|
52
|
+
float d = dot(r, r);
|
|
53
|
+
|
|
54
|
+
if (d < md) {
|
|
55
|
+
md = d;
|
|
56
|
+
mr = r;
|
|
57
|
+
mg = g;
|
|
58
|
+
rand = raw_hash;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
md = 8.;
|
|
64
|
+
for (int j = -2; j <= 2; j++) {
|
|
65
|
+
for (int i = -2; i <= 2; i++) {
|
|
66
|
+
vec2 g = mg + vec2(float(i), float(j));
|
|
67
|
+
vec2 o = randomGB(ip + g);
|
|
68
|
+
o = .5 + u_distortion * sin(t + TWO_PI * o);
|
|
69
|
+
vec2 r = g + o - fp;
|
|
70
|
+
if (dot(mr - r, mr - r) > .00001) {
|
|
71
|
+
md = min(md, dot(.5 * (mr + r), normalize(r - mr)));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return vec4(md, mr, rand);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
void main() {
|
|
80
|
+
vec2 shape_uv = v_patternUV;
|
|
81
|
+
shape_uv *= 1.25;
|
|
82
|
+
|
|
83
|
+
float t = u_time;
|
|
84
|
+
|
|
85
|
+
vec4 voronoiRes = voronoi(shape_uv, t);
|
|
86
|
+
|
|
87
|
+
float shape = clamp(voronoiRes.w, 0., 1.);
|
|
88
|
+
float mixer = shape * (u_colorsCount - 1.);
|
|
89
|
+
mixer = (shape - .5 / u_colorsCount) * u_colorsCount;
|
|
90
|
+
float steps = max(1., u_stepsPerColor);
|
|
91
|
+
|
|
92
|
+
vec4 gradient = u_colors[0];
|
|
93
|
+
gradient.rgb *= gradient.a;
|
|
94
|
+
for (int i = 1; i < ${voronoiMeta.maxColorCount}; i++) {
|
|
95
|
+
if (i >= int(u_colorsCount)) break;
|
|
96
|
+
float localT = clamp(mixer - float(i - 1), 0.0, 1.0);
|
|
97
|
+
localT = round(localT * steps) / steps;
|
|
98
|
+
vec4 c = u_colors[i];
|
|
99
|
+
c.rgb *= c.a;
|
|
100
|
+
gradient = mix(gradient, c, localT);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if ((mixer < 0.) || (mixer > (u_colorsCount - 1.))) {
|
|
104
|
+
float localT = mixer + 1.;
|
|
105
|
+
if (mixer > (u_colorsCount - 1.)) {
|
|
106
|
+
localT = mixer - (u_colorsCount - 1.);
|
|
107
|
+
}
|
|
108
|
+
localT = round(localT * steps) / steps;
|
|
109
|
+
vec4 cFst = u_colors[0];
|
|
110
|
+
cFst.rgb *= cFst.a;
|
|
111
|
+
vec4 cLast = u_colors[int(u_colorsCount - 1.)];
|
|
112
|
+
cLast.rgb *= cLast.a;
|
|
113
|
+
gradient = mix(cLast, cFst, localT);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
vec3 cellColor = gradient.rgb;
|
|
117
|
+
float cellOpacity = gradient.a;
|
|
118
|
+
|
|
119
|
+
float glows = length(voronoiRes.yz * u_glow);
|
|
120
|
+
glows = pow(glows, 1.5);
|
|
121
|
+
|
|
122
|
+
vec3 color = mix(cellColor, u_colorGlow.rgb * u_colorGlow.a, u_colorGlow.a * glows);
|
|
123
|
+
float opacity = cellOpacity + u_colorGlow.a * glows;
|
|
124
|
+
|
|
125
|
+
float edge = voronoiRes.x;
|
|
126
|
+
float smoothEdge = .02 / (2. * u_scale) * (1. + .5 * u_gap);
|
|
127
|
+
edge = smoothstep(u_gap - smoothEdge, u_gap + smoothEdge, edge);
|
|
128
|
+
|
|
129
|
+
color = mix(u_colorGap.rgb * u_colorGap.a, color, edge);
|
|
130
|
+
opacity = mix(u_colorGap.a, opacity, edge);
|
|
131
|
+
|
|
132
|
+
fragColor = vec4(color, opacity);
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
135
|
+
export {
|
|
136
|
+
voronoiFragmentShader,
|
|
137
|
+
voronoiMeta
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=voronoi.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shaders/voronoi.ts"],
|
|
4
|
+
"sourcesContent": ["import type { vec4 } from '../types.js';\r\nimport type { ShaderMotionParams } from '../shader-mount.js';\r\nimport { type ShaderSizingParams, type ShaderSizingUniforms } from '../shader-sizing.js';\r\nimport { declarePI, textureRandomizerGB } from '../shader-utils.js';\r\n\r\nexport const voronoiMeta = {\r\n maxColorCount: 5,\r\n} as const;\r\n\r\n/**\r\n * Anti-aliased animated Voronoi pattern with smooth and customizable edges.\r\n *\r\n * Double-pass Voronoi pattern cell edges.\r\n * Original algorithm: https://www.shadertoy.com/view/ldl3W8\r\n *\r\n * Note: gaps can't be removed completely due to natural artifacts of Voronoi cells borders\r\n *\r\n * Fragment shader uniforms:\r\n * - u_time (float): Animation time\r\n * - u_scale (float): Overall zoom level, used for anti-aliasing calculations\r\n * - u_colors (vec4[]): Up to 5 base cell colors in RGBA\r\n * - u_colorsCount (float): Number of active colors\r\n * - u_stepsPerColor (float): Number of extra colors between base colors, 1 = N colors, 2 = 2\u00D7N, etc., needs 2+ colors (1 to 3)\r\n * - u_colorGlow (vec4): Color tint for radial inner shadow inside cells in RGBA, needs glow > 0\r\n * - u_colorGap (vec4): Color used for cell borders/gaps in RGBA\r\n * - u_distortion (float): Strength of noise-driven displacement of cell centers (0 to 0.5)\r\n * - u_gap (float): Width of the border/gap between cells (0 to 0.1)\r\n * - u_glow (float): Strength of the radial inner shadow inside cells, needs colorGlow alpha > 0 (0 to 1)\r\n * - u_noiseTexture (sampler2D): Pre-computed randomizer source texture\r\n *\r\n * Vertex shader outputs (used in fragment shader):\r\n * - v_patternUV (vec2): UV coordinates for pattern with global sizing (rotation, scale, offset, etc) applied\r\n *\r\n * Vertex shader uniforms:\r\n * - u_resolution (vec2): Canvas resolution in pixels\r\n * - u_pixelRatio (float): Device pixel ratio\r\n * - u_originX (float): Reference point for positioning world width in the canvas (0 to 1)\r\n * - u_originY (float): Reference point for positioning world height in the canvas (0 to 1)\r\n * - u_worldWidth (float): Virtual width of the graphic before it's scaled to fit the canvas\r\n * - u_worldHeight (float): Virtual height of the graphic before it's scaled to fit the canvas\r\n * - u_fit (float): How to fit the rendered shader into the canvas dimensions (0 = none, 1 = contain, 2 = cover)\r\n * - u_scale (float): Overall zoom level of the graphics (0.01 to 4)\r\n * - u_rotation (float): Overall rotation angle of the graphics in degrees (0 to 360)\r\n * - u_offsetX (float): Horizontal offset of the graphics center (-1 to 1)\r\n * - u_offsetY (float): Vertical offset of the graphics center (-1 to 1)\r\n *\r\n */\r\n\r\n// language=GLSL\r\nexport const voronoiFragmentShader: string = `#version 300 es\r\nprecision mediump float;\r\n\r\nuniform float u_time;\r\n\r\nuniform float u_scale;\r\n\r\nuniform sampler2D u_noiseTexture;\r\n\r\nuniform vec4 u_colors[${ voronoiMeta.maxColorCount }];\r\nuniform float u_colorsCount;\r\n\r\nuniform float u_stepsPerColor;\r\nuniform vec4 u_colorGlow;\r\nuniform vec4 u_colorGap;\r\nuniform float u_distortion;\r\nuniform float u_gap;\r\nuniform float u_glow;\r\n\r\nin vec2 v_patternUV;\r\n\r\nout vec4 fragColor;\r\n\r\n${ declarePI }\r\n${ textureRandomizerGB }\r\n\r\nvec4 voronoi(vec2 x, float t) {\r\n vec2 ip = floor(x);\r\n vec2 fp = fract(x);\r\n\r\n vec2 mg, mr;\r\n float md = 8.;\r\n float rand = 0.;\r\n\r\n for (int j = -1; j <= 1; j++) {\r\n for (int i = -1; i <= 1; i++) {\r\n vec2 g = vec2(float(i), float(j));\r\n vec2 o = randomGB(ip + g);\r\n float raw_hash = o.x;\r\n o = .5 + u_distortion * sin(t + TWO_PI * o);\r\n vec2 r = g + o - fp;\r\n float d = dot(r, r);\r\n\r\n if (d < md) {\r\n md = d;\r\n mr = r;\r\n mg = g;\r\n rand = raw_hash;\r\n }\r\n }\r\n }\r\n\r\n md = 8.;\r\n for (int j = -2; j <= 2; j++) {\r\n for (int i = -2; i <= 2; i++) {\r\n vec2 g = mg + vec2(float(i), float(j));\r\n vec2 o = randomGB(ip + g);\r\n o = .5 + u_distortion * sin(t + TWO_PI * o);\r\n vec2 r = g + o - fp;\r\n if (dot(mr - r, mr - r) > .00001) {\r\n md = min(md, dot(.5 * (mr + r), normalize(r - mr)));\r\n }\r\n }\r\n }\r\n\r\n return vec4(md, mr, rand);\r\n}\r\n\r\nvoid main() {\r\n vec2 shape_uv = v_patternUV;\r\n shape_uv *= 1.25;\r\n\r\n float t = u_time;\r\n\r\n vec4 voronoiRes = voronoi(shape_uv, t);\r\n\r\n float shape = clamp(voronoiRes.w, 0., 1.);\r\n float mixer = shape * (u_colorsCount - 1.);\r\n mixer = (shape - .5 / u_colorsCount) * u_colorsCount;\r\n float steps = max(1., u_stepsPerColor);\r\n\r\n vec4 gradient = u_colors[0];\r\n gradient.rgb *= gradient.a;\r\n for (int i = 1; i < ${ voronoiMeta.maxColorCount }; i++) {\r\n if (i >= int(u_colorsCount)) break;\r\n float localT = clamp(mixer - float(i - 1), 0.0, 1.0);\r\n localT = round(localT * steps) / steps;\r\n vec4 c = u_colors[i];\r\n c.rgb *= c.a;\r\n gradient = mix(gradient, c, localT);\r\n }\r\n\r\n if ((mixer < 0.) || (mixer > (u_colorsCount - 1.))) {\r\n float localT = mixer + 1.;\r\n if (mixer > (u_colorsCount - 1.)) {\r\n localT = mixer - (u_colorsCount - 1.);\r\n }\r\n localT = round(localT * steps) / steps;\r\n vec4 cFst = u_colors[0];\r\n cFst.rgb *= cFst.a;\r\n vec4 cLast = u_colors[int(u_colorsCount - 1.)];\r\n cLast.rgb *= cLast.a;\r\n gradient = mix(cLast, cFst, localT);\r\n }\r\n\r\n vec3 cellColor = gradient.rgb;\r\n float cellOpacity = gradient.a;\r\n\r\n float glows = length(voronoiRes.yz * u_glow);\r\n glows = pow(glows, 1.5);\r\n\r\n vec3 color = mix(cellColor, u_colorGlow.rgb * u_colorGlow.a, u_colorGlow.a * glows);\r\n float opacity = cellOpacity + u_colorGlow.a * glows;\r\n\r\n float edge = voronoiRes.x;\r\n float smoothEdge = .02 / (2. * u_scale) * (1. + .5 * u_gap);\r\n edge = smoothstep(u_gap - smoothEdge, u_gap + smoothEdge, edge);\r\n\r\n color = mix(u_colorGap.rgb * u_colorGap.a, color, edge);\r\n opacity = mix(u_colorGap.a, opacity, edge);\r\n\r\n fragColor = vec4(color, opacity);\r\n}\r\n`;\r\n\r\nexport interface VoronoiUniforms extends ShaderSizingUniforms {\r\n u_colors: vec4[];\r\n u_colorsCount: number;\r\n u_stepsPerColor: number;\r\n u_colorGap: [number, number, number, number];\r\n u_colorGlow: [number, number, number, number];\r\n u_distortion: number;\r\n u_gap: number;\r\n u_glow: number;\r\n u_noiseTexture?: HTMLImageElement;\r\n}\r\n\r\nexport interface VoronoiParams extends ShaderSizingParams, ShaderMotionParams {\r\n colors?: string[];\r\n stepsPerColor?: number;\r\n colorGap?: string;\r\n colorGlow?: string;\r\n distortion?: number;\r\n gap?: number;\r\n glow?: number;\r\n}\r\n"],
|
|
5
|
+
"mappings": ";;;;;AAEA,eAAmE;AACnE,SAAS,WAAW,2BAA2B;AAExC,MAAM,cAAc;AAAA,EACzB,eAAe;AACjB;AA0CO,MAAM,wBAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASpB,YAAY,aAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAchD,SAAU;AAAA,EACV,mBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBA2DE,YAAY,aAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { vec4 } from '../types.js';
|
|
2
|
+
import type { ShaderMotionParams } from '../shader-mount.js';
|
|
3
|
+
import { type ShaderSizingParams, type ShaderSizingUniforms } from '../shader-sizing.js';
|
|
4
|
+
export declare const warpMeta: {
|
|
5
|
+
readonly maxColorCount: 10;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Animated color fields warped by noise and swirls, applied over base patterns
|
|
9
|
+
* (checks, stripes, or split edge). Blends up to 10 colors with adjustable distribution,
|
|
10
|
+
* softness, distortion, and swirl. Great for fluid, smoky, or marbled effects.
|
|
11
|
+
*
|
|
12
|
+
* Fragment shader uniforms:
|
|
13
|
+
* - u_time (float): Animation time
|
|
14
|
+
* - u_colors (vec4[]): Up to 10 gradient colors in RGBA
|
|
15
|
+
* - u_colorsCount (float): Number of active colors
|
|
16
|
+
* - u_proportion (float): Blend point between colors, 0.5 = equal distribution (0 to 1)
|
|
17
|
+
* - u_softness (float): Color transition sharpness, 0 = hard edge, 1 = smooth gradient (0 to 1)
|
|
18
|
+
* - u_shape (float): Base pattern type (0 = checks, 1 = stripes, 2 = edge)
|
|
19
|
+
* - u_shapeScale (float): Zoom level of the base pattern (0 to 1)
|
|
20
|
+
* - u_distortion (float): Strength of noise-based distortion (0 to 1)
|
|
21
|
+
* - u_swirl (float): Strength of the swirl distortion, needs swirlIterations > 1 (0 to 1)
|
|
22
|
+
* - u_swirlIterations (float): Number of layered swirl passes as an integer, needs swirl > 0 (2 to 20)
|
|
23
|
+
* - u_noiseTexture (sampler2D): Pre-computed randomizer source texture
|
|
24
|
+
*
|
|
25
|
+
* Vertex shader outputs (used in fragment shader):
|
|
26
|
+
* - v_patternUV (vec2): UV coordinates for pattern with global sizing (rotation, scale, offset, etc) applied
|
|
27
|
+
*
|
|
28
|
+
* Vertex shader uniforms:
|
|
29
|
+
* - u_resolution (vec2): Canvas resolution in pixels
|
|
30
|
+
* - u_pixelRatio (float): Device pixel ratio
|
|
31
|
+
* - u_originX (float): Reference point for positioning world width in the canvas (0 to 1)
|
|
32
|
+
* - u_originY (float): Reference point for positioning world height in the canvas (0 to 1)
|
|
33
|
+
* - u_worldWidth (float): Virtual width of the graphic before it's scaled to fit the canvas
|
|
34
|
+
* - u_worldHeight (float): Virtual height of the graphic before it's scaled to fit the canvas
|
|
35
|
+
* - u_fit (float): How to fit the rendered shader into the canvas dimensions (0 = none, 1 = contain, 2 = cover)
|
|
36
|
+
* - u_scale (float): Overall zoom level of the graphics (0.01 to 4)
|
|
37
|
+
* - u_rotation (float): Overall rotation angle of the graphics in degrees (0 to 360)
|
|
38
|
+
* - u_offsetX (float): Horizontal offset of the graphics center (-1 to 1)
|
|
39
|
+
* - u_offsetY (float): Vertical offset of the graphics center (-1 to 1)
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
export declare const warpFragmentShader: string;
|
|
43
|
+
export interface WarpUniforms extends ShaderSizingUniforms {
|
|
44
|
+
u_colors: vec4[];
|
|
45
|
+
u_colorsCount: number;
|
|
46
|
+
u_proportion: number;
|
|
47
|
+
u_softness: number;
|
|
48
|
+
u_shape: (typeof WarpPatterns)[WarpPattern];
|
|
49
|
+
u_shapeScale: number;
|
|
50
|
+
u_distortion: number;
|
|
51
|
+
u_swirl: number;
|
|
52
|
+
u_swirlIterations: number;
|
|
53
|
+
u_noiseTexture?: HTMLImageElement;
|
|
54
|
+
}
|
|
55
|
+
export interface WarpParams extends ShaderSizingParams, ShaderMotionParams {
|
|
56
|
+
colors?: string[];
|
|
57
|
+
proportion?: number;
|
|
58
|
+
softness?: number;
|
|
59
|
+
shape?: WarpPattern;
|
|
60
|
+
shapeScale?: number;
|
|
61
|
+
distortion?: number;
|
|
62
|
+
swirl?: number;
|
|
63
|
+
swirlIterations?: number;
|
|
64
|
+
}
|
|
65
|
+
export declare const WarpPatterns: {
|
|
66
|
+
readonly checks: 0;
|
|
67
|
+
readonly stripes: 1;
|
|
68
|
+
readonly edge: 2;
|
|
69
|
+
};
|
|
70
|
+
export type WarpPattern = keyof typeof WarpPatterns;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
2
|
+
* Paper Shaders *
|
|
3
|
+
* https://github.com/paper-design/shaders *
|
|
4
|
+
* * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
5
|
+
|
|
6
|
+
import {} from "../shader-sizing.js";
|
|
7
|
+
import { declarePI, rotation2, colorBandingFix } from "../shader-utils.js";
|
|
8
|
+
const warpMeta = {
|
|
9
|
+
maxColorCount: 10
|
|
10
|
+
};
|
|
11
|
+
const warpFragmentShader = `#version 300 es
|
|
12
|
+
precision mediump float;
|
|
13
|
+
|
|
14
|
+
uniform float u_time;
|
|
15
|
+
|
|
16
|
+
uniform sampler2D u_noiseTexture;
|
|
17
|
+
|
|
18
|
+
uniform vec4 u_colors[${warpMeta.maxColorCount}];
|
|
19
|
+
uniform float u_colorsCount;
|
|
20
|
+
uniform float u_proportion;
|
|
21
|
+
uniform float u_softness;
|
|
22
|
+
uniform float u_shape;
|
|
23
|
+
uniform float u_shapeScale;
|
|
24
|
+
uniform float u_distortion;
|
|
25
|
+
uniform float u_swirl;
|
|
26
|
+
uniform float u_swirlIterations;
|
|
27
|
+
|
|
28
|
+
in vec2 v_patternUV;
|
|
29
|
+
|
|
30
|
+
out vec4 fragColor;
|
|
31
|
+
|
|
32
|
+
${declarePI}
|
|
33
|
+
${rotation2}
|
|
34
|
+
float randomG(vec2 p) {
|
|
35
|
+
vec2 uv = floor(p) / 100. + .5;
|
|
36
|
+
return texture(u_noiseTexture, fract(uv)).g;
|
|
37
|
+
}
|
|
38
|
+
float valueNoise(vec2 st) {
|
|
39
|
+
vec2 i = floor(st);
|
|
40
|
+
vec2 f = fract(st);
|
|
41
|
+
float a = randomG(i);
|
|
42
|
+
float b = randomG(i + vec2(1.0, 0.0));
|
|
43
|
+
float c = randomG(i + vec2(0.0, 1.0));
|
|
44
|
+
float d = randomG(i + vec2(1.0, 1.0));
|
|
45
|
+
vec2 u = f * f * (3.0 - 2.0 * f);
|
|
46
|
+
float x1 = mix(a, b, u.x);
|
|
47
|
+
float x2 = mix(c, d, u.x);
|
|
48
|
+
return mix(x1, x2, u.y);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
void main() {
|
|
53
|
+
vec2 uv = v_patternUV;
|
|
54
|
+
uv *= .5;
|
|
55
|
+
|
|
56
|
+
const float firstFrameOffset = 118.;
|
|
57
|
+
float t = 0.0625 * (u_time + firstFrameOffset);
|
|
58
|
+
|
|
59
|
+
float n1 = valueNoise(uv * 1. + t);
|
|
60
|
+
float n2 = valueNoise(uv * 2. - t);
|
|
61
|
+
float angle = n1 * TWO_PI;
|
|
62
|
+
uv.x += 4. * u_distortion * n2 * cos(angle);
|
|
63
|
+
uv.y += 4. * u_distortion * n2 * sin(angle);
|
|
64
|
+
|
|
65
|
+
float swirl = u_swirl;
|
|
66
|
+
for (int i = 1; i <= 20; i++) {
|
|
67
|
+
if (i >= int(u_swirlIterations)) break;
|
|
68
|
+
float iFloat = float(i);
|
|
69
|
+
uv.x += swirl / iFloat * cos(t + iFloat * 1.5 * uv.y);
|
|
70
|
+
uv.y += swirl / iFloat * cos(t + iFloat * 1. * uv.x);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
float proportion = clamp(u_proportion, 0., 1.);
|
|
74
|
+
|
|
75
|
+
float shape = 0.;
|
|
76
|
+
if (u_shape < .5) {
|
|
77
|
+
vec2 checksShape_uv = uv * (.5 + 3.5 * u_shapeScale);
|
|
78
|
+
shape = .5 + .5 * sin(checksShape_uv.x) * cos(checksShape_uv.y);
|
|
79
|
+
shape += .48 * sign(proportion - .5) * pow(abs(proportion - .5), .5);
|
|
80
|
+
} else if (u_shape < 1.5) {
|
|
81
|
+
vec2 stripesShape_uv = uv * (2. * u_shapeScale);
|
|
82
|
+
float f = fract(stripesShape_uv.y);
|
|
83
|
+
shape = smoothstep(.0, .55, f) * (1.0 - smoothstep(.45, 1., f));
|
|
84
|
+
shape += .48 * sign(proportion - .5) * pow(abs(proportion - .5), .5);
|
|
85
|
+
} else {
|
|
86
|
+
float shapeScaling = 5. * (1. - u_shapeScale);
|
|
87
|
+
float e0 = 0.45 - shapeScaling;
|
|
88
|
+
float e1 = 0.55 + shapeScaling;
|
|
89
|
+
shape = smoothstep(min(e0, e1), max(e0, e1), 1.0 - uv.y + 0.3 * (proportion - 0.5));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
float mixer = shape * (u_colorsCount - 1.);
|
|
93
|
+
vec4 gradient = u_colors[0];
|
|
94
|
+
gradient.rgb *= gradient.a;
|
|
95
|
+
float aa = fwidth(shape);
|
|
96
|
+
for (int i = 1; i < ${warpMeta.maxColorCount}; i++) {
|
|
97
|
+
if (i >= int(u_colorsCount)) break;
|
|
98
|
+
float m = clamp(mixer - float(i - 1), 0.0, 1.0);
|
|
99
|
+
|
|
100
|
+
float localMixerStart = floor(m);
|
|
101
|
+
float softness = .5 * u_softness + fwidth(m);
|
|
102
|
+
float smoothed = smoothstep(max(0., .5 - softness - aa), min(1., .5 + softness + aa), m - localMixerStart);
|
|
103
|
+
float stepped = localMixerStart + smoothed;
|
|
104
|
+
|
|
105
|
+
m = mix(stepped, m, u_softness);
|
|
106
|
+
|
|
107
|
+
vec4 c = u_colors[i];
|
|
108
|
+
c.rgb *= c.a;
|
|
109
|
+
gradient = mix(gradient, c, m);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
vec3 color = gradient.rgb;
|
|
113
|
+
float opacity = gradient.a;
|
|
114
|
+
|
|
115
|
+
${colorBandingFix}
|
|
116
|
+
|
|
117
|
+
fragColor = vec4(color, opacity);
|
|
118
|
+
}
|
|
119
|
+
`;
|
|
120
|
+
const WarpPatterns = {
|
|
121
|
+
checks: 0,
|
|
122
|
+
stripes: 1,
|
|
123
|
+
edge: 2
|
|
124
|
+
};
|
|
125
|
+
export {
|
|
126
|
+
WarpPatterns,
|
|
127
|
+
warpFragmentShader,
|
|
128
|
+
warpMeta
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=warp.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shaders/warp.ts"],
|
|
4
|
+
"sourcesContent": ["import type { vec4 } from '../types.js';\r\nimport type { ShaderMotionParams } from '../shader-mount.js';\r\nimport { type ShaderSizingParams, type ShaderSizingUniforms } from '../shader-sizing.js';\r\nimport { declarePI, rotation2, colorBandingFix } from '../shader-utils.js';\r\n\r\nexport const warpMeta = {\r\n maxColorCount: 10,\r\n} as const;\r\n\r\n/**\r\n * Animated color fields warped by noise and swirls, applied over base patterns\r\n * (checks, stripes, or split edge). Blends up to 10 colors with adjustable distribution,\r\n * softness, distortion, and swirl. Great for fluid, smoky, or marbled effects.\r\n *\r\n * Fragment shader uniforms:\r\n * - u_time (float): Animation time\r\n * - u_colors (vec4[]): Up to 10 gradient colors in RGBA\r\n * - u_colorsCount (float): Number of active colors\r\n * - u_proportion (float): Blend point between colors, 0.5 = equal distribution (0 to 1)\r\n * - u_softness (float): Color transition sharpness, 0 = hard edge, 1 = smooth gradient (0 to 1)\r\n * - u_shape (float): Base pattern type (0 = checks, 1 = stripes, 2 = edge)\r\n * - u_shapeScale (float): Zoom level of the base pattern (0 to 1)\r\n * - u_distortion (float): Strength of noise-based distortion (0 to 1)\r\n * - u_swirl (float): Strength of the swirl distortion, needs swirlIterations > 1 (0 to 1)\r\n * - u_swirlIterations (float): Number of layered swirl passes as an integer, needs swirl > 0 (2 to 20)\r\n * - u_noiseTexture (sampler2D): Pre-computed randomizer source texture\r\n *\r\n * Vertex shader outputs (used in fragment shader):\r\n * - v_patternUV (vec2): UV coordinates for pattern with global sizing (rotation, scale, offset, etc) applied\r\n *\r\n * Vertex shader uniforms:\r\n * - u_resolution (vec2): Canvas resolution in pixels\r\n * - u_pixelRatio (float): Device pixel ratio\r\n * - u_originX (float): Reference point for positioning world width in the canvas (0 to 1)\r\n * - u_originY (float): Reference point for positioning world height in the canvas (0 to 1)\r\n * - u_worldWidth (float): Virtual width of the graphic before it's scaled to fit the canvas\r\n * - u_worldHeight (float): Virtual height of the graphic before it's scaled to fit the canvas\r\n * - u_fit (float): How to fit the rendered shader into the canvas dimensions (0 = none, 1 = contain, 2 = cover)\r\n * - u_scale (float): Overall zoom level of the graphics (0.01 to 4)\r\n * - u_rotation (float): Overall rotation angle of the graphics in degrees (0 to 360)\r\n * - u_offsetX (float): Horizontal offset of the graphics center (-1 to 1)\r\n * - u_offsetY (float): Vertical offset of the graphics center (-1 to 1)\r\n *\r\n */\r\n\r\n// language=GLSL\r\nexport const warpFragmentShader: string = `#version 300 es\r\nprecision mediump float;\r\n\r\nuniform float u_time;\r\n\r\nuniform sampler2D u_noiseTexture;\r\n\r\nuniform vec4 u_colors[${ warpMeta.maxColorCount }];\r\nuniform float u_colorsCount;\r\nuniform float u_proportion;\r\nuniform float u_softness;\r\nuniform float u_shape;\r\nuniform float u_shapeScale;\r\nuniform float u_distortion;\r\nuniform float u_swirl;\r\nuniform float u_swirlIterations;\r\n\r\nin vec2 v_patternUV;\r\n\r\nout vec4 fragColor;\r\n\r\n${ declarePI }\r\n${ rotation2 }\r\nfloat randomG(vec2 p) {\r\n vec2 uv = floor(p) / 100. + .5;\r\n return texture(u_noiseTexture, fract(uv)).g;\r\n}\r\nfloat valueNoise(vec2 st) {\r\n vec2 i = floor(st);\r\n vec2 f = fract(st);\r\n float a = randomG(i);\r\n float b = randomG(i + vec2(1.0, 0.0));\r\n float c = randomG(i + vec2(0.0, 1.0));\r\n float d = randomG(i + vec2(1.0, 1.0));\r\n vec2 u = f * f * (3.0 - 2.0 * f);\r\n float x1 = mix(a, b, u.x);\r\n float x2 = mix(c, d, u.x);\r\n return mix(x1, x2, u.y);\r\n}\r\n\r\n\r\nvoid main() {\r\n vec2 uv = v_patternUV;\r\n uv *= .5;\r\n\r\n const float firstFrameOffset = 118.;\r\n float t = 0.0625 * (u_time + firstFrameOffset);\r\n\r\n float n1 = valueNoise(uv * 1. + t);\r\n float n2 = valueNoise(uv * 2. - t);\r\n float angle = n1 * TWO_PI;\r\n uv.x += 4. * u_distortion * n2 * cos(angle);\r\n uv.y += 4. * u_distortion * n2 * sin(angle);\r\n\r\n float swirl = u_swirl;\r\n for (int i = 1; i <= 20; i++) {\r\n if (i >= int(u_swirlIterations)) break;\r\n float iFloat = float(i);\r\n uv.x += swirl / iFloat * cos(t + iFloat * 1.5 * uv.y);\r\n uv.y += swirl / iFloat * cos(t + iFloat * 1. * uv.x);\r\n }\r\n\r\n float proportion = clamp(u_proportion, 0., 1.);\r\n\r\n float shape = 0.;\r\n if (u_shape < .5) {\r\n vec2 checksShape_uv = uv * (.5 + 3.5 * u_shapeScale);\r\n shape = .5 + .5 * sin(checksShape_uv.x) * cos(checksShape_uv.y);\r\n shape += .48 * sign(proportion - .5) * pow(abs(proportion - .5), .5);\r\n } else if (u_shape < 1.5) {\r\n vec2 stripesShape_uv = uv * (2. * u_shapeScale);\r\n float f = fract(stripesShape_uv.y);\r\n shape = smoothstep(.0, .55, f) * (1.0 - smoothstep(.45, 1., f));\r\n shape += .48 * sign(proportion - .5) * pow(abs(proportion - .5), .5);\r\n } else {\r\n float shapeScaling = 5. * (1. - u_shapeScale);\r\n float e0 = 0.45 - shapeScaling;\r\n float e1 = 0.55 + shapeScaling;\r\n shape = smoothstep(min(e0, e1), max(e0, e1), 1.0 - uv.y + 0.3 * (proportion - 0.5));\r\n }\r\n\r\n float mixer = shape * (u_colorsCount - 1.);\r\n vec4 gradient = u_colors[0];\r\n gradient.rgb *= gradient.a;\r\n float aa = fwidth(shape);\r\n for (int i = 1; i < ${ warpMeta.maxColorCount }; i++) {\r\n if (i >= int(u_colorsCount)) break;\r\n float m = clamp(mixer - float(i - 1), 0.0, 1.0);\r\n\r\n float localMixerStart = floor(m);\r\n float softness = .5 * u_softness + fwidth(m);\r\n float smoothed = smoothstep(max(0., .5 - softness - aa), min(1., .5 + softness + aa), m - localMixerStart);\r\n float stepped = localMixerStart + smoothed;\r\n\r\n m = mix(stepped, m, u_softness);\r\n\r\n vec4 c = u_colors[i];\r\n c.rgb *= c.a;\r\n gradient = mix(gradient, c, m);\r\n }\r\n\r\n vec3 color = gradient.rgb;\r\n float opacity = gradient.a;\r\n\r\n ${ colorBandingFix }\r\n\r\n fragColor = vec4(color, opacity);\r\n}\r\n`;\r\n\r\nexport interface WarpUniforms extends ShaderSizingUniforms {\r\n u_colors: vec4[];\r\n u_colorsCount: number;\r\n u_proportion: number;\r\n u_softness: number;\r\n u_shape: (typeof WarpPatterns)[WarpPattern];\r\n u_shapeScale: number;\r\n u_distortion: number;\r\n u_swirl: number;\r\n u_swirlIterations: number;\r\n u_noiseTexture?: HTMLImageElement;\r\n}\r\n\r\nexport interface WarpParams extends ShaderSizingParams, ShaderMotionParams {\r\n colors?: string[];\r\n proportion?: number;\r\n softness?: number;\r\n shape?: WarpPattern;\r\n shapeScale?: number;\r\n distortion?: number;\r\n swirl?: number;\r\n swirlIterations?: number;\r\n}\r\n\r\nexport const WarpPatterns = {\r\n checks: 0,\r\n stripes: 1,\r\n edge: 2,\r\n} as const;\r\n\r\nexport type WarpPattern = keyof typeof WarpPatterns;\r\n"],
|
|
5
|
+
"mappings": ";;;;;AAEA,eAAmE;AACnE,SAAS,WAAW,WAAW,uBAAuB;AAE/C,MAAM,WAAW;AAAA,EACtB,eAAe;AACjB;AAuCO,MAAM,qBAA6B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAOjB,SAAS,aAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAc7C,SAAU;AAAA,EACV,SAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBA+DY,SAAS,aAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAmB3C,eAAgB;AAAA;AAAA;AAAA;AAAA;AA8Bd,MAAM,eAAe;AAAA,EAC1B,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ShaderMotionParams } from '../shader-mount.js';
|
|
2
|
+
import { type ShaderSizingParams, type ShaderSizingUniforms } from '../shader-sizing.js';
|
|
3
|
+
/**
|
|
4
|
+
* Water-like surface distortion with natural caustic realism. Works as an image filter or standalone animated texture.
|
|
5
|
+
*
|
|
6
|
+
* Fragment shader uniforms:
|
|
7
|
+
* - u_time (float): Animation time
|
|
8
|
+
* - u_image (sampler2D): Optional source image texture
|
|
9
|
+
* - u_imageAspectRatio (float): Aspect ratio of the source image
|
|
10
|
+
* - u_colorBack (vec4): Background color in RGBA
|
|
11
|
+
* - u_colorHighlight (vec4): Highlight color in RGBA, needs highlights > 0
|
|
12
|
+
* - u_highlights (float): Coloring added over image/background following caustic shape, needs colorHighlight alpha > 0 (0 to 1)
|
|
13
|
+
* - u_layering (float): Power of 2nd layer of caustic distortion, needs caustic or highlights > 0 (0 to 1)
|
|
14
|
+
* - u_edges (float): Caustic distortion power on the image edges, needs image and caustic > 0 (0 to 1)
|
|
15
|
+
* - u_waves (float): Additional distortion based on simplex noise, independent from caustic (0 to 1)
|
|
16
|
+
* - u_caustic (float): Power of caustic distortion, needs image (0 to 1)
|
|
17
|
+
* - u_size (float): Pattern scale relative to the image (0.01 to 7)
|
|
18
|
+
*
|
|
19
|
+
* Vertex shader outputs (used in fragment shader):
|
|
20
|
+
* - v_imageUV (vec2): UV coordinates for sampling the source image, with fit, scale, rotation, and offset applied
|
|
21
|
+
*
|
|
22
|
+
* Vertex shader uniforms:
|
|
23
|
+
* - u_resolution (vec2): Canvas resolution in pixels
|
|
24
|
+
* - u_pixelRatio (float): Device pixel ratio
|
|
25
|
+
* - u_originX (float): Reference point for positioning world width in the canvas (0 to 1)
|
|
26
|
+
* - u_originY (float): Reference point for positioning world height in the canvas (0 to 1)
|
|
27
|
+
* - u_worldWidth (float): Virtual width of the graphic before it's scaled to fit the canvas
|
|
28
|
+
* - u_worldHeight (float): Virtual height of the graphic before it's scaled to fit the canvas
|
|
29
|
+
* - u_fit (float): How to fit the rendered shader into the canvas dimensions (0 = none, 1 = contain, 2 = cover)
|
|
30
|
+
* - u_scale (float): Overall zoom level of the graphics (0.1 to 4)
|
|
31
|
+
* - u_rotation (float): Overall rotation angle of the graphics in degrees (0 to 360)
|
|
32
|
+
* - u_offsetX (float): Horizontal offset of the graphics center (-1 to 1)
|
|
33
|
+
* - u_offsetY (float): Vertical offset of the graphics center (-1 to 1)
|
|
34
|
+
* - u_imageAspectRatio (float): Aspect ratio of the source image
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
export declare const waterFragmentShader: string;
|
|
38
|
+
export interface WaterUniforms extends ShaderSizingUniforms {
|
|
39
|
+
u_image: HTMLImageElement | string | undefined;
|
|
40
|
+
u_colorBack: [number, number, number, number];
|
|
41
|
+
u_colorHighlight: [number, number, number, number];
|
|
42
|
+
u_highlights: number;
|
|
43
|
+
u_layering: number;
|
|
44
|
+
u_edges: number;
|
|
45
|
+
u_caustic: number;
|
|
46
|
+
u_waves: number;
|
|
47
|
+
u_size: number;
|
|
48
|
+
}
|
|
49
|
+
export interface WaterParams extends ShaderSizingParams, ShaderMotionParams {
|
|
50
|
+
image?: HTMLImageElement | string;
|
|
51
|
+
colorBack?: string;
|
|
52
|
+
colorHighlight?: string;
|
|
53
|
+
highlights?: number;
|
|
54
|
+
layering?: number;
|
|
55
|
+
edges?: number;
|
|
56
|
+
caustic?: number;
|
|
57
|
+
waves?: number;
|
|
58
|
+
size?: number;
|
|
59
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
2
|
+
* Paper Shaders *
|
|
3
|
+
* https://github.com/paper-design/shaders *
|
|
4
|
+
* * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
5
|
+
|
|
6
|
+
import {} from "../shader-sizing.js";
|
|
7
|
+
import { declarePI, rotation2, simplexNoise } from "../shader-utils.js";
|
|
8
|
+
const waterFragmentShader = `#version 300 es
|
|
9
|
+
precision mediump float;
|
|
10
|
+
|
|
11
|
+
uniform float u_time;
|
|
12
|
+
|
|
13
|
+
uniform vec4 u_colorBack;
|
|
14
|
+
uniform vec4 u_colorHighlight;
|
|
15
|
+
|
|
16
|
+
uniform sampler2D u_image;
|
|
17
|
+
uniform float u_imageAspectRatio;
|
|
18
|
+
|
|
19
|
+
uniform float u_size;
|
|
20
|
+
uniform float u_highlights;
|
|
21
|
+
uniform float u_layering;
|
|
22
|
+
uniform float u_edges;
|
|
23
|
+
uniform float u_caustic;
|
|
24
|
+
uniform float u_waves;
|
|
25
|
+
|
|
26
|
+
in vec2 v_imageUV;
|
|
27
|
+
|
|
28
|
+
out vec4 fragColor;
|
|
29
|
+
|
|
30
|
+
${declarePI}
|
|
31
|
+
${rotation2}
|
|
32
|
+
${simplexNoise}
|
|
33
|
+
|
|
34
|
+
float getUvFrame(vec2 uv) {
|
|
35
|
+
float aax = 2. * fwidth(uv.x);
|
|
36
|
+
float aay = 2. * fwidth(uv.y);
|
|
37
|
+
|
|
38
|
+
float left = smoothstep(0., aax, uv.x);
|
|
39
|
+
float right = 1.0 - smoothstep(1. - aax, 1., uv.x);
|
|
40
|
+
float bottom = smoothstep(0., aay, uv.y);
|
|
41
|
+
float top = 1.0 - smoothstep(1. - aay, 1., uv.y);
|
|
42
|
+
|
|
43
|
+
return left * right * bottom * top;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
mat2 rotate2D(float r) {
|
|
47
|
+
return mat2(cos(r), sin(r), -sin(r), cos(r));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
float getCausticNoise(vec2 uv, float t, float scale) {
|
|
51
|
+
vec2 n = vec2(.1);
|
|
52
|
+
vec2 N = vec2(.1);
|
|
53
|
+
mat2 m = rotate2D(.5);
|
|
54
|
+
for (int j = 0; j < 6; j++) {
|
|
55
|
+
uv *= m;
|
|
56
|
+
n *= m;
|
|
57
|
+
vec2 q = uv * scale + float(j) + n + (.5 + .5 * float(j)) * (mod(float(j), 2.) - 1.) * t;
|
|
58
|
+
n += sin(q);
|
|
59
|
+
N += cos(q) / scale;
|
|
60
|
+
scale *= 1.1;
|
|
61
|
+
}
|
|
62
|
+
return (N.x + N.y + 1.);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
void main() {
|
|
66
|
+
vec2 imageUV = v_imageUV;
|
|
67
|
+
vec2 patternUV = v_imageUV - .5;
|
|
68
|
+
patternUV = (patternUV * vec2(u_imageAspectRatio, 1.));
|
|
69
|
+
patternUV /= (.01 + .09 * u_size);
|
|
70
|
+
|
|
71
|
+
float t = u_time;
|
|
72
|
+
|
|
73
|
+
float wavesNoise = snoise((.3 + .1 * sin(t)) * .1 * patternUV + vec2(0., .4 * t));
|
|
74
|
+
|
|
75
|
+
float causticNoise = getCausticNoise(patternUV + u_waves * vec2(1., -1.) * wavesNoise, 2. * t, 1.5);
|
|
76
|
+
|
|
77
|
+
if (u_layering > 0.) {
|
|
78
|
+
causticNoise += u_layering * getCausticNoise(patternUV + 2. * u_waves * vec2(1., -1.) * wavesNoise, 1.5 * t, 2.);
|
|
79
|
+
}
|
|
80
|
+
causticNoise = causticNoise * causticNoise;
|
|
81
|
+
|
|
82
|
+
float edgesDistortion = smoothstep(0., .1, imageUV.x);
|
|
83
|
+
edgesDistortion *= smoothstep(0., .1, imageUV.y);
|
|
84
|
+
edgesDistortion *= (smoothstep(1., 1.1, imageUV.x) + (1.0 - smoothstep(.8, .95, imageUV.x)));
|
|
85
|
+
edgesDistortion *= (1.0 - smoothstep(.9, 1., imageUV.y));
|
|
86
|
+
edgesDistortion = mix(edgesDistortion, 1., u_edges);
|
|
87
|
+
|
|
88
|
+
float causticNoiseDistortion = .02 * causticNoise * edgesDistortion;
|
|
89
|
+
|
|
90
|
+
float wavesDistortion = .1 * u_waves * wavesNoise;
|
|
91
|
+
|
|
92
|
+
imageUV += vec2(wavesDistortion, -wavesDistortion);
|
|
93
|
+
imageUV += (u_caustic * causticNoiseDistortion);
|
|
94
|
+
|
|
95
|
+
float frame = getUvFrame(imageUV);
|
|
96
|
+
|
|
97
|
+
vec4 image = texture(u_image, imageUV);
|
|
98
|
+
vec4 backColor = u_colorBack;
|
|
99
|
+
backColor.rgb *= backColor.a;
|
|
100
|
+
|
|
101
|
+
vec3 color = mix(backColor.rgb, image.rgb, image.a * frame);
|
|
102
|
+
float opacity = backColor.a + image.a * frame;
|
|
103
|
+
|
|
104
|
+
causticNoise = max(-.2, causticNoise);
|
|
105
|
+
|
|
106
|
+
float hightlight = .025 * u_highlights * causticNoise;
|
|
107
|
+
hightlight *= u_colorHighlight.a;
|
|
108
|
+
color = mix(color, u_colorHighlight.rgb, .05 * u_highlights * causticNoise * u_colorHighlight.a);
|
|
109
|
+
opacity += hightlight;
|
|
110
|
+
|
|
111
|
+
color += hightlight * (.5 + .5 * wavesNoise);
|
|
112
|
+
opacity += hightlight * (.5 + .5 * wavesNoise);
|
|
113
|
+
|
|
114
|
+
opacity = clamp(opacity, 0., 1.);
|
|
115
|
+
|
|
116
|
+
fragColor = vec4(color, opacity);
|
|
117
|
+
}
|
|
118
|
+
`;
|
|
119
|
+
export {
|
|
120
|
+
waterFragmentShader
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=water.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shaders/water.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ShaderMotionParams } from '../shader-mount.js';\r\nimport { type ShaderSizingParams, type ShaderSizingUniforms } from '../shader-sizing.js';\r\nimport { declarePI, rotation2, simplexNoise } from '../shader-utils.js';\r\n\r\n/**\r\n * Water-like surface distortion with natural caustic realism. Works as an image filter or standalone animated texture.\r\n *\r\n * Fragment shader uniforms:\r\n * - u_time (float): Animation time\r\n * - u_image (sampler2D): Optional source image texture\r\n * - u_imageAspectRatio (float): Aspect ratio of the source image\r\n * - u_colorBack (vec4): Background color in RGBA\r\n * - u_colorHighlight (vec4): Highlight color in RGBA, needs highlights > 0\r\n * - u_highlights (float): Coloring added over image/background following caustic shape, needs colorHighlight alpha > 0 (0 to 1)\r\n * - u_layering (float): Power of 2nd layer of caustic distortion, needs caustic or highlights > 0 (0 to 1)\r\n * - u_edges (float): Caustic distortion power on the image edges, needs image and caustic > 0 (0 to 1)\r\n * - u_waves (float): Additional distortion based on simplex noise, independent from caustic (0 to 1)\r\n * - u_caustic (float): Power of caustic distortion, needs image (0 to 1)\r\n * - u_size (float): Pattern scale relative to the image (0.01 to 7)\r\n *\r\n * Vertex shader outputs (used in fragment shader):\r\n * - v_imageUV (vec2): UV coordinates for sampling the source image, with fit, scale, rotation, and offset applied\r\n *\r\n * Vertex shader uniforms:\r\n * - u_resolution (vec2): Canvas resolution in pixels\r\n * - u_pixelRatio (float): Device pixel ratio\r\n * - u_originX (float): Reference point for positioning world width in the canvas (0 to 1)\r\n * - u_originY (float): Reference point for positioning world height in the canvas (0 to 1)\r\n * - u_worldWidth (float): Virtual width of the graphic before it's scaled to fit the canvas\r\n * - u_worldHeight (float): Virtual height of the graphic before it's scaled to fit the canvas\r\n * - u_fit (float): How to fit the rendered shader into the canvas dimensions (0 = none, 1 = contain, 2 = cover)\r\n * - u_scale (float): Overall zoom level of the graphics (0.1 to 4)\r\n * - u_rotation (float): Overall rotation angle of the graphics in degrees (0 to 360)\r\n * - u_offsetX (float): Horizontal offset of the graphics center (-1 to 1)\r\n * - u_offsetY (float): Vertical offset of the graphics center (-1 to 1)\r\n * - u_imageAspectRatio (float): Aspect ratio of the source image\r\n *\r\n */\r\n\r\n// language=GLSL\r\nexport const waterFragmentShader: string = `#version 300 es\r\nprecision mediump float;\r\n\r\nuniform float u_time;\r\n\r\nuniform vec4 u_colorBack;\r\nuniform vec4 u_colorHighlight;\r\n\r\nuniform sampler2D u_image;\r\nuniform float u_imageAspectRatio;\r\n\r\nuniform float u_size;\r\nuniform float u_highlights;\r\nuniform float u_layering;\r\nuniform float u_edges;\r\nuniform float u_caustic;\r\nuniform float u_waves;\r\n\r\nin vec2 v_imageUV;\r\n\r\nout vec4 fragColor;\r\n\r\n${ declarePI }\r\n${ rotation2 }\r\n${ simplexNoise }\r\n\r\nfloat getUvFrame(vec2 uv) {\r\n float aax = 2. * fwidth(uv.x);\r\n float aay = 2. * fwidth(uv.y);\r\n\r\n float left = smoothstep(0., aax, uv.x);\r\n float right = 1.0 - smoothstep(1. - aax, 1., uv.x);\r\n float bottom = smoothstep(0., aay, uv.y);\r\n float top = 1.0 - smoothstep(1. - aay, 1., uv.y);\r\n\r\n return left * right * bottom * top;\r\n}\r\n\r\nmat2 rotate2D(float r) {\r\n return mat2(cos(r), sin(r), -sin(r), cos(r));\r\n}\r\n\r\nfloat getCausticNoise(vec2 uv, float t, float scale) {\r\n vec2 n = vec2(.1);\r\n vec2 N = vec2(.1);\r\n mat2 m = rotate2D(.5);\r\n for (int j = 0; j < 6; j++) {\r\n uv *= m;\r\n n *= m;\r\n vec2 q = uv * scale + float(j) + n + (.5 + .5 * float(j)) * (mod(float(j), 2.) - 1.) * t;\r\n n += sin(q);\r\n N += cos(q) / scale;\r\n scale *= 1.1;\r\n }\r\n return (N.x + N.y + 1.);\r\n}\r\n\r\nvoid main() {\r\n vec2 imageUV = v_imageUV;\r\n vec2 patternUV = v_imageUV - .5;\r\n patternUV = (patternUV * vec2(u_imageAspectRatio, 1.));\r\n patternUV /= (.01 + .09 * u_size);\r\n\r\n float t = u_time;\r\n\r\n float wavesNoise = snoise((.3 + .1 * sin(t)) * .1 * patternUV + vec2(0., .4 * t));\r\n\r\n float causticNoise = getCausticNoise(patternUV + u_waves * vec2(1., -1.) * wavesNoise, 2. * t, 1.5);\r\n\r\n if (u_layering > 0.) {\r\n causticNoise += u_layering * getCausticNoise(patternUV + 2. * u_waves * vec2(1., -1.) * wavesNoise, 1.5 * t, 2.);\r\n }\r\n causticNoise = causticNoise * causticNoise;\r\n\r\n float edgesDistortion = smoothstep(0., .1, imageUV.x);\r\n edgesDistortion *= smoothstep(0., .1, imageUV.y);\r\n edgesDistortion *= (smoothstep(1., 1.1, imageUV.x) + (1.0 - smoothstep(.8, .95, imageUV.x)));\r\n edgesDistortion *= (1.0 - smoothstep(.9, 1., imageUV.y));\r\n edgesDistortion = mix(edgesDistortion, 1., u_edges);\r\n\r\n float causticNoiseDistortion = .02 * causticNoise * edgesDistortion;\r\n\r\n float wavesDistortion = .1 * u_waves * wavesNoise;\r\n\r\n imageUV += vec2(wavesDistortion, -wavesDistortion);\r\n imageUV += (u_caustic * causticNoiseDistortion);\r\n\r\n float frame = getUvFrame(imageUV);\r\n\r\n vec4 image = texture(u_image, imageUV);\r\n vec4 backColor = u_colorBack;\r\n backColor.rgb *= backColor.a;\r\n\r\n vec3 color = mix(backColor.rgb, image.rgb, image.a * frame);\r\n float opacity = backColor.a + image.a * frame;\r\n\r\n causticNoise = max(-.2, causticNoise);\r\n\r\n float hightlight = .025 * u_highlights * causticNoise;\r\n hightlight *= u_colorHighlight.a;\r\n color = mix(color, u_colorHighlight.rgb, .05 * u_highlights * causticNoise * u_colorHighlight.a);\r\n opacity += hightlight;\r\n\r\n color += hightlight * (.5 + .5 * wavesNoise);\r\n opacity += hightlight * (.5 + .5 * wavesNoise);\r\n\r\n opacity = clamp(opacity, 0., 1.);\r\n\r\n fragColor = vec4(color, opacity);\r\n}\r\n`;\r\n\r\nexport interface WaterUniforms extends ShaderSizingUniforms {\r\n u_image: HTMLImageElement | string | undefined;\r\n u_colorBack: [number, number, number, number];\r\n u_colorHighlight: [number, number, number, number];\r\n u_highlights: number;\r\n u_layering: number;\r\n u_edges: number;\r\n u_caustic: number;\r\n u_waves: number;\r\n u_size: number;\r\n}\r\n\r\nexport interface WaterParams extends ShaderSizingParams, ShaderMotionParams {\r\n image?: HTMLImageElement | string;\r\n colorBack?: string;\r\n colorHighlight?: string;\r\n highlights?: number;\r\n layering?: number;\r\n edges?: number;\r\n caustic?: number;\r\n waves?: number;\r\n size?: number;\r\n}\r\n"],
|
|
5
|
+
"mappings": ";;;;;AACA,eAAmE;AACnE,SAAS,WAAW,WAAW,oBAAoB;AAsC5C,MAAM,sBAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsBxC,SAAU;AAAA,EACV,SAAU;AAAA,EACV,YAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|