@paper-design/shaders 0.0.30 → 0.0.31-backbuffer-experiment.0

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 (53) hide show
  1. package/package.json +2 -2
  2. package/dist/get-shader-color-from-string.js +0 -93
  3. package/dist/get-shader-color-from-string.js.map +0 -7
  4. package/dist/get-shader-noise-texture.js +0 -23
  5. package/dist/get-shader-noise-texture.js.map +0 -7
  6. package/dist/index.js +0 -105
  7. package/dist/index.js.map +0 -7
  8. package/dist/shader-color-spaces.js +0 -96
  9. package/dist/shader-color-spaces.js.map +0 -7
  10. package/dist/shader-mount.js +0 -582
  11. package/dist/shader-mount.js.map +0 -7
  12. package/dist/shader-sizing.js +0 -193
  13. package/dist/shader-sizing.js.map +0 -7
  14. package/dist/shader-utils.js +0 -59
  15. package/dist/shader-utils.js.map +0 -7
  16. package/dist/shaders/dithering.js +0 -213
  17. package/dist/shaders/dithering.js.map +0 -7
  18. package/dist/shaders/dot-grid.js +0 -107
  19. package/dist/shaders/dot-grid.js.map +0 -7
  20. package/dist/shaders/dot-orbit.js +0 -120
  21. package/dist/shaders/dot-orbit.js.map +0 -7
  22. package/dist/shaders/god-rays.js +0 -134
  23. package/dist/shaders/god-rays.js.map +0 -7
  24. package/dist/shaders/grain-gradient.js +0 -229
  25. package/dist/shaders/grain-gradient.js.map +0 -7
  26. package/dist/shaders/liquid-metal.js +0 -224
  27. package/dist/shaders/liquid-metal.js.map +0 -7
  28. package/dist/shaders/mesh-gradient.js +0 -97
  29. package/dist/shaders/mesh-gradient.js.map +0 -7
  30. package/dist/shaders/metaballs.js +0 -109
  31. package/dist/shaders/metaballs.js.map +0 -7
  32. package/dist/shaders/neuro-noise.js +0 -66
  33. package/dist/shaders/neuro-noise.js.map +0 -7
  34. package/dist/shaders/perlin-noise.js +0 -193
  35. package/dist/shaders/perlin-noise.js.map +0 -7
  36. package/dist/shaders/pulsing-border.js +0 -218
  37. package/dist/shaders/pulsing-border.js.map +0 -7
  38. package/dist/shaders/simplex-noise.js +0 -103
  39. package/dist/shaders/simplex-noise.js.map +0 -7
  40. package/dist/shaders/smoke-ring.js +0 -141
  41. package/dist/shaders/smoke-ring.js.map +0 -7
  42. package/dist/shaders/spiral.js +0 -75
  43. package/dist/shaders/spiral.js.map +0 -7
  44. package/dist/shaders/swirl.js +0 -80
  45. package/dist/shaders/swirl.js.map +0 -7
  46. package/dist/shaders/voronoi.js +0 -143
  47. package/dist/shaders/voronoi.js.map +0 -7
  48. package/dist/shaders/warp.js +0 -124
  49. package/dist/shaders/warp.js.map +0 -7
  50. package/dist/shaders/waves.js +0 -60
  51. package/dist/shaders/waves.js.map +0 -7
  52. package/dist/types.js +0 -6
  53. package/dist/types.js.map +0 -7
@@ -1,60 +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_color1;
14
- uniform vec4 u_color2;
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 = clamp(u_proportion, 0., 1.);
49
- float t = smoothstep(dc - edge_width, dc + edge_width, shape);
50
-
51
- vec3 color = mix(u_color1.rgb * u_color1.a, u_color2.rgb * u_color2.a, t);
52
- float opacity = mix(u_color1.a, u_color2.a, t);
53
-
54
- fragColor = vec4(color, opacity);
55
- }
56
- `;
57
- export {
58
- wavesFragmentShader
59
- };
60
- //# 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_color1 - the first color\n * u_color2 - 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_color1;\nuniform vec4 u_color2;\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 = clamp(u_proportion, 0., 1.);\n float t = smoothstep(dc - edge_width, dc + edge_width, shape);\n\n vec3 color = mix(u_color1.rgb * u_color1.a, u_color2.rgb * u_color2.a, t);\n float opacity = mix(u_color1.a, u_color2.a, t);\n\n fragColor = vec4(color, opacity);\n}\n`;\n\nexport interface WavesUniforms extends ShaderSizingUniforms {\n u_color1: [number, number, number, number];\n u_color2: [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 color1?: string;\n color2?: 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;",
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
- }