@paper-design/shaders 0.0.32 → 0.0.34
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/dist/get-shader-color-from-string.js +93 -0
- package/dist/get-shader-color-from-string.js.map +7 -0
- package/dist/get-shader-noise-texture.js +23 -0
- package/dist/get-shader-noise-texture.js.map +7 -0
- package/dist/index.d.ts +25 -23
- package/dist/index.js +118 -0
- package/dist/index.js.map +7 -0
- package/dist/shader-color-spaces.js +96 -0
- package/dist/shader-color-spaces.js.map +7 -0
- package/dist/shader-mount.d.ts +3 -0
- package/dist/shader-mount.js +593 -0
- package/dist/shader-mount.js.map +7 -0
- package/dist/shader-sizing.js +193 -0
- package/dist/shader-sizing.js.map +7 -0
- package/dist/shader-utils.d.ts +1 -0
- package/dist/shader-utils.js +74 -0
- package/dist/shader-utils.js.map +7 -0
- package/dist/shaders/color-panels.d.ts +47 -0
- package/dist/shaders/color-panels.js +210 -0
- package/dist/shaders/color-panels.js.map +7 -0
- package/dist/shaders/dithering.d.ts +24 -29
- package/dist/shaders/dithering.js +221 -0
- package/dist/shaders/dithering.js.map +7 -0
- package/dist/shaders/dot-grid.d.ts +16 -14
- package/dist/shaders/dot-grid.js +108 -0
- package/dist/shaders/dot-grid.js.map +7 -0
- package/dist/shaders/dot-orbit.d.ts +14 -13
- package/dist/shaders/dot-orbit.js +124 -0
- package/dist/shaders/dot-orbit.js.map +7 -0
- package/dist/shaders/god-rays.d.ts +18 -19
- package/dist/shaders/god-rays.js +118 -0
- package/dist/shaders/god-rays.js.map +7 -0
- package/dist/shaders/grain-gradient.d.ts +24 -4
- package/dist/shaders/grain-gradient.js +226 -0
- package/dist/shaders/grain-gradient.js.map +7 -0
- package/dist/shaders/liquid-metal.d.ts +44 -12
- package/dist/shaders/liquid-metal.js +221 -0
- package/dist/shaders/liquid-metal.js.map +7 -0
- package/dist/shaders/mesh-gradient.d.ts +10 -10
- package/dist/shaders/mesh-gradient.js +97 -0
- package/dist/shaders/mesh-gradient.js.map +7 -0
- package/dist/shaders/metaballs.d.ts +13 -10
- package/dist/shaders/metaballs.js +110 -0
- package/dist/shaders/metaballs.js.map +7 -0
- package/dist/shaders/neuro-noise.d.ts +13 -9
- package/dist/shaders/neuro-noise.js +81 -0
- package/dist/shaders/neuro-noise.js.map +7 -0
- package/dist/shaders/perlin-noise.d.ts +15 -19
- package/dist/shaders/perlin-noise.js +201 -0
- package/dist/shaders/perlin-noise.js.map +7 -0
- package/dist/shaders/pulsing-border.d.ts +17 -18
- package/dist/shaders/pulsing-border.js +211 -0
- package/dist/shaders/pulsing-border.js.map +7 -0
- package/dist/shaders/simplex-noise.d.ts +10 -12
- package/dist/shaders/simplex-noise.js +103 -0
- package/dist/shaders/simplex-noise.js.map +7 -0
- package/dist/shaders/smoke-ring.d.ts +11 -14
- package/dist/shaders/smoke-ring.js +124 -0
- package/dist/shaders/smoke-ring.js.map +7 -0
- package/dist/shaders/spiral.d.ts +16 -22
- package/dist/shaders/spiral.js +84 -0
- package/dist/shaders/spiral.js.map +7 -0
- package/dist/shaders/swirl.d.ts +15 -3
- package/dist/shaders/swirl.js +89 -0
- package/dist/shaders/swirl.js.map +7 -0
- package/dist/shaders/voronoi.d.ts +20 -20
- package/dist/shaders/voronoi.js +143 -0
- package/dist/shaders/voronoi.js.map +7 -0
- package/dist/shaders/warp.d.ts +15 -17
- package/dist/shaders/warp.js +108 -0
- package/dist/shaders/warp.js.map +7 -0
- package/dist/shaders/waves.d.ts +18 -21
- package/dist/shaders/waves.js +68 -0
- package/dist/shaders/waves.js.map +7 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +7 -0
- package/package.json +2 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shaders/grain-gradient.ts"],
|
|
4
|
+
"sourcesContent": ["import type { vec4 } from '../types.js';\nimport type { ShaderMotionParams } from '../shader-mount.js';\nimport { sizingVariablesDeclaration, type ShaderSizingParams, type ShaderSizingUniforms } from '../shader-sizing.js';\nimport { declareSimplexNoise, declarePI, declareRandom, declareValueNoise, colorBandingFix } from '../shader-utils.js';\n\nexport const grainGradientMeta = {\n maxColorCount: 7,\n} as const;\n\n/**\n * Multi-color gradient with noise & grain over animated abstract shapes\n *\n * Uniforms:\n * - u_colorBack (RGBA)\n * - u_colors (vec4[]), u_colorsCount (float used as integer)\n * - u_softness (0..1): blur between color bands\n * - u_intensity (0..1): distortion between color bands\n * - u_noise (0..1): grainy noise independent of softness\n * - u_shape (float used as integer):\n * ---- 1: single sine wave\n * ---- 2: dots pattern\n * ---- 3: truchet pattern\n * ---- 4: corners (2 rounded rectangles)\n * ---- 5: ripple\n * ---- 6: blob (metaballs)\n * ---- 7: circle imitating 3d look\n *\n * Note: grains are calculated using gl_FragCoord & u_resolution, meaning grains don't react to scaling and fit\n *\n */\nexport const grainGradientFragmentShader: string = `#version 300 es\nprecision mediump float;\n\nuniform float u_time;\nuniform vec2 u_resolution;\nuniform float u_pixelRatio;\n\nuniform vec4 u_colorBack;\nuniform vec4 u_colors[${grainGradientMeta.maxColorCount}];\nuniform float u_colorsCount;\nuniform float u_softness;\nuniform float u_intensity;\nuniform float u_noise;\nuniform float u_shape;\n\n${sizingVariablesDeclaration}\n\nout vec4 fragColor;\n\n${declarePI}\n${declareSimplexNoise}\n${declareRandom}\n${declareValueNoise}\n\n\nfloat rand(vec2 n) {\n return fract(cos(dot(n, vec2(12.9898, 4.1414))) * 43758.5453);\n}\nfloat noise(vec2 n) {\n const vec2 d = vec2(0.0, 1.0);\n vec2 b = floor(n), f = smoothstep(vec2(0.0), vec2(1.0), fract(n));\n return mix(mix(rand(b), rand(b + d.yx), f.x), mix(rand(b + d.xy), rand(b + d.yy), f.x), f.y);\n}\nfloat fbm_4(vec2 n) {\n float total = 0.0, amplitude = .2;\n for (int i = 0; i < 4; i++) {\n total += noise(n) * amplitude;\n n += n;\n amplitude *= 0.6;\n }\n return total;\n}\n\n\nvec2 truchet(vec2 uv, float idx){\n idx = fract(((idx - .5) * 2.));\n if (idx > 0.75) {\n uv = vec2(1.0) - uv;\n } else if (idx > 0.5) {\n uv = vec2(1.0 - uv.x, uv.y);\n } else if (idx > 0.25) {\n uv = 1.0 - vec2(1.0 - uv.x, uv.y);\n }\n return uv;\n}\n\nvoid main() {\n\n float t = .1 * u_time;\n\n vec2 grain_uv = (gl_FragCoord.xy - .5 * u_resolution) / u_pixelRatio;\n vec2 shape_uv = v_objectUV;\n if (u_shape < 3.5) {\n shape_uv = v_patternUV * .005;\n }\n\n\n float shape = 0.;\n\n if (u_shape < 1.5) {\n // Sine wave\n\n float wave = cos(.5 * shape_uv.x - 2. * t) * sin(1.5 * shape_uv.x + t) * (.75 + .25 * cos(3. * t));\n shape = 1. - smoothstep(-1., 1., shape_uv.y + wave);\n\n } else if (u_shape < 2.5) {\n // Grid (dots)\n\n float stripeIdx = floor(2. * shape_uv.x / TWO_PI);\n float rand = fract(sin(stripeIdx * 12.9898) * 43758.5453);\n\n float speed = sign(rand - .5) * ceil(2. + rand);\n shape = sin(shape_uv.x) * cos(shape_uv.y + speed * t);\n shape = pow(shape, 4.);\n\n } else if (u_shape < 3.5) {\n // Truchet pattern\n \n float n2 = valueNoise(shape_uv * .4 - 2.5 * t);\n shape_uv.x += 10.;\n shape_uv *= .6;\n\n vec2 tile = truchet(fract(shape_uv), random(floor(shape_uv)));\n\n float distance1 = length(tile);\n float distance2 = length(tile - vec2(1.));\n\n n2 -= .5;\n n2 *= .1;\n shape = smoothstep(.2, .55, distance1 + n2) * smoothstep(.8, .45, distance1 - n2);\n shape += smoothstep(.2, .55, distance2 + n2) * smoothstep(.8, .45, distance2 - n2);\n\n shape = pow(shape, 1.5);\n\n } else if (u_shape < 4.5) {\n // Corners\n\n shape_uv *= .6;\n vec2 outer = vec2(.5);\n\n vec2 bl = smoothstep(vec2(0.), outer, shape_uv + vec2(.1 + .1 * sin(2. * t), .2 - .1 * sin(3. * t)));\n vec2 tr = smoothstep(vec2(0.), outer, 1. - shape_uv);\n shape = 1. - bl.x * bl.y * tr.x * tr.y;\n\n shape_uv = -shape_uv;\n bl = smoothstep(vec2(0.), outer, shape_uv + vec2(.1 + .1 * sin(2. * t), .2 - .1 * cos(3. * t)));\n tr = smoothstep(vec2(0.), outer, 1. - shape_uv);\n shape -= bl.x * bl.y * tr.x * tr.y;\n\n shape = 1. - smoothstep(0., 1., shape);\n\n } else if (u_shape < 5.5) {\n // Ripple\n\n shape_uv *= 2.;\n float dist = length(.4 * shape_uv);\n float waves = sin(pow(dist, 1.2) * 5. - 3. * t) * .5 + .5;\n shape = waves;\n\n } else if (u_shape < 6.5) {\n // Blob\n\n t *= 2.;\n\n vec2 f1_traj = .25 * vec2(1.3 * sin(t), .2 + 1.3 * cos(.6 * t + 4.));\n vec2 f2_traj = .2 * vec2(1.2 * sin(-t), 1.3 * sin(1.6 * t));\n vec2 f3_traj = .25 * vec2(1.7 * cos(-.6 * t), cos(-1.6 * t));\n vec2 f4_traj = .3 * vec2(1.4 * cos(.8 * t), 1.2 * sin(-.6 * t - 3.));\n\n shape = .5 * pow(1. - clamp(0., 1., length(shape_uv + f1_traj)), 5.);\n shape += .5 * pow(1. - clamp(0., 1., length(shape_uv + f2_traj)), 5.);\n shape += .5 * pow(1. - clamp(0., 1., length(shape_uv + f3_traj)), 5.);\n shape += .5 * pow(1. - clamp(0., 1., length(shape_uv + f4_traj)), 5.);\n\n shape = smoothstep(.0, .9, shape);\n float edge = smoothstep(.25, .3, shape);\n shape = mix(.0, shape, edge);\n\n } else {\n // Sphere\n\n shape_uv *= 2.;\n float d = length(shape_uv);\n float z = sqrt(1.0 - clamp(pow(d, 2.0), 0.0, 1.0));\n vec3 pos = vec3(shape_uv, z);\n vec3 lightPos = normalize(vec3(cos(3. * t), 0.8, sin(2.5 * t)));\n float lighting = dot(lightPos, pos);\n float edge = smoothstep(1., .97, d);\n shape = mix(.1, .5 + .5 * lighting, edge);\n }\n\n float snoise05 = snoise(grain_uv * .5);\n float grainDist = snoise(grain_uv * .2) * snoise05 - fbm_4(.002 * grain_uv + 10.) - fbm_4(.003 * grain_uv);\n float noise = clamp(.6 * snoise05 - fbm_4(.4 * grain_uv) - fbm_4(.001 * grain_uv), 0., 1.);\n\n shape += u_intensity * 2. / u_colorsCount * (grainDist + .5);\n shape += u_noise * 10. / u_colorsCount * noise;\n\n float edge_w = fwidth(shape);\n\n float mixer = shape * (u_colorsCount + 1.) / u_colorsCount;\n vec4 gradient = u_colors[0];\n gradient.rgb *= gradient.a;\n\n for (int i = 1; i < ${grainGradientMeta.maxColorCount}; i++) {\n if (i > int(u_colorsCount) - 1) break;\n\n vec2 borders = vec2(float(i + 1) - u_softness - edge_w, float(i + 1) + u_softness + edge_w) / u_colorsCount;\n float localT = smoothstep(borders[0], borders[1], mixer);\n vec4 c = u_colors[i];\n c.rgb *= c.a;\n gradient = mix(gradient, c, localT);\n }\n\n vec2 borders = vec2(2. / (u_colorsCount - 1.));\n borders = vec2(borders[0] - u_softness - edge_w, borders[1] + u_softness + edge_w) / u_colorsCount;\n borders[0] = max(0., borders[0]);\n float gradientShape = smoothstep(borders[0], borders[1], mixer);\n\n vec3 color = gradient.rgb * gradientShape;\n float opacity = gradient.a * gradientShape;\n\n vec3 bgColor = u_colorBack.rgb * u_colorBack.a;\n color = color + bgColor * (1.0 - opacity);\n opacity = opacity + u_colorBack.a * (1.0 - opacity);\n\n ${colorBandingFix}\n\n fragColor = vec4(color, opacity);\n}\n`;\n\nexport interface GrainGradientUniforms extends ShaderSizingUniforms {\n u_colorBack: [number, number, number, number];\n u_colors: vec4[];\n u_colorsCount: number;\n u_softness: number;\n u_intensity: number;\n u_noise: number;\n u_shape: (typeof GrainGradientShapes)[GrainGradientShape];\n}\n\nexport interface GrainGradientParams extends ShaderSizingParams, ShaderMotionParams {\n colorBack?: string;\n colors?: string[];\n softness?: number;\n intensity?: number;\n noise?: number;\n shape?: GrainGradientShape;\n}\n\nexport const GrainGradientShapes = {\n wave: 1,\n dots: 2,\n truchet: 3,\n corners: 4,\n ripple: 5,\n blob: 6,\n sphere: 7,\n};\n\nexport type GrainGradientShape = keyof typeof GrainGradientShapes;\n"],
|
|
5
|
+
"mappings": ";;;;;AAEA,SAAS,kCAAsF;AAC/F,SAAS,qBAAqB,WAAW,eAAe,mBAAmB,uBAAuB;AAE3F,MAAM,oBAAoB;AAAA,EAC/B,eAAe;AACjB;AAuBO,MAAM,8BAAsC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAQ3B,kBAAkB,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOrD,0BAA0B;AAAA;AAAA;AAAA;AAAA,EAI1B,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,aAAa;AAAA,EACb,iBAAiB;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;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,wBAwJK,kBAAkB,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAsBnD,eAAe;AAAA;AAAA;AAAA;AAAA;AAyBZ,MAAM,sBAAsB;AAAA,EACjC,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AACV;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,19 +1,51 @@
|
|
|
1
|
-
import type { ShaderMotionParams } from '../shader-mount';
|
|
2
|
-
import { type ShaderSizingParams, type ShaderSizingUniforms } from '../shader-sizing';
|
|
1
|
+
import type { ShaderMotionParams } from '../shader-mount.js';
|
|
2
|
+
import { type ShaderSizingParams, type ShaderSizingUniforms } from '../shader-sizing.js';
|
|
3
3
|
/**
|
|
4
|
+
*
|
|
5
|
+
* Fluid motion imitation applied over abstract shapes
|
|
6
|
+
* (animated stripe pattern getting distorted with shape edges)
|
|
7
|
+
*
|
|
8
|
+
* Uniforms:
|
|
9
|
+
* - u_colorBack, u_colorTint (RGBA)
|
|
10
|
+
* - u_repetition: density of pattern stripes
|
|
11
|
+
* - u_softness: blur between stripes
|
|
12
|
+
* - u_shiftRed & u_shiftBlue: color dispersion between the stripes
|
|
13
|
+
* - u_distortion: pattern distortion on the whole canvas
|
|
14
|
+
* - u_contour: distortion power over the shape edges
|
|
15
|
+
* - u_shape (float used as integer):
|
|
16
|
+
* ---- 0: canvas-screen rectangle, needs u_worldWidth = u_worldHeight = 0 to be responsive (see vertex shader)
|
|
17
|
+
* ---- 1: static circle
|
|
18
|
+
* ---- 2: animated flower-like polar shape
|
|
19
|
+
* ---- 3: animated metaballs
|
|
20
|
+
*
|
|
4
21
|
*/
|
|
5
22
|
export declare const liquidMetalFragmentShader: string;
|
|
6
23
|
export interface LiquidMetalUniforms extends ShaderSizingUniforms {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
24
|
+
u_colorBack: [number, number, number, number];
|
|
25
|
+
u_colorTint: [number, number, number, number];
|
|
26
|
+
u_softness: number;
|
|
27
|
+
u_repetition: number;
|
|
28
|
+
u_shiftRed: number;
|
|
29
|
+
u_shiftBlue: number;
|
|
30
|
+
u_distortion: number;
|
|
31
|
+
u_contour: number;
|
|
32
|
+
u_shape: (typeof LiquidMetalShapes)[LiquidMetalShape];
|
|
12
33
|
}
|
|
13
34
|
export interface LiquidMetalParams extends ShaderSizingParams, ShaderMotionParams {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
35
|
+
colorBack?: string;
|
|
36
|
+
colorTint?: string;
|
|
37
|
+
softness?: number;
|
|
38
|
+
repetition?: number;
|
|
39
|
+
shiftRed?: number;
|
|
40
|
+
shiftBlue?: number;
|
|
41
|
+
distortion?: number;
|
|
42
|
+
contour?: number;
|
|
43
|
+
shape?: LiquidMetalShape;
|
|
19
44
|
}
|
|
45
|
+
export declare const LiquidMetalShapes: {
|
|
46
|
+
readonly none: 0;
|
|
47
|
+
readonly circle: 1;
|
|
48
|
+
readonly daisy: 2;
|
|
49
|
+
readonly metaballs: 3;
|
|
50
|
+
};
|
|
51
|
+
export type LiquidMetalShape = keyof typeof LiquidMetalShapes;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
2
|
+
* Paper Shaders *
|
|
3
|
+
* https://github.com/paper-design/shaders *
|
|
4
|
+
* * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
5
|
+
|
|
6
|
+
import { sizingVariablesDeclaration } from "../shader-sizing.js";
|
|
7
|
+
import { declarePI, declareRotate, declareSimplexNoise, colorBandingFix } from "../shader-utils.js";
|
|
8
|
+
const liquidMetalFragmentShader = `#version 300 es
|
|
9
|
+
precision mediump float;
|
|
10
|
+
|
|
11
|
+
uniform float u_time;
|
|
12
|
+
|
|
13
|
+
uniform vec4 u_colorBack;
|
|
14
|
+
uniform vec4 u_colorTint;
|
|
15
|
+
|
|
16
|
+
uniform float u_softness;
|
|
17
|
+
uniform float u_repetition;
|
|
18
|
+
uniform float u_shiftRed;
|
|
19
|
+
uniform float u_shiftBlue;
|
|
20
|
+
uniform float u_distortion;
|
|
21
|
+
uniform float u_contour;
|
|
22
|
+
uniform float u_shape;
|
|
23
|
+
|
|
24
|
+
${sizingVariablesDeclaration}
|
|
25
|
+
|
|
26
|
+
out vec4 fragColor;
|
|
27
|
+
|
|
28
|
+
${declarePI}
|
|
29
|
+
${declareRotate}
|
|
30
|
+
${declareSimplexNoise}
|
|
31
|
+
|
|
32
|
+
float getColorChanges(float c1, float c2, float stripe_p, vec3 w, float blur, float bump, float tint) {
|
|
33
|
+
|
|
34
|
+
float ch = mix(c2, c1, smoothstep(.0, blur, stripe_p));
|
|
35
|
+
|
|
36
|
+
float border = w[0];
|
|
37
|
+
ch = mix(ch, c2, smoothstep(border - blur, border + blur, stripe_p));
|
|
38
|
+
|
|
39
|
+
border = w[0] + .4 * (1. - bump) * w[1];
|
|
40
|
+
ch = mix(ch, c1, smoothstep(border - blur, border + blur, stripe_p));
|
|
41
|
+
|
|
42
|
+
border = w[0] + .5 * (1. - bump) * w[1];
|
|
43
|
+
ch = mix(ch, c2, smoothstep(border - blur, border + blur, stripe_p));
|
|
44
|
+
|
|
45
|
+
border = w[0] + w[1];
|
|
46
|
+
ch = mix(ch, c1, smoothstep(border - blur, border + blur, stripe_p));
|
|
47
|
+
|
|
48
|
+
float gradient_t = (stripe_p - w[0] - w[1]) / w[2];
|
|
49
|
+
float gradient = mix(c1, c2, smoothstep(0., 1., gradient_t));
|
|
50
|
+
ch = mix(ch, gradient, smoothstep(border - blur, border + blur, stripe_p));
|
|
51
|
+
|
|
52
|
+
// Tint color is applied with color burn blending
|
|
53
|
+
ch = mix(ch, 1. - min(1., (1. - ch) / max(tint, 0.0001)), u_colorTint.a);
|
|
54
|
+
return ch;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
void main() {
|
|
58
|
+
|
|
59
|
+
float t = .1 * u_time;
|
|
60
|
+
|
|
61
|
+
vec2 uv = v_objectUV;
|
|
62
|
+
uv += .5;
|
|
63
|
+
uv.y = 1. - uv.y;
|
|
64
|
+
|
|
65
|
+
float cycleWidth = .5 * u_repetition;
|
|
66
|
+
|
|
67
|
+
float mask = 1.;
|
|
68
|
+
float contOffset = 1.;
|
|
69
|
+
|
|
70
|
+
if (u_shape < 1.) {
|
|
71
|
+
|
|
72
|
+
vec2 borderUV = v_responsiveUV + .5;
|
|
73
|
+
float ratio = v_responsiveBoxGivenSize.x / v_responsiveBoxGivenSize.y;
|
|
74
|
+
vec2 edge = min(borderUV, 1. - borderUV);
|
|
75
|
+
vec2 pixel_thickness = 250. / v_responsiveBoxGivenSize;
|
|
76
|
+
float maskX = smoothstep(0.0, pixel_thickness.x, edge.x);
|
|
77
|
+
float maskY = smoothstep(0.0, pixel_thickness.y, edge.y);
|
|
78
|
+
maskX = pow(maskX, .25);
|
|
79
|
+
maskY = pow(maskY, .25);
|
|
80
|
+
mask = clamp(1. - maskX * maskY, 0., 1.);
|
|
81
|
+
|
|
82
|
+
uv = v_responsiveUV;
|
|
83
|
+
if (ratio > 1.) {
|
|
84
|
+
uv.y /= ratio;
|
|
85
|
+
} else {
|
|
86
|
+
uv.x *= ratio;
|
|
87
|
+
}
|
|
88
|
+
uv += .5;
|
|
89
|
+
uv.y = 1. - uv.y;
|
|
90
|
+
|
|
91
|
+
cycleWidth *= 2.;
|
|
92
|
+
contOffset = 1.5;
|
|
93
|
+
|
|
94
|
+
} else if (u_shape < 2.) {
|
|
95
|
+
vec2 shapeUV = uv - .5;
|
|
96
|
+
shapeUV *= .67;
|
|
97
|
+
mask = pow(clamp(3. * length(shapeUV), 0., 1.), 18.);
|
|
98
|
+
} else if (u_shape < 3.) {
|
|
99
|
+
vec2 shapeUV = uv - .5;
|
|
100
|
+
shapeUV *= 1.68;
|
|
101
|
+
|
|
102
|
+
float r = length(shapeUV) * 2.;
|
|
103
|
+
float a = atan(shapeUV.y, shapeUV.x) + .2;
|
|
104
|
+
r *= (1. + .05 * sin(3. * a + 2. * t));
|
|
105
|
+
float f = abs(cos(a * 3.));
|
|
106
|
+
mask = smoothstep(f, f + .7, r);
|
|
107
|
+
mask = pow(mask, 2.);
|
|
108
|
+
|
|
109
|
+
uv *= .8;
|
|
110
|
+
cycleWidth *= 1.6;
|
|
111
|
+
|
|
112
|
+
} else if (u_shape < 4.) {
|
|
113
|
+
vec2 shapeUV = uv - .5;
|
|
114
|
+
shapeUV *= 1.3;
|
|
115
|
+
mask = 0.;
|
|
116
|
+
for (int i = 0; i < 5; i++) {
|
|
117
|
+
float fi = float(i);
|
|
118
|
+
float speed = 4.5 + 2. * sin(fi * 12.345);
|
|
119
|
+
float angle = -fi * 1.5;
|
|
120
|
+
vec2 dir1 = vec2(cos(angle), sin(angle));
|
|
121
|
+
vec2 dir2 = vec2(cos(angle + 1.57), sin(angle + 1.));
|
|
122
|
+
vec2 traj = .4 * (dir1 * sin(t * speed + fi * 1.23) + dir2 * cos(t * (speed * 0.7) + fi * 2.17));
|
|
123
|
+
float d = length(shapeUV + traj);
|
|
124
|
+
mask += pow(1.0 - clamp(d, 0.0, 1.0), 4.0);
|
|
125
|
+
}
|
|
126
|
+
mask = 1. - smoothstep(.65, .9, mask);
|
|
127
|
+
mask = pow(mask, 4.);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
float opacity = 1. - smoothstep(.8, .82, mask);
|
|
131
|
+
|
|
132
|
+
float ridge = .15 * (smoothstep(.0, .15, uv.y) * smoothstep(.4, .15, uv.y));
|
|
133
|
+
ridge += .05 * (smoothstep(.1, .2, 1. - uv.y) * smoothstep(.4, .2, 1. - uv.y));
|
|
134
|
+
mask += ridge;
|
|
135
|
+
|
|
136
|
+
float diagBLtoTR = uv.x - uv.y;
|
|
137
|
+
float diagTLtoBR = uv.x + uv.y;
|
|
138
|
+
|
|
139
|
+
vec3 color = vec3(0.);
|
|
140
|
+
vec3 color1 = vec3(.98, 0.98, 1.);
|
|
141
|
+
vec3 color2 = vec3(.1, .1, .1 + .1 * smoothstep(.7, 1.3, diagTLtoBR));
|
|
142
|
+
|
|
143
|
+
vec2 grad_uv = uv - .5;
|
|
144
|
+
|
|
145
|
+
float dist = length(grad_uv + vec2(0., .2 * diagBLtoTR));
|
|
146
|
+
grad_uv = rotate(grad_uv, (.25 - .2 * diagBLtoTR) * PI);
|
|
147
|
+
float direction = grad_uv.x;
|
|
148
|
+
|
|
149
|
+
float bump = pow(1.8 * dist, 1.2);
|
|
150
|
+
bump = 1. - bump;
|
|
151
|
+
bump *= pow(uv.y, .3);
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
float thin_strip_1_ratio = .12 / cycleWidth * (1. - .4 * bump);
|
|
155
|
+
float thin_strip_2_ratio = .07 / cycleWidth * (1. + .4 * bump);
|
|
156
|
+
float wide_strip_ratio = (1. - thin_strip_1_ratio - thin_strip_2_ratio);
|
|
157
|
+
|
|
158
|
+
float thin_strip_1_width = cycleWidth * thin_strip_1_ratio;
|
|
159
|
+
float thin_strip_2_width = cycleWidth * thin_strip_2_ratio;
|
|
160
|
+
|
|
161
|
+
float noise = snoise(uv - t);
|
|
162
|
+
|
|
163
|
+
mask += (1. - mask) * u_distortion * noise;
|
|
164
|
+
|
|
165
|
+
direction += diagBLtoTR;
|
|
166
|
+
|
|
167
|
+
float contour = u_contour * smoothstep(0., contOffset, mask) * smoothstep(contOffset, 0., mask);
|
|
168
|
+
direction -= 14. * noise * contour;
|
|
169
|
+
|
|
170
|
+
bump *= clamp(pow(uv.y, .1), .3, 1.);
|
|
171
|
+
direction *= (.1 + (1.1 - mask) * bump);
|
|
172
|
+
direction *= smoothstep(1., .2, mask);
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
direction *= (.5 + .5 * pow(uv.y, 2.));
|
|
176
|
+
direction *= cycleWidth;
|
|
177
|
+
direction -= t;
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
float colorDispersion = (1. - bump);
|
|
181
|
+
float dispersionRed = colorDispersion;
|
|
182
|
+
dispersionRed += bump * noise;
|
|
183
|
+
float dispersionBlue = colorDispersion;
|
|
184
|
+
|
|
185
|
+
dispersionRed *= (u_shiftRed / 20.);
|
|
186
|
+
dispersionBlue *= (u_shiftBlue / 20.);
|
|
187
|
+
|
|
188
|
+
float blur = u_softness / 15. + .3 * contour;
|
|
189
|
+
|
|
190
|
+
vec3 w = vec3(thin_strip_1_width, thin_strip_2_width, wide_strip_ratio);
|
|
191
|
+
w[1] -= .02 * smoothstep(.0, 1., mask + bump);
|
|
192
|
+
float stripe_r = mod(direction + dispersionRed, 1.);
|
|
193
|
+
float r = getColorChanges(color1.r, color2.r, stripe_r, w, blur, bump, u_colorTint.r);
|
|
194
|
+
float stripe_g = mod(direction, 1.);
|
|
195
|
+
float g = getColorChanges(color1.g, color2.g, stripe_g, w, blur, bump, u_colorTint.g);
|
|
196
|
+
float stripe_b = mod(direction - dispersionBlue, 1.);
|
|
197
|
+
float b = getColorChanges(color1.b, color2.b, stripe_b, w, blur, bump, u_colorTint.b);
|
|
198
|
+
|
|
199
|
+
color = vec3(r, g, b);
|
|
200
|
+
color *= opacity;
|
|
201
|
+
|
|
202
|
+
vec3 bgColor = u_colorBack.rgb * u_colorBack.a;
|
|
203
|
+
color = color + bgColor * (1. - opacity);
|
|
204
|
+
opacity = opacity + u_colorBack.a * (1. - opacity);
|
|
205
|
+
|
|
206
|
+
${colorBandingFix}
|
|
207
|
+
|
|
208
|
+
fragColor = vec4(color, opacity);
|
|
209
|
+
}
|
|
210
|
+
`;
|
|
211
|
+
const LiquidMetalShapes = {
|
|
212
|
+
none: 0,
|
|
213
|
+
circle: 1,
|
|
214
|
+
daisy: 2,
|
|
215
|
+
metaballs: 3
|
|
216
|
+
};
|
|
217
|
+
export {
|
|
218
|
+
LiquidMetalShapes,
|
|
219
|
+
liquidMetalFragmentShader
|
|
220
|
+
};
|
|
221
|
+
//# sourceMappingURL=liquid-metal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shaders/liquid-metal.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ShaderMotionParams } from '../shader-mount.js';\nimport { sizingVariablesDeclaration, type ShaderSizingParams, type ShaderSizingUniforms } from '../shader-sizing.js';\nimport { declarePI, declareRotate, declareSimplexNoise, colorBandingFix } from '../shader-utils.js';\n\n/**\n *\n * Fluid motion imitation applied over abstract shapes\n * (animated stripe pattern getting distorted with shape edges)\n *\n * Uniforms:\n * - u_colorBack, u_colorTint (RGBA)\n * - u_repetition: density of pattern stripes\n * - u_softness: blur between stripes\n * - u_shiftRed & u_shiftBlue: color dispersion between the stripes\n * - u_distortion: pattern distortion on the whole canvas\n * - u_contour: distortion power over the shape edges\n * - u_shape (float used as integer):\n * ---- 0: canvas-screen rectangle, needs u_worldWidth = u_worldHeight = 0 to be responsive (see vertex shader)\n * ---- 1: static circle\n * ---- 2: animated flower-like polar shape\n * ---- 3: animated metaballs\n *\n */\n\nexport const liquidMetalFragmentShader: string = `#version 300 es\nprecision mediump float;\n\nuniform float u_time;\n\nuniform vec4 u_colorBack;\nuniform vec4 u_colorTint;\n\nuniform float u_softness;\nuniform float u_repetition;\nuniform float u_shiftRed;\nuniform float u_shiftBlue;\nuniform float u_distortion;\nuniform float u_contour;\nuniform float u_shape;\n\n${sizingVariablesDeclaration}\n\nout vec4 fragColor;\n\n${declarePI}\n${declareRotate}\n${declareSimplexNoise}\n\nfloat getColorChanges(float c1, float c2, float stripe_p, vec3 w, float blur, float bump, float tint) {\n\n float ch = mix(c2, c1, smoothstep(.0, blur, stripe_p));\n\n float border = w[0];\n ch = mix(ch, c2, smoothstep(border - blur, border + blur, stripe_p));\n\n border = w[0] + .4 * (1. - bump) * w[1];\n ch = mix(ch, c1, smoothstep(border - blur, border + blur, stripe_p));\n\n border = w[0] + .5 * (1. - bump) * w[1];\n ch = mix(ch, c2, smoothstep(border - blur, border + blur, stripe_p));\n\n border = w[0] + w[1];\n ch = mix(ch, c1, smoothstep(border - blur, border + blur, stripe_p));\n\n float gradient_t = (stripe_p - w[0] - w[1]) / w[2];\n float gradient = mix(c1, c2, smoothstep(0., 1., gradient_t));\n ch = mix(ch, gradient, smoothstep(border - blur, border + blur, stripe_p));\n \n // Tint color is applied with color burn blending\n ch = mix(ch, 1. - min(1., (1. - ch) / max(tint, 0.0001)), u_colorTint.a);\n return ch;\n}\n\nvoid main() {\n\n float t = .1 * u_time;\n\n vec2 uv = v_objectUV;\n uv += .5;\n uv.y = 1. - uv.y;\n\n float cycleWidth = .5 * u_repetition;\n\n float mask = 1.;\n float contOffset = 1.;\n\n if (u_shape < 1.) {\n\n vec2 borderUV = v_responsiveUV + .5;\n float ratio = v_responsiveBoxGivenSize.x / v_responsiveBoxGivenSize.y;\n vec2 edge = min(borderUV, 1. - borderUV);\n vec2 pixel_thickness = 250. / v_responsiveBoxGivenSize;\n float maskX = smoothstep(0.0, pixel_thickness.x, edge.x);\n float maskY = smoothstep(0.0, pixel_thickness.y, edge.y);\n maskX = pow(maskX, .25);\n maskY = pow(maskY, .25);\n mask = clamp(1. - maskX * maskY, 0., 1.);\n\n uv = v_responsiveUV;\n if (ratio > 1.) {\n uv.y /= ratio;\n } else {\n uv.x *= ratio;\n }\n uv += .5;\n uv.y = 1. - uv.y;\n\n cycleWidth *= 2.;\n contOffset = 1.5;\n\n } else if (u_shape < 2.) {\n vec2 shapeUV = uv - .5;\n shapeUV *= .67;\n mask = pow(clamp(3. * length(shapeUV), 0., 1.), 18.);\n } else if (u_shape < 3.) {\n vec2 shapeUV = uv - .5;\n shapeUV *= 1.68;\n\n float r = length(shapeUV) * 2.;\n float a = atan(shapeUV.y, shapeUV.x) + .2;\n r *= (1. + .05 * sin(3. * a + 2. * t));\n float f = abs(cos(a * 3.));\n mask = smoothstep(f, f + .7, r);\n mask = pow(mask, 2.);\n\n uv *= .8;\n cycleWidth *= 1.6;\n\n } else if (u_shape < 4.) {\n vec2 shapeUV = uv - .5;\n shapeUV *= 1.3;\n mask = 0.;\n for (int i = 0; i < 5; i++) {\n float fi = float(i);\n float speed = 4.5 + 2. * sin(fi * 12.345);\n float angle = -fi * 1.5;\n vec2 dir1 = vec2(cos(angle), sin(angle));\n vec2 dir2 = vec2(cos(angle + 1.57), sin(angle + 1.));\n vec2 traj = .4 * (dir1 * sin(t * speed + fi * 1.23) + dir2 * cos(t * (speed * 0.7) + fi * 2.17));\n float d = length(shapeUV + traj);\n mask += pow(1.0 - clamp(d, 0.0, 1.0), 4.0);\n }\n mask = 1. - smoothstep(.65, .9, mask);\n mask = pow(mask, 4.);\n }\n\n float opacity = 1. - smoothstep(.8, .82, mask);\n\n float ridge = .15 * (smoothstep(.0, .15, uv.y) * smoothstep(.4, .15, uv.y));\n ridge += .05 * (smoothstep(.1, .2, 1. - uv.y) * smoothstep(.4, .2, 1. - uv.y));\n mask += ridge;\n\n float diagBLtoTR = uv.x - uv.y;\n float diagTLtoBR = uv.x + uv.y;\n\n vec3 color = vec3(0.);\n vec3 color1 = vec3(.98, 0.98, 1.);\n vec3 color2 = vec3(.1, .1, .1 + .1 * smoothstep(.7, 1.3, diagTLtoBR));\n\n vec2 grad_uv = uv - .5;\n\n float dist = length(grad_uv + vec2(0., .2 * diagBLtoTR));\n grad_uv = rotate(grad_uv, (.25 - .2 * diagBLtoTR) * PI);\n float direction = grad_uv.x;\n\n float bump = pow(1.8 * dist, 1.2);\n bump = 1. - bump;\n bump *= pow(uv.y, .3);\n\n\n float thin_strip_1_ratio = .12 / cycleWidth * (1. - .4 * bump);\n float thin_strip_2_ratio = .07 / cycleWidth * (1. + .4 * bump);\n float wide_strip_ratio = (1. - thin_strip_1_ratio - thin_strip_2_ratio);\n\n float thin_strip_1_width = cycleWidth * thin_strip_1_ratio;\n float thin_strip_2_width = cycleWidth * thin_strip_2_ratio;\n\n float noise = snoise(uv - t);\n\n mask += (1. - mask) * u_distortion * noise;\n\n direction += diagBLtoTR;\n\n float contour = u_contour * smoothstep(0., contOffset, mask) * smoothstep(contOffset, 0., mask);\n direction -= 14. * noise * contour;\n\n bump *= clamp(pow(uv.y, .1), .3, 1.);\n direction *= (.1 + (1.1 - mask) * bump);\n direction *= smoothstep(1., .2, mask);\n\n\n direction *= (.5 + .5 * pow(uv.y, 2.));\n direction *= cycleWidth;\n direction -= t;\n\n\n float colorDispersion = (1. - bump);\n float dispersionRed = colorDispersion;\n dispersionRed += bump * noise;\n float dispersionBlue = colorDispersion;\n\n dispersionRed *= (u_shiftRed / 20.);\n dispersionBlue *= (u_shiftBlue / 20.);\n\n float blur = u_softness / 15. + .3 * contour;\n\n vec3 w = vec3(thin_strip_1_width, thin_strip_2_width, wide_strip_ratio);\n w[1] -= .02 * smoothstep(.0, 1., mask + bump);\n float stripe_r = mod(direction + dispersionRed, 1.);\n float r = getColorChanges(color1.r, color2.r, stripe_r, w, blur, bump, u_colorTint.r);\n float stripe_g = mod(direction, 1.);\n float g = getColorChanges(color1.g, color2.g, stripe_g, w, blur, bump, u_colorTint.g);\n float stripe_b = mod(direction - dispersionBlue, 1.);\n float b = getColorChanges(color1.b, color2.b, stripe_b, w, blur, bump, u_colorTint.b);\n\n color = vec3(r, g, b);\n color *= opacity;\n\n vec3 bgColor = u_colorBack.rgb * u_colorBack.a;\n color = color + bgColor * (1. - opacity);\n opacity = opacity + u_colorBack.a * (1. - opacity);\n\n ${colorBandingFix}\n\n fragColor = vec4(color, opacity);\n}\n`;\n\nexport interface LiquidMetalUniforms extends ShaderSizingUniforms {\n u_colorBack: [number, number, number, number];\n u_colorTint: [number, number, number, number];\n u_softness: number;\n u_repetition: number;\n u_shiftRed: number;\n u_shiftBlue: number;\n u_distortion: number;\n u_contour: number;\n u_shape: (typeof LiquidMetalShapes)[LiquidMetalShape];\n}\n\nexport interface LiquidMetalParams extends ShaderSizingParams, ShaderMotionParams {\n colorBack?: string;\n colorTint?: string;\n softness?: number;\n repetition?: number;\n shiftRed?: number;\n shiftBlue?: number;\n distortion?: number;\n contour?: number;\n shape?: LiquidMetalShape;\n}\n\nexport const LiquidMetalShapes = {\n none: 0,\n circle: 1,\n daisy: 2,\n metaballs: 3,\n} as const;\n\nexport type LiquidMetalShape = keyof typeof LiquidMetalShapes;\n"],
|
|
5
|
+
"mappings": ";;;;;AACA,SAAS,kCAAsF;AAC/F,SAAS,WAAW,eAAe,qBAAqB,uBAAuB;AAsBxE,MAAM,4BAAoC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgB/C,0BAA0B;AAAA;AAAA;AAAA;AAAA,EAI1B,SAAS;AAAA,EACT,aAAa;AAAA,EACb,mBAAmB;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;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;AAAA;AAAA;AAAA;AAAA,IAgLjB,eAAe;AAAA;AAAA;AAAA;AAAA;AA8BZ,MAAM,oBAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AACb;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { vec4 } from '../types';
|
|
2
|
-
import type { ShaderMotionParams } from '../shader-mount';
|
|
3
|
-
import { type ShaderSizingParams, type ShaderSizingUniforms } from '../shader-sizing';
|
|
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
4
|
export declare const meshGradientMeta: {
|
|
5
5
|
readonly maxColorCount: 10;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* A composition of N color spots (one per color) with 2 types of
|
|
9
|
+
* distortions applied to the coordinate space
|
|
10
|
+
*
|
|
11
|
+
* Uniforms:
|
|
12
|
+
* - u_colors (vec4[]), u_colorsCount (float used as integer)
|
|
13
|
+
* - u_distortion: warp distortion
|
|
14
|
+
* - u_swirl: vortex distortion
|
|
10
15
|
*
|
|
11
|
-
* Uniforms include:
|
|
12
|
-
* - u_colors (vec4[]): Input RGBA colors
|
|
13
|
-
* - u_colorsCount (float): Number of active colors (`u_colors` length)
|
|
14
|
-
* - u_distortion (float): Amount of animated wavy distortion applied to UV coordinates
|
|
15
|
-
* - u_swirl (float): Amount of radial swirl distortion applied to UV coordinates
|
|
16
16
|
*/
|
|
17
17
|
export declare const meshGradientFragmentShader: string;
|
|
18
18
|
export interface MeshGradientUniforms extends ShaderSizingUniforms {
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
2
|
+
* Paper Shaders *
|
|
3
|
+
* https://github.com/paper-design/shaders *
|
|
4
|
+
* * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
5
|
+
|
|
6
|
+
import { sizingVariablesDeclaration } from "../shader-sizing.js";
|
|
7
|
+
import { declarePI, declareRotate, colorBandingFix } from "../shader-utils.js";
|
|
8
|
+
const meshGradientMeta = {
|
|
9
|
+
maxColorCount: 10
|
|
10
|
+
};
|
|
11
|
+
const meshGradientFragmentShader = `#version 300 es
|
|
12
|
+
precision mediump float;
|
|
13
|
+
|
|
14
|
+
uniform float u_time;
|
|
15
|
+
|
|
16
|
+
uniform vec4 u_colors[${meshGradientMeta.maxColorCount}];
|
|
17
|
+
uniform float u_colorsCount;
|
|
18
|
+
|
|
19
|
+
uniform float u_distortion;
|
|
20
|
+
uniform float u_swirl;
|
|
21
|
+
|
|
22
|
+
${sizingVariablesDeclaration}
|
|
23
|
+
|
|
24
|
+
out vec4 fragColor;
|
|
25
|
+
|
|
26
|
+
${declarePI}
|
|
27
|
+
${declareRotate}
|
|
28
|
+
|
|
29
|
+
vec2 getPosition(int i, float t) {
|
|
30
|
+
float a = float(i) * .37;
|
|
31
|
+
float b = .6 + mod(float(i), 3.) * .3;
|
|
32
|
+
float c = .8 + mod(float(i + 1), 4.) * 0.25;
|
|
33
|
+
|
|
34
|
+
float x = sin(t * b + a);
|
|
35
|
+
float y = cos(t * c + a * 1.5);
|
|
36
|
+
|
|
37
|
+
return .5 + .5 * vec2(x, y);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
void main() {
|
|
41
|
+
vec2 shape_uv = v_objectUV;
|
|
42
|
+
|
|
43
|
+
shape_uv += .5;
|
|
44
|
+
|
|
45
|
+
float t = .5 * u_time;
|
|
46
|
+
|
|
47
|
+
float radius = smoothstep(0., 1., length(shape_uv - .5));
|
|
48
|
+
float center = 1. - radius;
|
|
49
|
+
for (float i = 1.; i <= 2.; i++) {
|
|
50
|
+
shape_uv.x += u_distortion * center / i * sin(t + i * .4 * smoothstep(.0, 1., shape_uv.y)) * cos(.2 * t + i * 2.4 * smoothstep(.0, 1., shape_uv.y));
|
|
51
|
+
shape_uv.y += u_distortion * center / i * cos(t + i * 2. * smoothstep(.0, 1., shape_uv.x));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
vec2 uvRotated = shape_uv;
|
|
55
|
+
uvRotated -= vec2(.5);
|
|
56
|
+
float angle = 3. * u_swirl * radius;
|
|
57
|
+
uvRotated = rotate(uvRotated, -angle);
|
|
58
|
+
uvRotated += vec2(.5);
|
|
59
|
+
|
|
60
|
+
vec3 color = vec3(0.);
|
|
61
|
+
float opacity = 0.;
|
|
62
|
+
float totalWeight = 0.;
|
|
63
|
+
|
|
64
|
+
for (int i = 0; i < ${meshGradientMeta.maxColorCount}; i++) {
|
|
65
|
+
if (i >= int(u_colorsCount)) break;
|
|
66
|
+
|
|
67
|
+
vec2 pos = getPosition(i, t);
|
|
68
|
+
vec3 colorFraction = u_colors[i].rgb * u_colors[i].a;
|
|
69
|
+
float opacityFraction = u_colors[i].a;
|
|
70
|
+
|
|
71
|
+
float dist = 0.;
|
|
72
|
+
if (mod(float(i), 2.) > 1.) {
|
|
73
|
+
dist = length(shape_uv - pos);
|
|
74
|
+
} else {
|
|
75
|
+
dist = length(uvRotated - pos);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
dist = pow(dist, 3.5);
|
|
79
|
+
float weight = 1. / (dist + 1e-3);
|
|
80
|
+
color += colorFraction * weight;
|
|
81
|
+
opacity += opacityFraction * weight;
|
|
82
|
+
totalWeight += weight;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
color /= totalWeight;
|
|
86
|
+
opacity /= totalWeight;
|
|
87
|
+
|
|
88
|
+
${colorBandingFix}
|
|
89
|
+
|
|
90
|
+
fragColor = vec4(color, opacity);
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
93
|
+
export {
|
|
94
|
+
meshGradientFragmentShader,
|
|
95
|
+
meshGradientMeta
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=mesh-gradient.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shaders/mesh-gradient.ts"],
|
|
4
|
+
"sourcesContent": ["import type { vec4 } from '../types.js';\nimport type { ShaderMotionParams } from '../shader-mount.js';\nimport { sizingVariablesDeclaration, type ShaderSizingParams, type ShaderSizingUniforms } from '../shader-sizing.js';\nimport { declarePI, declareRotate, colorBandingFix } from '../shader-utils.js';\n\nexport const meshGradientMeta = {\n maxColorCount: 10,\n} as const;\n\n/**\n * A composition of N color spots (one per color) with 2 types of\n * distortions applied to the coordinate space\n *\n * Uniforms:\n * - u_colors (vec4[]), u_colorsCount (float used as integer)\n * - u_distortion: warp distortion\n * - u_swirl: vortex distortion\n *\n */\n\nexport const meshGradientFragmentShader: string = `#version 300 es\nprecision mediump float;\n\nuniform float u_time;\n\nuniform vec4 u_colors[${meshGradientMeta.maxColorCount}];\nuniform float u_colorsCount;\n\nuniform float u_distortion;\nuniform float u_swirl;\n\n${sizingVariablesDeclaration}\n\nout vec4 fragColor;\n\n${declarePI}\n${declareRotate}\n\nvec2 getPosition(int i, float t) {\n float a = float(i) * .37;\n float b = .6 + mod(float(i), 3.) * .3;\n float c = .8 + mod(float(i + 1), 4.) * 0.25;\n\n float x = sin(t * b + a);\n float y = cos(t * c + a * 1.5);\n\n return .5 + .5 * vec2(x, y);\n}\n\nvoid main() {\n vec2 shape_uv = v_objectUV;\n\n shape_uv += .5;\n\n float t = .5 * u_time;\n\n float radius = smoothstep(0., 1., length(shape_uv - .5));\n float center = 1. - radius;\n for (float i = 1.; i <= 2.; i++) {\n shape_uv.x += u_distortion * center / i * sin(t + i * .4 * smoothstep(.0, 1., shape_uv.y)) * cos(.2 * t + i * 2.4 * smoothstep(.0, 1., shape_uv.y));\n shape_uv.y += u_distortion * center / i * cos(t + i * 2. * smoothstep(.0, 1., shape_uv.x));\n }\n\n vec2 uvRotated = shape_uv;\n uvRotated -= vec2(.5);\n float angle = 3. * u_swirl * radius;\n uvRotated = rotate(uvRotated, -angle);\n uvRotated += vec2(.5);\n\n vec3 color = vec3(0.);\n float opacity = 0.;\n float totalWeight = 0.;\n\n for (int i = 0; i < ${meshGradientMeta.maxColorCount}; i++) {\n if (i >= int(u_colorsCount)) break;\n\n vec2 pos = getPosition(i, t);\n vec3 colorFraction = u_colors[i].rgb * u_colors[i].a;\n float opacityFraction = u_colors[i].a;\n\n float dist = 0.;\n if (mod(float(i), 2.) > 1.) {\n dist = length(shape_uv - pos);\n } else {\n dist = length(uvRotated - pos);\n }\n\n dist = pow(dist, 3.5);\n float weight = 1. / (dist + 1e-3);\n color += colorFraction * weight;\n opacity += opacityFraction * weight;\n totalWeight += weight;\n }\n\n color /= totalWeight;\n opacity /= totalWeight;\n\n ${colorBandingFix}\n\n fragColor = vec4(color, opacity);\n}\n`;\n\nexport interface MeshGradientUniforms extends ShaderSizingUniforms {\n u_colors: vec4[];\n u_colorsCount: number;\n u_distortion: number;\n u_swirl: number;\n}\n\nexport interface MeshGradientParams extends ShaderSizingParams, ShaderMotionParams {\n colors?: string[];\n distortion?: number;\n swirl?: number;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAEA,SAAS,kCAAsF;AAC/F,SAAS,WAAW,eAAe,uBAAuB;AAEnD,MAAM,mBAAmB;AAAA,EAC9B,eAAe;AACjB;AAaO,MAAM,6BAAqC;AAAA;AAAA;AAAA;AAAA;AAAA,wBAK1B,iBAAiB,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMpD,0BAA0B;AAAA;AAAA;AAAA;AAAA,EAI1B,SAAS;AAAA,EACT,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,wBAqCS,iBAAiB,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,IAwBlD,eAAe;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
import type { vec4 } from '../types';
|
|
2
|
-
import type { ShaderMotionParams } from '../shader-mount';
|
|
3
|
-
import { type ShaderSizingParams, type ShaderSizingUniforms } from '../shader-sizing';
|
|
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
4
|
export declare const metaballsMeta: {
|
|
5
5
|
readonly maxColorCount: 8;
|
|
6
6
|
readonly maxBallsCount: 20;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* N circular shapes moving around the center, blending and merging based on distance
|
|
10
|
+
*
|
|
11
|
+
* Uniforms:
|
|
12
|
+
* - u_colorBack (RGBA)
|
|
13
|
+
* - u_colors (vec4[]), u_colorsCount (float used as integer)
|
|
14
|
+
* - u_size: ball base size
|
|
15
|
+
* - u_sizeRange (0..1): randomizes the size of balls between 0 and u_size
|
|
16
|
+
* - u_count: number of balls on the canvas
|
|
11
17
|
*
|
|
12
|
-
* Uniforms include:
|
|
13
|
-
* - uColors (vec4[]): Input RGBA colors
|
|
14
|
-
* - uColorsCount (float): Number of active colors (`uColors` length)
|
|
15
|
-
* - u_count (float)
|
|
16
|
-
* - u_size (float)
|
|
17
18
|
*/
|
|
18
19
|
export declare const metaballsFragmentShader: string;
|
|
19
20
|
export interface MetaballsUniforms extends ShaderSizingUniforms {
|
|
21
|
+
u_colorBack: [number, number, number, number];
|
|
20
22
|
u_colors: vec4[];
|
|
21
23
|
u_colorsCount: number;
|
|
22
24
|
u_count: number;
|
|
23
25
|
u_size: number;
|
|
24
26
|
}
|
|
25
27
|
export interface MetaballsParams extends ShaderSizingParams, ShaderMotionParams {
|
|
28
|
+
colorBack?: string;
|
|
26
29
|
colors?: string[];
|
|
27
30
|
count?: number;
|
|
28
31
|
size?: number;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
2
|
+
* Paper Shaders *
|
|
3
|
+
* https://github.com/paper-design/shaders *
|
|
4
|
+
* * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
5
|
+
|
|
6
|
+
import { sizingVariablesDeclaration } from "../shader-sizing.js";
|
|
7
|
+
import { declarePI, colorBandingFix } from "../shader-utils.js";
|
|
8
|
+
const metaballsMeta = {
|
|
9
|
+
maxColorCount: 8,
|
|
10
|
+
maxBallsCount: 20
|
|
11
|
+
};
|
|
12
|
+
const metaballsFragmentShader = `#version 300 es
|
|
13
|
+
precision mediump float;
|
|
14
|
+
|
|
15
|
+
uniform float u_time;
|
|
16
|
+
|
|
17
|
+
uniform vec4 u_colorBack;
|
|
18
|
+
uniform vec4 u_colors[${metaballsMeta.maxColorCount}];
|
|
19
|
+
uniform float u_colorsCount;
|
|
20
|
+
uniform float u_size;
|
|
21
|
+
uniform float u_sizeRange;
|
|
22
|
+
uniform float u_count;
|
|
23
|
+
|
|
24
|
+
${sizingVariablesDeclaration}
|
|
25
|
+
|
|
26
|
+
out vec4 fragColor;
|
|
27
|
+
|
|
28
|
+
${declarePI}
|
|
29
|
+
|
|
30
|
+
float hash(float x) {
|
|
31
|
+
return fract(sin(x) * 43758.5453123);
|
|
32
|
+
}
|
|
33
|
+
float noise(float x) {
|
|
34
|
+
float i = floor(x);
|
|
35
|
+
float f = fract(x);
|
|
36
|
+
float u = f * f * (3.0 - 2.0 * f);
|
|
37
|
+
return mix(hash(i), hash(i + 1.0), u);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
float getBallShape(vec2 uv, vec2 c, float p) {
|
|
41
|
+
float s = .5 * length(uv - c);
|
|
42
|
+
s = 1. - clamp(s, 0., 1.);
|
|
43
|
+
s = pow(s, p);
|
|
44
|
+
return s;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
void main() {
|
|
48
|
+
vec2 shape_uv = v_objectUV;
|
|
49
|
+
|
|
50
|
+
shape_uv += .5;
|
|
51
|
+
|
|
52
|
+
float t = .2 * u_time + 1.;
|
|
53
|
+
|
|
54
|
+
vec3 totalColor = vec3(0.);
|
|
55
|
+
float totalShape = 0.;
|
|
56
|
+
float totalOpacity = 0.;
|
|
57
|
+
|
|
58
|
+
for (int i = 0; i < ${metaballsMeta.maxBallsCount}; i++) {
|
|
59
|
+
if (i >= int(ceil(u_count))) break;
|
|
60
|
+
|
|
61
|
+
float idxFract = float(i) / float(${metaballsMeta.maxBallsCount});
|
|
62
|
+
float angle = TWO_PI * idxFract;
|
|
63
|
+
|
|
64
|
+
float speed = 1. - .2 * idxFract;
|
|
65
|
+
float noiseX = noise(angle * 10. + float(i) + t * speed);
|
|
66
|
+
float noiseY = noise(angle * 20. + float(i) - t * speed);
|
|
67
|
+
|
|
68
|
+
vec2 pos = vec2(.5) + 1e-4 + .9 * (vec2(noiseX, noiseY) - .5);
|
|
69
|
+
|
|
70
|
+
int safeIndex = i % int(u_colorsCount + 0.5);
|
|
71
|
+
vec4 ballColor = u_colors[safeIndex];
|
|
72
|
+
ballColor.rgb *= ballColor.a;
|
|
73
|
+
|
|
74
|
+
float sizeFrac = 1.;
|
|
75
|
+
if (float(i) > floor(u_count - 1.)) {
|
|
76
|
+
sizeFrac *= fract(u_count);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
float shape = getBallShape(shape_uv, pos, 45. - 30. * u_size * sizeFrac);
|
|
80
|
+
shape *= pow(u_size, .2);
|
|
81
|
+
shape = smoothstep(0., 1., shape);
|
|
82
|
+
|
|
83
|
+
totalColor += ballColor.rgb * shape;
|
|
84
|
+
totalShape += shape;
|
|
85
|
+
totalOpacity += ballColor.a * shape;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
totalColor /= max(totalShape, 1e-4);
|
|
89
|
+
totalOpacity /= max(totalShape, 1e-4);
|
|
90
|
+
|
|
91
|
+
float edge_width = fwidth(totalShape);
|
|
92
|
+
float finalShape = smoothstep(.4, .4 + edge_width, totalShape);
|
|
93
|
+
|
|
94
|
+
vec3 color = totalColor * finalShape;
|
|
95
|
+
float opacity = totalOpacity * finalShape;
|
|
96
|
+
|
|
97
|
+
vec3 bgColor = u_colorBack.rgb * u_colorBack.a;
|
|
98
|
+
color = color + bgColor * (1. - opacity);
|
|
99
|
+
opacity = opacity + u_colorBack.a * (1. - opacity);
|
|
100
|
+
|
|
101
|
+
${colorBandingFix}
|
|
102
|
+
|
|
103
|
+
fragColor = vec4(color, opacity);
|
|
104
|
+
}
|
|
105
|
+
`;
|
|
106
|
+
export {
|
|
107
|
+
metaballsFragmentShader,
|
|
108
|
+
metaballsMeta
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=metaballs.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shaders/metaballs.ts"],
|
|
4
|
+
"sourcesContent": ["import type { vec4 } from '../types.js';\nimport type { ShaderMotionParams } from '../shader-mount.js';\nimport { sizingVariablesDeclaration, type ShaderSizingParams, type ShaderSizingUniforms } from '../shader-sizing.js';\nimport { declarePI, colorBandingFix } from '../shader-utils.js';\n\nexport const metaballsMeta = {\n maxColorCount: 8,\n maxBallsCount: 20,\n} as const;\n\n/**\n * N circular shapes moving around the center, blending and merging based on distance\n *\n * Uniforms:\n * - u_colorBack (RGBA)\n * - u_colors (vec4[]), u_colorsCount (float used as integer)\n * - u_size: ball base size\n * - u_sizeRange (0..1): randomizes the size of balls between 0 and u_size\n * - u_count: number of balls on the canvas\n *\n */\n\nexport const metaballsFragmentShader: string = `#version 300 es\nprecision mediump float;\n\nuniform float u_time;\n\nuniform vec4 u_colorBack;\nuniform vec4 u_colors[${metaballsMeta.maxColorCount}];\nuniform float u_colorsCount;\nuniform float u_size;\nuniform float u_sizeRange;\nuniform float u_count;\n\n${sizingVariablesDeclaration}\n\nout vec4 fragColor;\n\n${declarePI}\n\nfloat hash(float x) {\n return fract(sin(x) * 43758.5453123);\n}\nfloat noise(float x) {\n float i = floor(x);\n float f = fract(x);\n float u = f * f * (3.0 - 2.0 * f);\n return mix(hash(i), hash(i + 1.0), u);\n}\n\nfloat getBallShape(vec2 uv, vec2 c, float p) {\n float s = .5 * length(uv - c);\n s = 1. - clamp(s, 0., 1.);\n s = pow(s, p);\n return s;\n}\n\nvoid main() {\n vec2 shape_uv = v_objectUV;\n\n shape_uv += .5;\n\n float t = .2 * u_time + 1.;\n\n vec3 totalColor = vec3(0.);\n float totalShape = 0.;\n float totalOpacity = 0.;\n\n for (int i = 0; i < ${metaballsMeta.maxBallsCount}; i++) {\n if (i >= int(ceil(u_count))) break;\n\n float idxFract = float(i) / float(${metaballsMeta.maxBallsCount});\n float angle = TWO_PI * idxFract;\n\n float speed = 1. - .2 * idxFract;\n float noiseX = noise(angle * 10. + float(i) + t * speed);\n float noiseY = noise(angle * 20. + float(i) - t * speed);\n\n vec2 pos = vec2(.5) + 1e-4 + .9 * (vec2(noiseX, noiseY) - .5);\n\n int safeIndex = i % int(u_colorsCount + 0.5);\n vec4 ballColor = u_colors[safeIndex];\n ballColor.rgb *= ballColor.a;\n\n float sizeFrac = 1.;\n if (float(i) > floor(u_count - 1.)) {\n sizeFrac *= fract(u_count);\n }\n\n float shape = getBallShape(shape_uv, pos, 45. - 30. * u_size * sizeFrac);\n shape *= pow(u_size, .2);\n shape = smoothstep(0., 1., shape);\n\n totalColor += ballColor.rgb * shape;\n totalShape += shape;\n totalOpacity += ballColor.a * shape;\n }\n\n totalColor /= max(totalShape, 1e-4);\n totalOpacity /= max(totalShape, 1e-4);\n\n float edge_width = fwidth(totalShape);\n float finalShape = smoothstep(.4, .4 + edge_width, totalShape);\n\n vec3 color = totalColor * finalShape;\n float opacity = totalOpacity * finalShape;\n\n vec3 bgColor = u_colorBack.rgb * u_colorBack.a;\n color = color + bgColor * (1. - opacity);\n opacity = opacity + u_colorBack.a * (1. - opacity);\n\n ${colorBandingFix}\n\n fragColor = vec4(color, opacity);\n}\n`;\n\nexport interface MetaballsUniforms extends ShaderSizingUniforms {\n u_colorBack: [number, number, number, number];\n u_colors: vec4[];\n u_colorsCount: number;\n u_count: number;\n u_size: number;\n}\n\nexport interface MetaballsParams extends ShaderSizingParams, ShaderMotionParams {\n colorBack?: string;\n colors?: string[];\n count?: number;\n size?: number;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAEA,SAAS,kCAAsF;AAC/F,SAAS,WAAW,uBAAuB;AAEpC,MAAM,gBAAgB;AAAA,EAC3B,eAAe;AAAA,EACf,eAAe;AACjB;AAcO,MAAM,0BAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAMvB,cAAc,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjD,0BAA0B;AAAA;AAAA;AAAA;AAAA,EAI1B,SAAS;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,wBA8Ba,cAAc,aAAa;AAAA;AAAA;AAAA,wCAGX,cAAc,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,IAwC/D,eAAe;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|