@paper-design/shaders 0.0.31-backbuffer-experiment.2 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +7 -4
  2. package/dist/index.d.ts +1 -1
  3. package/dist/shader-mount.d.ts +0 -9
  4. package/dist/shaders/dithering.d.ts +6 -6
  5. package/dist/shaders/dot-orbit.d.ts +0 -3
  6. package/dist/shaders/god-rays.d.ts +3 -6
  7. package/dist/shaders/grain-gradient.d.ts +0 -2
  8. package/dist/shaders/liquid-metal.d.ts +10 -25
  9. package/dist/shaders/metaballs.d.ts +0 -3
  10. package/dist/shaders/neuro-noise.d.ts +4 -10
  11. package/dist/shaders/perlin-noise.d.ts +8 -8
  12. package/dist/shaders/spiral.d.ts +6 -6
  13. package/dist/shaders/swirl.d.ts +0 -2
  14. package/dist/shaders/voronoi.d.ts +5 -5
  15. package/dist/shaders/waves.d.ts +6 -6
  16. package/package.json +2 -2
  17. package/dist/get-shader-color-from-string.js +0 -93
  18. package/dist/get-shader-color-from-string.js.map +0 -7
  19. package/dist/get-shader-noise-texture.js +0 -23
  20. package/dist/get-shader-noise-texture.js.map +0 -7
  21. package/dist/index.js +0 -109
  22. package/dist/index.js.map +0 -7
  23. package/dist/shader-color-spaces.js +0 -96
  24. package/dist/shader-color-spaces.js.map +0 -7
  25. package/dist/shader-mount.js +0 -733
  26. package/dist/shader-mount.js.map +0 -7
  27. package/dist/shader-sizing.js +0 -193
  28. package/dist/shader-sizing.js.map +0 -7
  29. package/dist/shader-utils.js +0 -59
  30. package/dist/shader-utils.js.map +0 -7
  31. package/dist/shaders/dithering.js +0 -221
  32. package/dist/shaders/dithering.js.map +0 -7
  33. package/dist/shaders/dot-grid.js +0 -107
  34. package/dist/shaders/dot-grid.js.map +0 -7
  35. package/dist/shaders/dot-orbit.js +0 -124
  36. package/dist/shaders/dot-orbit.js.map +0 -7
  37. package/dist/shaders/god-rays.js +0 -133
  38. package/dist/shaders/god-rays.js.map +0 -7
  39. package/dist/shaders/grain-gradient.js +0 -243
  40. package/dist/shaders/grain-gradient.js.map +0 -7
  41. package/dist/shaders/liquid-metal.js +0 -221
  42. package/dist/shaders/liquid-metal.js.map +0 -7
  43. package/dist/shaders/mesh-gradient.js +0 -97
  44. package/dist/shaders/mesh-gradient.js.map +0 -7
  45. package/dist/shaders/metaballs.js +0 -110
  46. package/dist/shaders/metaballs.js.map +0 -7
  47. package/dist/shaders/neuro-noise.js +0 -81
  48. package/dist/shaders/neuro-noise.js.map +0 -7
  49. package/dist/shaders/perlin-noise.js +0 -201
  50. package/dist/shaders/perlin-noise.js.map +0 -7
  51. package/dist/shaders/pulsing-border.js +0 -218
  52. package/dist/shaders/pulsing-border.js.map +0 -7
  53. package/dist/shaders/simplex-noise.js +0 -103
  54. package/dist/shaders/simplex-noise.js.map +0 -7
  55. package/dist/shaders/smoke-ring.js +0 -141
  56. package/dist/shaders/smoke-ring.js.map +0 -7
  57. package/dist/shaders/spiral.js +0 -83
  58. package/dist/shaders/spiral.js.map +0 -7
  59. package/dist/shaders/swirl.js +0 -91
  60. package/dist/shaders/swirl.js.map +0 -7
  61. package/dist/shaders/voronoi.js +0 -143
  62. package/dist/shaders/voronoi.js.map +0 -7
  63. package/dist/shaders/warp.js +0 -128
  64. package/dist/shaders/warp.js.map +0 -7
  65. package/dist/shaders/waves.js +0 -68
  66. package/dist/shaders/waves.js.map +0 -7
  67. package/dist/types.js +0 -6
  68. package/dist/types.js.map +0 -7
@@ -1,68 +0,0 @@
1
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
2
- * Paper Shaders *
3
- * https://github.com/paper-design/shaders *
4
- * * * * * * * * * * * * * * * * * * * * * * * * * * * */
5
-
6
- import { sizingVariablesDeclaration } from "../shader-sizing";
7
- import { declarePI, declareRotate } from "../shader-utils";
8
- const wavesFragmentShader = `#version 300 es
9
- precision mediump float;
10
-
11
- uniform float u_scale;
12
-
13
- uniform vec4 u_colorFront;
14
- uniform vec4 u_colorBack;
15
- uniform float u_shape;
16
- uniform float u_frequency;
17
- uniform float u_amplitude;
18
- uniform float u_spacing;
19
- uniform float u_proportion;
20
- uniform float u_softness;
21
-
22
- ${sizingVariablesDeclaration}
23
-
24
- out vec4 fragColor;
25
-
26
- ${declarePI}
27
- ${declareRotate}
28
-
29
- void main() {
30
- vec2 shape_uv = v_patternUV;
31
- shape_uv *= .05;
32
-
33
- float wave = .5 * cos(shape_uv.x * u_frequency * TWO_PI);
34
- float zigzag = 2. * abs(fract(shape_uv.x * u_frequency) - .5);
35
- float irregular = sin(shape_uv.x * .25 * u_frequency * TWO_PI) * cos(shape_uv.x * u_frequency * TWO_PI);
36
- float irregular2 = .75 * (sin(shape_uv.x * u_frequency * TWO_PI) + .5 * cos(shape_uv.x * .5 * u_frequency * TWO_PI));
37
-
38
- float offset = mix(zigzag, wave, smoothstep(0., 1., u_shape));
39
- offset = mix(offset, irregular, smoothstep(1., 2., u_shape));
40
- offset = mix(offset, irregular2, smoothstep(2., 3., u_shape));
41
- offset *= 2. * u_amplitude;
42
-
43
- float spacing = .02 + .98 * u_spacing;
44
- float shape = .5 + .5 * sin((shape_uv.y + offset) * PI / spacing);
45
-
46
- float edge_width = .02 / (1. + abs(shape)) * (.001 + u_scale);
47
- edge_width += .5 * max(0., u_softness);
48
- float dc = 1. - clamp(u_proportion, 0., 1.);
49
- float res = smoothstep(dc - edge_width, dc + edge_width, shape);
50
-
51
- vec3 fgColor = u_colorFront.rgb * u_colorFront.a;
52
- float fgOpacity = u_colorFront.a;
53
- vec3 bgColor = u_colorBack.rgb * u_colorBack.a;
54
- float bgOpacity = u_colorBack.a;
55
-
56
- vec3 color = fgColor * res;
57
- float opacity = fgOpacity * res;
58
-
59
- color += bgColor * (1. - opacity);
60
- opacity += bgOpacity * (1. - opacity);
61
-
62
- fragColor = vec4(color, opacity);
63
- }
64
- `;
65
- export {
66
- wavesFragmentShader
67
- };
68
- //# sourceMappingURL=waves.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/shaders/waves.ts"],
4
- "sourcesContent": ["import { sizingVariablesDeclaration, type ShaderSizingParams, type ShaderSizingUniforms } from '../shader-sizing';\nimport { declarePI, declareRotate } from '../shader-utils';\n\n/**\n * Waves static pattern on the transparent background\n *\n * Uniforms include:\n * u_colorFront - the first color\n * u_colorBack - the second color\n * u_shape (0 ... 3) - the line shaping coefficient, non-integer\n values allowed and produce mixed shapes\n - u_shape = 0 is zigzag\n - u_shape = 1 is perfect sine wave\n - u_shape = 2 is irregular wave #1\n - u_shape = 3 is irregular wave #2\n * u_frequency - the wave frequency\n * u_amplitude - the wave amplitude\n * u_spacing - the density of pattern lines\n * u_proportion (0 ... 1) - the proportion of stroke width to the pattern step\n * u_softness (0 ... 1) - the blur applied to the lines edges\n */\nexport const wavesFragmentShader: string = `#version 300 es\nprecision mediump float;\n\nuniform float u_scale;\n\nuniform vec4 u_colorFront;\nuniform vec4 u_colorBack;\nuniform float u_shape;\nuniform float u_frequency;\nuniform float u_amplitude;\nuniform float u_spacing;\nuniform float u_proportion;\nuniform float u_softness;\n\n${sizingVariablesDeclaration}\n\nout vec4 fragColor;\n\n${declarePI}\n${declareRotate}\n\nvoid main() {\n vec2 shape_uv = v_patternUV;\n shape_uv *= .05;\n\n float wave = .5 * cos(shape_uv.x * u_frequency * TWO_PI);\n float zigzag = 2. * abs(fract(shape_uv.x * u_frequency) - .5);\n float irregular = sin(shape_uv.x * .25 * u_frequency * TWO_PI) * cos(shape_uv.x * u_frequency * TWO_PI);\n float irregular2 = .75 * (sin(shape_uv.x * u_frequency * TWO_PI) + .5 * cos(shape_uv.x * .5 * u_frequency * TWO_PI));\n\n float offset = mix(zigzag, wave, smoothstep(0., 1., u_shape));\n offset = mix(offset, irregular, smoothstep(1., 2., u_shape));\n offset = mix(offset, irregular2, smoothstep(2., 3., u_shape));\n offset *= 2. * u_amplitude;\n\n float spacing = .02 + .98 * u_spacing;\n float shape = .5 + .5 * sin((shape_uv.y + offset) * PI / spacing);\n\n float edge_width = .02 / (1. + abs(shape)) * (.001 + u_scale);\n edge_width += .5 * max(0., u_softness);\n float dc = 1. - clamp(u_proportion, 0., 1.);\n float res = smoothstep(dc - edge_width, dc + edge_width, shape);\n\n vec3 fgColor = u_colorFront.rgb * u_colorFront.a;\n float fgOpacity = u_colorFront.a;\n vec3 bgColor = u_colorBack.rgb * u_colorBack.a;\n float bgOpacity = u_colorBack.a;\n\n vec3 color = fgColor * res;\n float opacity = fgOpacity * res;\n \n color += bgColor * (1. - opacity);\n opacity += bgOpacity * (1. - opacity);\n\n fragColor = vec4(color, opacity);\n}\n`;\n\nexport interface WavesUniforms extends ShaderSizingUniforms {\n u_colorFront: [number, number, number, number];\n u_colorBack: [number, number, number, number];\n u_shape: number;\n u_frequency: number;\n u_amplitude: number;\n u_spacing: number;\n u_proportion: number;\n u_softness: number;\n}\n\nexport interface WavesParams extends ShaderSizingParams {\n colorFront?: string;\n colorBack?: string;\n rotation?: number;\n shape?: number;\n frequency?: number;\n amplitude?: number;\n spacing?: number;\n proportion?: number;\n softness?: number;\n}\n"],
5
- "mappings": ";;;;;AAAA,SAAS,kCAAsF;AAC/F,SAAS,WAAW,qBAAqB;AAoBlC,MAAM,sBAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAczC,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;",
6
- "names": []
7
- }
package/dist/types.js DELETED
@@ -1,6 +0,0 @@
1
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
2
- * Paper Shaders *
3
- * https://github.com/paper-design/shaders *
4
- * * * * * * * * * * * * * * * * * * * * * * * * * * * */
5
-
6
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }