react-native-webrtc-kaleidoscope 2.3.0 → 2.4.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 (62) hide show
  1. package/README.md +12 -3
  2. package/android/src/main/java/com/simiancraft/kaleidoscope/gpu/ShadersGenerated.kt +354 -0
  3. package/catalog/shaders/aurora-silk/aurora-silk.form.tsx +35 -0
  4. package/catalog/shaders/aurora-silk/aurora-silk.frag +106 -0
  5. package/catalog/shaders/aurora-silk/aurora-silk.ts +92 -0
  6. package/catalog/shaders/halftone-waves/halftone-waves.form.tsx +35 -0
  7. package/catalog/shaders/halftone-waves/halftone-waves.frag +84 -0
  8. package/catalog/shaders/halftone-waves/halftone-waves.ts +100 -0
  9. package/catalog/shaders/index.ts +16 -0
  10. package/catalog/shaders/kaleidoscope/kaleidoscope.form.tsx +35 -0
  11. package/catalog/shaders/kaleidoscope/kaleidoscope.frag +93 -0
  12. package/catalog/shaders/kaleidoscope/kaleidoscope.ts +81 -0
  13. package/catalog/shaders/neo-memphis/neo-memphis.form.tsx +35 -0
  14. package/catalog/shaders/neo-memphis/neo-memphis.frag +152 -0
  15. package/catalog/shaders/neo-memphis/neo-memphis.ts +84 -0
  16. package/dist/catalog/shaders/aurora-silk/aurora-silk.d.ts +26 -0
  17. package/dist/catalog/shaders/aurora-silk/aurora-silk.d.ts.map +1 -0
  18. package/dist/catalog/shaders/aurora-silk/aurora-silk.form.d.ts +3 -0
  19. package/dist/catalog/shaders/aurora-silk/aurora-silk.form.d.ts.map +1 -0
  20. package/dist/catalog/shaders/aurora-silk/aurora-silk.form.js +13 -0
  21. package/dist/catalog/shaders/aurora-silk/aurora-silk.form.js.map +1 -0
  22. package/dist/catalog/shaders/aurora-silk/aurora-silk.js +70 -0
  23. package/dist/catalog/shaders/aurora-silk/aurora-silk.js.map +1 -0
  24. package/dist/catalog/shaders/halftone-waves/halftone-waves.d.ts +26 -0
  25. package/dist/catalog/shaders/halftone-waves/halftone-waves.d.ts.map +1 -0
  26. package/dist/catalog/shaders/halftone-waves/halftone-waves.form.d.ts +3 -0
  27. package/dist/catalog/shaders/halftone-waves/halftone-waves.form.d.ts.map +1 -0
  28. package/dist/catalog/shaders/halftone-waves/halftone-waves.form.js +13 -0
  29. package/dist/catalog/shaders/halftone-waves/halftone-waves.form.js.map +1 -0
  30. package/dist/catalog/shaders/halftone-waves/halftone-waves.js +78 -0
  31. package/dist/catalog/shaders/halftone-waves/halftone-waves.js.map +1 -0
  32. package/dist/catalog/shaders/index.d.ts +16 -0
  33. package/dist/catalog/shaders/index.d.ts.map +1 -1
  34. package/dist/catalog/shaders/index.js +9 -1
  35. package/dist/catalog/shaders/index.js.map +1 -1
  36. package/dist/catalog/shaders/kaleidoscope/kaleidoscope.d.ts +24 -0
  37. package/dist/catalog/shaders/kaleidoscope/kaleidoscope.d.ts.map +1 -0
  38. package/dist/catalog/shaders/kaleidoscope/kaleidoscope.form.d.ts +3 -0
  39. package/dist/catalog/shaders/kaleidoscope/kaleidoscope.form.d.ts.map +1 -0
  40. package/dist/catalog/shaders/kaleidoscope/kaleidoscope.form.js +14 -0
  41. package/dist/catalog/shaders/kaleidoscope/kaleidoscope.form.js.map +1 -0
  42. package/dist/catalog/shaders/kaleidoscope/kaleidoscope.js +61 -0
  43. package/dist/catalog/shaders/kaleidoscope/kaleidoscope.js.map +1 -0
  44. package/dist/catalog/shaders/neo-memphis/neo-memphis.d.ts +26 -0
  45. package/dist/catalog/shaders/neo-memphis/neo-memphis.d.ts.map +1 -0
  46. package/dist/catalog/shaders/neo-memphis/neo-memphis.form.d.ts +3 -0
  47. package/dist/catalog/shaders/neo-memphis/neo-memphis.form.d.ts.map +1 -0
  48. package/dist/catalog/shaders/neo-memphis/neo-memphis.form.js +13 -0
  49. package/dist/catalog/shaders/neo-memphis/neo-memphis.form.js.map +1 -0
  50. package/dist/catalog/shaders/neo-memphis/neo-memphis.js +62 -0
  51. package/dist/catalog/shaders/neo-memphis/neo-memphis.js.map +1 -0
  52. package/dist/web-driver/shaders.generated.d.ts +4 -0
  53. package/dist/web-driver/shaders.generated.d.ts.map +1 -1
  54. package/dist/web-driver/shaders.generated.js +351 -1
  55. package/dist/web-driver/shaders.generated.js.map +1 -1
  56. package/ios/KaleidoscopeModule/shaders/GENERATIVE.txt +4 -0
  57. package/ios/KaleidoscopeModule/shaders/SHADERS.txt +4 -0
  58. package/ios/KaleidoscopeModule/shaders/aurora-silk.metalsrc +51 -0
  59. package/ios/KaleidoscopeModule/shaders/halftone-waves.metalsrc +41 -0
  60. package/ios/KaleidoscopeModule/shaders/kaleidoscope.metalsrc +45 -0
  61. package/ios/KaleidoscopeModule/shaders/neo-memphis.metalsrc +181 -0
  62. package/package.json +30 -2
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ // Kaleidoscope layer-shader interface: typed uniforms + control descriptor.
3
+ // The library's namesake: a mirrored polar fold over a drifting sine field, an
4
+ // opaque BACKGROUND layer (issue #61). One kaleidoscope.frag fans out into the
5
+ // book presets (stained-glass, mandala, prism) by varying these uniforms; the
6
+ // segment count and palette are the big levers. Shader source is
7
+ // shaders/kaleidoscope.frag.
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.KALEIDOSCOPE_CONTROLS = void 0;
10
+ /** The `kaleidoscope` shader's tunables; defaults are the "stained glass" look. */
11
+ exports.KALEIDOSCOPE_CONTROLS = [
12
+ { name: 'uColorA', kind: 'color', default: [0.07, 0.15, 0.36], doc: 'Base palette color.' },
13
+ { name: 'uColorB', kind: 'color', default: [0.1, 0.55, 0.62], doc: 'Second palette color.' },
14
+ { name: 'uColorC', kind: 'color', default: [0.93, 0.69, 0.21], doc: 'Accent color.' },
15
+ {
16
+ name: 'uSegments',
17
+ kind: 'float',
18
+ default: 8,
19
+ min: 3,
20
+ max: 16,
21
+ step: 1,
22
+ doc: 'Mirror segment count; 6 = bold facets, 12 = lace.',
23
+ },
24
+ {
25
+ name: 'uSpeed',
26
+ kind: 'float',
27
+ default: 0.35,
28
+ min: 0,
29
+ max: 2,
30
+ step: 0.01,
31
+ doc: 'Drift rate; 0 freezes.',
32
+ },
33
+ {
34
+ name: 'uRotate',
35
+ kind: 'float',
36
+ default: 0.04,
37
+ min: -0.5,
38
+ max: 0.5,
39
+ step: 0.005,
40
+ doc: 'Whole-field rotation rate; sign sets direction.',
41
+ },
42
+ {
43
+ name: 'uZoom',
44
+ kind: 'float',
45
+ default: 1.6,
46
+ min: 0.5,
47
+ max: 4,
48
+ step: 0.05,
49
+ doc: 'Pattern scale; higher = more rings of detail.',
50
+ },
51
+ {
52
+ name: 'uCalm',
53
+ kind: 'float',
54
+ default: 0,
55
+ min: 0,
56
+ max: 1,
57
+ step: 0.01,
58
+ doc: 'Eases contrast at frame center (face zone).',
59
+ },
60
+ ];
61
+ //# sourceMappingURL=kaleidoscope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kaleidoscope.js","sourceRoot":"","sources":["../../../../catalog/shaders/kaleidoscope/kaleidoscope.ts"],"names":[],"mappings":";AAAA,4EAA4E;AAC5E,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,iEAAiE;AACjE,6BAA6B;;;AAyB7B,mFAAmF;AACtE,QAAA,qBAAqB,GAA8B;IAC9D,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,qBAAqB,EAAE;IAC3F,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,uBAAuB,EAAE;IAC5F,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE;IACrF;QACE,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,CAAC;QACV,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,EAAE;QACP,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,mDAAmD;KACzD;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,IAAI;QACb,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,wBAAwB;KAC9B;IACD;QACE,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,IAAI;QACb,GAAG,EAAE,CAAC,GAAG;QACT,GAAG,EAAE,GAAG;QACR,IAAI,EAAE,KAAK;QACX,GAAG,EAAE,iDAAiD;KACvD;IACD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,GAAG;QACZ,GAAG,EAAE,GAAG;QACR,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,+CAA+C;KACrD;IACD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,CAAC;QACV,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,6CAA6C;KACnD;CACF,CAAC","sourcesContent":["// Kaleidoscope layer-shader interface: typed uniforms + control descriptor.\n// The library's namesake: a mirrored polar fold over a drifting sine field, an\n// opaque BACKGROUND layer (issue #61). One kaleidoscope.frag fans out into the\n// book presets (stained-glass, mandala, prism) by varying these uniforms; the\n// segment count and palette are the big levers. Shader source is\n// shaders/kaleidoscope.frag.\n\nimport type { RGB } from '../../../src/lib/primitives.types';\nimport type { UniformControl } from '../_shared/types';\n\n/** Typed uniforms for the `kaleidoscope` layer shader. */\nexport type KaleidoscopeShaderUniforms = {\n /** Base palette color; also the pole uCalm eases toward. */\n readonly uColorA: RGB;\n /** Second palette color. */\n readonly uColorB: RGB;\n /** Accent color layered over the A/B field. */\n readonly uColorC: RGB;\n /** Mirror segment count; 6 = bold facets, 12 = lace. */\n readonly uSegments: number;\n /** Source-field drift rate; 0 freezes the pattern. */\n readonly uSpeed: number;\n /** Whole-field rotation rate; sign sets direction. */\n readonly uRotate: number;\n /** Pattern scale; higher = more rings of detail. */\n readonly uZoom: number;\n /** Eases contrast at frame center (the face zone); 0 = off. */\n readonly uCalm: number;\n};\n\n/** The `kaleidoscope` shader's tunables; defaults are the \"stained glass\" look. */\nexport const KALEIDOSCOPE_CONTROLS: readonly UniformControl[] = [\n { name: 'uColorA', kind: 'color', default: [0.07, 0.15, 0.36], doc: 'Base palette color.' },\n { name: 'uColorB', kind: 'color', default: [0.1, 0.55, 0.62], doc: 'Second palette color.' },\n { name: 'uColorC', kind: 'color', default: [0.93, 0.69, 0.21], doc: 'Accent color.' },\n {\n name: 'uSegments',\n kind: 'float',\n default: 8,\n min: 3,\n max: 16,\n step: 1,\n doc: 'Mirror segment count; 6 = bold facets, 12 = lace.',\n },\n {\n name: 'uSpeed',\n kind: 'float',\n default: 0.35,\n min: 0,\n max: 2,\n step: 0.01,\n doc: 'Drift rate; 0 freezes.',\n },\n {\n name: 'uRotate',\n kind: 'float',\n default: 0.04,\n min: -0.5,\n max: 0.5,\n step: 0.005,\n doc: 'Whole-field rotation rate; sign sets direction.',\n },\n {\n name: 'uZoom',\n kind: 'float',\n default: 1.6,\n min: 0.5,\n max: 4,\n step: 0.05,\n doc: 'Pattern scale; higher = more rings of detail.',\n },\n {\n name: 'uCalm',\n kind: 'float',\n default: 0,\n min: 0,\n max: 1,\n step: 0.01,\n doc: 'Eases contrast at frame center (face zone).',\n },\n];\n"]}
@@ -0,0 +1,26 @@
1
+ import type { RGB } from '../../../src/lib/primitives.types';
2
+ import type { UniformControl } from '../_shared/types';
3
+ /** Typed uniforms for the `neo-memphis` layer shader. */
4
+ export type NeoMemphisUniforms = {
5
+ /** Field color behind the shapes. */
6
+ readonly uBgColor: RGB;
7
+ /** Shape palette color 1. */
8
+ readonly uColorA: RGB;
9
+ /** Shape palette color 2. */
10
+ readonly uColorB: RGB;
11
+ /** Shape palette color 3. */
12
+ readonly uColorC: RGB;
13
+ /** Hero-grid cells across frame height; higher = smaller, busier shapes. */
14
+ readonly uScale: number;
15
+ /** Probability a cell draws its shape; the busy-ness dial. */
16
+ readonly uDensity: number;
17
+ /** Probability a shape renders outlined instead of filled. */
18
+ readonly uOutline: number;
19
+ /** Scroll + rotation rate; 0 freezes. */
20
+ readonly uDrift: number;
21
+ /** Fades shapes near frame center (the face zone); 0 = off. */
22
+ readonly uCalm: number;
23
+ };
24
+ /** The `neo-memphis` shader's tunables; defaults are the "pastel studio" look. */
25
+ export declare const NEO_MEMPHIS_CONTROLS: readonly UniformControl[];
26
+ //# sourceMappingURL=neo-memphis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neo-memphis.d.ts","sourceRoot":"","sources":["../../../../catalog/shaders/neo-memphis/neo-memphis.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,yDAAyD;AACzD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,qCAAqC;IACrC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC;IACvB,6BAA6B;IAC7B,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC;IACtB,6BAA6B;IAC7B,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC;IACtB,6BAA6B;IAC7B,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC;IACtB,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,yCAAyC;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+DAA+D;IAC/D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,EAAE,SAAS,cAAc,EAkDzD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type KaleidoscopeControls } from '../../../src/components/preset-control-panel';
2
+ export declare function NeoMemphisForm({ uniforms, onPatch, disabled }: KaleidoscopeControls): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=neo-memphis.form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neo-memphis.form.d.ts","sourceRoot":"","sources":["../../../../catalog/shaders/neo-memphis/neo-memphis.form.tsx"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,8CAA8C,CAAC;AAGtD,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,oBAAoB,2CAsBnF"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NeoMemphisForm = NeoMemphisForm;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // Neo-Memphis's editor form: the shader OWNS its control layout (the plasma
6
+ // pattern). One <Control uniform="…"/> per uniform in declared order.
7
+ // Conventional layer id: "neo-memphis".
8
+ const preset_control_panel_1 = require("../../../src/components/preset-control-panel");
9
+ const neo_memphis_1 = require("./neo-memphis");
10
+ function NeoMemphisForm({ uniforms, onPatch, disabled }) {
11
+ return ((0, jsx_runtime_1.jsx)(preset_control_panel_1.ControlForm, { id: "neo-memphis", uniforms: uniforms['neo-memphis'] ?? {}, onPatch: onPatch, disabled: disabled, controls: neo_memphis_1.NEO_MEMPHIS_CONTROLS, children: (0, jsx_runtime_1.jsxs)(preset_control_panel_1.ControlSection, { title: "neo-memphis", children: [(0, jsx_runtime_1.jsx)(preset_control_panel_1.Control, { uniform: "uBgColor" }), (0, jsx_runtime_1.jsx)(preset_control_panel_1.Control, { uniform: "uColorA" }), (0, jsx_runtime_1.jsx)(preset_control_panel_1.Control, { uniform: "uColorB" }), (0, jsx_runtime_1.jsx)(preset_control_panel_1.Control, { uniform: "uColorC" }), (0, jsx_runtime_1.jsx)(preset_control_panel_1.Control, { uniform: "uScale" }), (0, jsx_runtime_1.jsx)(preset_control_panel_1.Control, { uniform: "uDensity" }), (0, jsx_runtime_1.jsx)(preset_control_panel_1.Control, { uniform: "uOutline" }), (0, jsx_runtime_1.jsx)(preset_control_panel_1.Control, { uniform: "uDrift" }), (0, jsx_runtime_1.jsx)(preset_control_panel_1.Control, { uniform: "uCalm" })] }) }));
12
+ }
13
+ //# sourceMappingURL=neo-memphis.form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neo-memphis.form.js","sourceRoot":"","sources":["../../../../catalog/shaders/neo-memphis/neo-memphis.form.tsx"],"names":[],"mappings":";;;;AAAA,4EAA4E;AAC5E,sEAAsE;AACtE,wCAAwC;AAExC,uFAKsD;AACtD,+CAAqD;AAErD,wBAA+B,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAwB;IAClF,OAAO,CACL,uBAAC,kCAAW,IACV,EAAE,EAAC,aAAa,EAChB,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,EACvC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,kCAAoB,YAE9B,wBAAC,qCAAc,IAAC,KAAK,EAAC,aAAa,aACjC,uBAAC,8BAAO,IAAC,OAAO,EAAC,UAAU,GAAG,EAC9B,uBAAC,8BAAO,IAAC,OAAO,EAAC,SAAS,GAAG,EAC7B,uBAAC,8BAAO,IAAC,OAAO,EAAC,SAAS,GAAG,EAC7B,uBAAC,8BAAO,IAAC,OAAO,EAAC,SAAS,GAAG,EAC7B,uBAAC,8BAAO,IAAC,OAAO,EAAC,QAAQ,GAAG,EAC5B,uBAAC,8BAAO,IAAC,OAAO,EAAC,UAAU,GAAG,EAC9B,uBAAC,8BAAO,IAAC,OAAO,EAAC,UAAU,GAAG,EAC9B,uBAAC,8BAAO,IAAC,OAAO,EAAC,QAAQ,GAAG,EAC5B,uBAAC,8BAAO,IAAC,OAAO,EAAC,OAAO,GAAG,IACZ,GACL,CACf,CAAC;AACJ,CAAC","sourcesContent":["// Neo-Memphis's editor form: the shader OWNS its control layout (the plasma\n// pattern). One <Control uniform=\"…\"/> per uniform in declared order.\n// Conventional layer id: \"neo-memphis\".\n\nimport {\n Control,\n ControlForm,\n ControlSection,\n type KaleidoscopeControls,\n} from '../../../src/components/preset-control-panel';\nimport { NEO_MEMPHIS_CONTROLS } from './neo-memphis';\n\nexport function NeoMemphisForm({ uniforms, onPatch, disabled }: KaleidoscopeControls) {\n return (\n <ControlForm\n id=\"neo-memphis\"\n uniforms={uniforms['neo-memphis'] ?? {}}\n onPatch={onPatch}\n disabled={disabled}\n controls={NEO_MEMPHIS_CONTROLS}\n >\n <ControlSection title=\"neo-memphis\">\n <Control uniform=\"uBgColor\" />\n <Control uniform=\"uColorA\" />\n <Control uniform=\"uColorB\" />\n <Control uniform=\"uColorC\" />\n <Control uniform=\"uScale\" />\n <Control uniform=\"uDensity\" />\n <Control uniform=\"uOutline\" />\n <Control uniform=\"uDrift\" />\n <Control uniform=\"uCalm\" />\n </ControlSection>\n </ControlForm>\n );\n}\n"]}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ // Neo-Memphis layer-shader interface: typed uniforms + control descriptor.
3
+ // Scattered flat-color geometric primitives (the 90s Memphis / "Jazz cup"
4
+ // pattern family), an opaque BACKGROUND layer (issue #61). One
5
+ // neo-memphis.frag fans out into the book presets (jazz-cup, bauhaus,
6
+ // confetti) by varying these uniforms; the palette is the big lever. Shader
7
+ // source is shaders/neo-memphis.frag.
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.NEO_MEMPHIS_CONTROLS = void 0;
10
+ /** The `neo-memphis` shader's tunables; defaults are the "pastel studio" look. */
11
+ exports.NEO_MEMPHIS_CONTROLS = [
12
+ { name: 'uBgColor', kind: 'color', default: [0.96, 0.94, 0.89], doc: 'Field color.' },
13
+ { name: 'uColorA', kind: 'color', default: [0.16, 0.62, 0.56], doc: 'Shape palette color 1.' },
14
+ { name: 'uColorB', kind: 'color', default: [0.91, 0.45, 0.45], doc: 'Shape palette color 2.' },
15
+ { name: 'uColorC', kind: 'color', default: [0.27, 0.32, 0.55], doc: 'Shape palette color 3.' },
16
+ {
17
+ name: 'uScale',
18
+ kind: 'float',
19
+ default: 4,
20
+ min: 2,
21
+ max: 10,
22
+ step: 0.5,
23
+ doc: 'Hero-grid cells across frame height.',
24
+ },
25
+ {
26
+ name: 'uDensity',
27
+ kind: 'float',
28
+ default: 0.6,
29
+ min: 0,
30
+ max: 1,
31
+ step: 0.01,
32
+ doc: 'Probability a cell draws; busy-ness.',
33
+ },
34
+ {
35
+ name: 'uOutline',
36
+ kind: 'float',
37
+ default: 0.4,
38
+ min: 0,
39
+ max: 1,
40
+ step: 0.01,
41
+ doc: 'Share of outlined vs filled shapes.',
42
+ },
43
+ {
44
+ name: 'uDrift',
45
+ kind: 'float',
46
+ default: 0.5,
47
+ min: 0,
48
+ max: 2,
49
+ step: 0.01,
50
+ doc: 'Scroll + spin rate; 0 freezes.',
51
+ },
52
+ {
53
+ name: 'uCalm',
54
+ kind: 'float',
55
+ default: 0,
56
+ min: 0,
57
+ max: 1,
58
+ step: 0.01,
59
+ doc: 'Fades shapes at frame center (face zone).',
60
+ },
61
+ ];
62
+ //# sourceMappingURL=neo-memphis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neo-memphis.js","sourceRoot":"","sources":["../../../../catalog/shaders/neo-memphis/neo-memphis.ts"],"names":[],"mappings":";AAAA,2EAA2E;AAC3E,0EAA0E;AAC1E,+DAA+D;AAC/D,sEAAsE;AACtE,4EAA4E;AAC5E,sCAAsC;;;AA2BtC,kFAAkF;AACrE,QAAA,oBAAoB,GAA8B;IAC7D,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,cAAc,EAAE;IACrF,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,wBAAwB,EAAE;IAC9F,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,wBAAwB,EAAE;IAC9F,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,wBAAwB,EAAE;IAC9F;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,CAAC;QACV,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,EAAE;QACP,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,sCAAsC;KAC5C;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,GAAG;QACZ,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,sCAAsC;KAC5C;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,GAAG;QACZ,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,qCAAqC;KAC3C;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,GAAG;QACZ,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,gCAAgC;KACtC;IACD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,CAAC;QACV,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,2CAA2C;KACjD;CACF,CAAC","sourcesContent":["// Neo-Memphis layer-shader interface: typed uniforms + control descriptor.\n// Scattered flat-color geometric primitives (the 90s Memphis / \"Jazz cup\"\n// pattern family), an opaque BACKGROUND layer (issue #61). One\n// neo-memphis.frag fans out into the book presets (jazz-cup, bauhaus,\n// confetti) by varying these uniforms; the palette is the big lever. Shader\n// source is shaders/neo-memphis.frag.\n\nimport type { RGB } from '../../../src/lib/primitives.types';\nimport type { UniformControl } from '../_shared/types';\n\n/** Typed uniforms for the `neo-memphis` layer shader. */\nexport type NeoMemphisUniforms = {\n /** Field color behind the shapes. */\n readonly uBgColor: RGB;\n /** Shape palette color 1. */\n readonly uColorA: RGB;\n /** Shape palette color 2. */\n readonly uColorB: RGB;\n /** Shape palette color 3. */\n readonly uColorC: RGB;\n /** Hero-grid cells across frame height; higher = smaller, busier shapes. */\n readonly uScale: number;\n /** Probability a cell draws its shape; the busy-ness dial. */\n readonly uDensity: number;\n /** Probability a shape renders outlined instead of filled. */\n readonly uOutline: number;\n /** Scroll + rotation rate; 0 freezes. */\n readonly uDrift: number;\n /** Fades shapes near frame center (the face zone); 0 = off. */\n readonly uCalm: number;\n};\n\n/** The `neo-memphis` shader's tunables; defaults are the \"pastel studio\" look. */\nexport const NEO_MEMPHIS_CONTROLS: readonly UniformControl[] = [\n { name: 'uBgColor', kind: 'color', default: [0.96, 0.94, 0.89], doc: 'Field color.' },\n { name: 'uColorA', kind: 'color', default: [0.16, 0.62, 0.56], doc: 'Shape palette color 1.' },\n { name: 'uColorB', kind: 'color', default: [0.91, 0.45, 0.45], doc: 'Shape palette color 2.' },\n { name: 'uColorC', kind: 'color', default: [0.27, 0.32, 0.55], doc: 'Shape palette color 3.' },\n {\n name: 'uScale',\n kind: 'float',\n default: 4,\n min: 2,\n max: 10,\n step: 0.5,\n doc: 'Hero-grid cells across frame height.',\n },\n {\n name: 'uDensity',\n kind: 'float',\n default: 0.6,\n min: 0,\n max: 1,\n step: 0.01,\n doc: 'Probability a cell draws; busy-ness.',\n },\n {\n name: 'uOutline',\n kind: 'float',\n default: 0.4,\n min: 0,\n max: 1,\n step: 0.01,\n doc: 'Share of outlined vs filled shapes.',\n },\n {\n name: 'uDrift',\n kind: 'float',\n default: 0.5,\n min: 0,\n max: 2,\n step: 0.01,\n doc: 'Scroll + spin rate; 0 freezes.',\n },\n {\n name: 'uCalm',\n kind: 'float',\n default: 0,\n min: 0,\n max: 1,\n step: 0.01,\n doc: 'Fades shapes at frame center (face zone).',\n },\n];\n"]}
@@ -5,6 +5,10 @@ export declare const COMPOSITE_IMAGE_FRAG_SRC = "#version 300 es\nprecision high
5
5
  export declare const COMPOSITE_SUBJECT_FRAG_SRC = "#version 300 es\nprecision highp float;\nuniform sampler2D uCamera;\nuniform sampler2D uMask;\nuniform vec2 uMaskUvScale;\nuniform vec2 uMaskUvOffset;\nuniform float uMaskLo;\nuniform float uMaskHi;\nin highp vec2 vUv;\nout vec4 oColor;\nvoid main() {\n vec3 cam = texture(uCamera, vUv).rgb;\n float raw = texture(uMask, vUv * uMaskUvScale + uMaskUvOffset).r;\n float safeHi = max(uMaskHi, uMaskLo + 0.001);\n float a = clamp(smoothstep(uMaskLo, safeHi, raw), 0.0, 1.0);\n oColor = vec4(cam * a, a);\n}\n";
6
6
  export declare const COMPOSITE_MASKED_FRAG_SRC = "#version 300 es\nprecision highp float;\nuniform sampler2D uTex;\nuniform sampler2D uMask;\nuniform vec2 uMaskUvScale;\nuniform vec2 uMaskUvOffset;\nuniform float uMaskLo;\nuniform float uMaskHi;\nin highp vec2 vUv;\nout vec4 oColor;\nvoid main() {\n vec4 c = texture(uTex, vUv);\n float raw = texture(uMask, vUv * uMaskUvScale + uMaskUvOffset).r;\n float safeHi = max(uMaskHi, uMaskLo + 0.001);\n float a = clamp(smoothstep(uMaskLo, safeHi, raw), 0.0, 1.0);\n oColor = c * a;\n}\n";
7
7
  export declare const PLASMA_FRAG_SRC = "#version 300 es\nprecision highp float;\n\nuniform float uTime; // seconds, monotonically increasing; range [0, inf)\nuniform vec2 uResolution; // framebuffer size in pixels; both components > 0\nuniform vec3 uColorA; // first palette color, linear-ish RGB in [0, 1]\nuniform vec3 uColorB; // second palette color, linear-ish RGB in [0, 1]\nuniform float uSpeed; // animation rate multiplier; 0 freezes the field\nuniform float uScale; // spatial frequency; higher = more, tighter cells\n\nin highp vec2 vUv;\nout vec4 oColor;\n\nvoid main() {\n // Aspect-correct, screen-centered coordinates (matches nebula.frag): divide\n // by the height so uScale reads the same regardless of aspect ratio.\n vec2 fragCoord = vUv * uResolution;\n vec2 uv = (fragCoord - 0.5 * uResolution) / uResolution.y;\n\n float t = uTime * uSpeed;\n\n // Classic demoscene plasma: a few sines of position and time. The radial\n // term (length(uv)) gives the field an organic, non-grid-aligned drift.\n float v = sin(uv.x * uScale + t);\n v += sin(uv.y * uScale + t * 0.8);\n v += sin((uv.x + uv.y) * uScale * 0.7 + t * 1.3);\n v += sin(length(uv) * uScale * 1.2 - t);\n\n // v ranges roughly [-4, 4]; fold through sin to a smooth [0, 1] mix factor.\n float mixT = 0.5 + 0.5 * sin(v);\n\n // Opaque procedural background; the person is composited over it downstream.\n oColor = vec4(mix(uColorA, uColorB, mixT), 1.0);\n}\n";
8
+ export declare const KALEIDOSCOPE_FRAG_SRC = "#version 300 es\nprecision highp float;\n\nuniform float uTime; // seconds, monotonically increasing; range [0, inf)\nuniform vec2 uResolution; // framebuffer size in pixels; both components > 0\nuniform vec3 uColorA; // base palette color (also the calm midpoint pole)\nuniform vec3 uColorB; // second palette color\nuniform vec3 uColorC; // accent color, layered over the A/B field\nuniform float uSegments; // mirror segment count; floor()ed, clamped >= 3\nuniform float uSpeed; // source-field drift rate; 0 freezes the pattern\nuniform float uRotate; // whole-field rotation rate; sign sets direction\nuniform float uZoom; // pattern scale; higher = more rings of detail\nuniform float uCalm; // 0..1 eases contrast at frame center (face zone)\n\nin highp vec2 vUv;\nout vec4 oColor;\n\nconst float TAU = 6.28318530718;\n\nvoid main() {\n // Aspect-correct, screen-centered coordinates (matches plasma/nebula).\n vec2 fragCoord = vUv * uResolution;\n vec2 uv = (fragCoord - 0.5 * uResolution) / uResolution.y;\n float centerDist = length(uv);\n\n // Whole-field rotation: the slow \"turning the scope\" motion.\n float ra = uTime * uRotate;\n float cs = cos(ra);\n float sn = sin(ra);\n uv = mat2(cs, -sn, sn, cs) * uv;\n\n // Mirrored polar fold. The 1e-5 nudge keeps atan() off the undefined (0,0)\n // input under Metal; it is far below one pixel at any resolution.\n float r = centerDist * uZoom * (1.0 + 0.06 * sin(uTime * 0.23));\n float seg = TAU / max(3.0, floor(uSegments));\n float a = atan(uv.y, uv.x + 1e-5);\n a = mod(a, seg);\n a = abs(a - seg * 0.5);\n vec2 p = r * vec2(cos(a), sin(a));\n\n float t = uTime * uSpeed;\n\n // Drifting source field, plasma-class: a few sines of folded position and\n // time. The off-axis moving center in the length() term keeps the pattern\n // evolving (non-repeating) rather than pulsing in place.\n float f1 = sin(p.x * 6.0 + t)\n + sin((p.x + p.y) * 4.2 - t * 0.7)\n + sin(length(p - vec2(0.9 + 0.25 * sin(t * 0.31), 0.0)) * 7.0 + t * 1.1);\n float f2 = sin(p.y * 5.0 - t * 0.9 + sin(p.x * 3.1 + t * 0.4));\n float m1 = 0.5 + 0.5 * sin(f1);\n float m2 = smoothstep(0.25, 0.9, 0.5 + 0.5 * sin(f2 + f1 * 0.5));\n\n vec3 color = mix(uColorA, uColorB, m1);\n color = mix(color, uColorC, m2 * 0.65);\n\n // Thin darkening along both mirror lines sells the cut-glass facets.\n float seam = smoothstep(0.035, 0.0, abs(a - seg * 0.5)) + smoothstep(0.035, 0.0, a);\n color *= 1.0 - 0.18 * seam;\n\n // uCalm: ease toward the palette midpoint near frame center. Spatial-only\n // (never scales time per pixel, which would shear the field across the\n // falloff ring).\n vec3 mid = 0.5 * (uColorA + uColorB);\n float calm = uCalm * (1.0 - smoothstep(0.15, 0.62, centerDist));\n color = mix(color, mid, calm * 0.6);\n\n // Opaque procedural background; the person is composited over it downstream.\n oColor = vec4(color, 1.0);\n}\n";
9
+ export declare const NEO_MEMPHIS_FRAG_SRC = "#version 300 es\nprecision highp float;\n\nuniform float uTime; // seconds, monotonically increasing; range [0, inf)\nuniform vec2 uResolution; // framebuffer size in pixels; both components > 0\nuniform vec3 uBgColor; // field color behind the shapes\nuniform vec3 uColorA; // shape palette color 1\nuniform vec3 uColorB; // shape palette color 2\nuniform vec3 uColorC; // shape palette color 3\nuniform float uScale; // hero-grid cells across frame height\nuniform float uDensity; // probability a cell draws its shape, 0..1\nuniform float uOutline; // probability a shape renders outlined, 0..1\nuniform float uDrift; // scroll + rotation rate; 0 freezes\nuniform float uCalm; // 0..1 fades shapes near frame center (face zone)\n\nin highp vec2 vUv;\nout vec4 oColor;\n\nconst float TAU = 6.28318530718;\n// Antialias half-width in cell units; ~1px at the default pitch.\nconst float AA = 0.012;\n\nfloat hash21(vec2 p) {\n p = fract(p * vec2(234.34, 435.345));\n p += dot(p, p + 34.23);\n return fract(p.x * p.y);\n}\n\nfloat sdBox(vec2 p, vec2 b) {\n vec2 d = abs(p) - b;\n return length(max(d, vec2(0.0))) + min(max(d.x, d.y), 0.0);\n}\n\n// iq's equilateral triangle, point up, circumradius r.\nfloat sdTriangle(vec2 p, float r) {\n const float k = 1.7320508;\n p.x = abs(p.x) - r;\n p.y = p.y + r / k;\n if (p.x + k * p.y > 0.0) {\n p = vec2(p.x - k * p.y, -k * p.x - p.y) * 0.5;\n }\n p.x -= clamp(p.x, -2.0 * r, 0.0);\n return -length(p) * sign(p.y);\n}\n\n// One cell layer: returns the shape coverage and writes its color.\n// luv is the layer's scrolled cell-space coordinate; backfill restricts the\n// shape menu to dots and crosses and draws smaller.\nfloat memphisCell(vec2 luv, float seed, float backfill, float t, out vec3 shapeColor) {\n vec2 id = floor(luv);\n vec2 gv = fract(luv) - 0.5;\n float h = hash21(id + seed);\n shapeColor = uBgColor;\n // Density gate: empty cells cost one hash.\n if (h > uDensity) return 0.0;\n\n float h2 = fract(h * 57.31);\n float h3 = fract(h * 113.77);\n float h4 = fract(h * 431.13);\n float h5 = fract(h * 891.71);\n\n // Per-cell slow spin and a small bob; both bounded so the shape stays\n // inside its cell (max extent 0.34 + 0.04 < 0.5).\n float ang = h2 * TAU + t * (h3 - 0.5) * 0.8;\n float cs = cos(ang);\n float sn = sin(ang);\n gv -= 0.04 * vec2(sin(t * 0.6 + h * TAU), cos(t * 0.8 + h * TAU));\n gv = mat2(cs, -sn, sn, cs) * gv;\n\n float r = mix(0.14, 0.30, h3) * mix(1.0, 0.6, backfill);\n float pick = h4 * 6.0;\n float d;\n if (backfill > 0.5) {\n // Backfill texture: dots and crosses only.\n d = (pick < 3.0)\n ? length(gv) - r * 0.45\n : min(sdBox(gv, vec2(r, r * 0.22)), sdBox(gv, vec2(r * 0.22, r)));\n } else if (pick < 1.0) {\n d = length(gv) - r; // disc\n } else if (pick < 2.0) {\n d = abs(length(gv) - r * 0.8) - r * 0.18; // ring\n } else if (pick < 3.0) {\n d = sdTriangle(gv, r); // triangle\n } else if (pick < 4.0) {\n d = min(sdBox(gv, vec2(r, r * 0.24)), sdBox(gv, vec2(r * 0.24, r))); // cross\n } else if (pick < 5.0) {\n d = sdBox(gv, vec2(r * 0.78, r * 0.78)); // box\n } else {\n // Squiggle: a sine-displaced band, clipped to its run length.\n d = max(abs(gv.y - 0.4 * r * sin(gv.x / r * 6.5)) - r * 0.17, abs(gv.x) - r);\n }\n\n float fill = smoothstep(AA, -AA, d);\n float ring = smoothstep(AA, -AA, abs(d + r * 0.06) - r * 0.09);\n float m = (h5 < uOutline) ? ring : fill;\n\n float colorPick = fract(h * 769.23) * 3.0;\n shapeColor = (colorPick < 1.0) ? uColorA : (colorPick < 2.0) ? uColorB : uColorC;\n return m;\n}\n\nvoid main() {\n // Aspect-correct, screen-centered coordinates (matches plasma/nebula).\n vec2 fragCoord = vUv * uResolution;\n vec2 uv = (fragCoord - 0.5 * uResolution) / uResolution.y;\n float centerDist = length(uv);\n\n float t = uTime * uDrift;\n vec3 color = uBgColor;\n vec3 shapeColor;\n\n // Backfill layer first (under the hero shapes): smaller, denser, dimmer.\n vec2 luv1 = uv * uScale * 2.3 + vec2(t * 0.045, t * -0.03) + 51.7;\n float m1 = memphisCell(luv1, 7.0, 1.0, t, shapeColor);\n color = mix(color, mix(uBgColor, shapeColor, 0.55), m1);\n\n // Hero layer: the big shapes, scrolling the other way.\n vec2 luv0 = uv * uScale + vec2(t * -0.06, t * 0.04);\n float m0 = memphisCell(luv0, 0.0, 0.0, t, shapeColor);\n\n // uCalm: fade shapes (not the field) near frame center.\n float calm = 1.0 - uCalm * (1.0 - smoothstep(0.15, 0.62, centerDist));\n color = mix(color, shapeColor, m0 * calm);\n\n // Opaque procedural background; the person is composited over it downstream.\n oColor = vec4(color, 1.0);\n}\n";
10
+ export declare const HALFTONE_WAVES_FRAG_SRC = "#version 300 es\nprecision highp float;\n\nuniform float uTime; // seconds, monotonically increasing; range [0, inf)\nuniform vec2 uResolution; // framebuffer size in pixels; both components > 0\nuniform vec3 uPaper; // field color (behind the dots)\nuniform vec3 uInk; // dot color\nuniform float uPitch; // dot-grid cells across frame height\nuniform float uDotSize; // base dot radius in cell units, 0..0.5\nuniform float uWaveAmp; // radius modulation depth, 0..1\nuniform float uSpeed; // wave travel rate; 0 freezes\nuniform float uShape; // dot shape: 0 diamond, 1 circle, 2 square\nuniform float uAngle; // wave direction, radians\nuniform float uCalm; // 0..1 eases the waves at frame center (face zone)\n\nin highp vec2 vUv;\nout vec4 oColor;\n\n// Antialias half-width in cell units; ~1px at the default pitch.\nconst float AA = 0.06;\n\nvoid main() {\n // Aspect-correct, screen-centered coordinates (matches plasma/nebula).\n vec2 fragCoord = vUv * uResolution;\n vec2 uv = (fragCoord - 0.5 * uResolution) / uResolution.y;\n float centerDist = length(uv);\n\n vec2 luv = uv * uPitch;\n vec2 id = floor(luv);\n vec2 gv = fract(luv) - 0.5;\n // Wave phase is sampled at the CELL CENTER so a dot's radius is uniform\n // across its own pixels (true halftone, not a warped field).\n vec2 c = (id + 0.5) / uPitch;\n\n float t = uTime * uSpeed;\n vec2 dir1 = vec2(cos(uAngle), sin(uAngle));\n vec2 dir2 = vec2(cos(uAngle + 2.2), sin(uAngle + 2.2));\n // Two traveling waves at incommensurate frequencies: interference patterns\n // that drift forever without visibly repeating.\n float w = 0.5 + 0.25 * sin(dot(c, dir1) * 3.1 + t) + 0.25 * sin(dot(c, dir2) * 4.7 - t * 0.77);\n\n // uCalm: flatten the modulation toward its midpoint near frame center.\n float calm = uCalm * (1.0 - smoothstep(0.15, 0.62, centerDist));\n w = mix(w, 0.5, calm);\n\n float radius = uDotSize * mix(1.0 - uWaveAmp, 1.0 + uWaveAmp, w);\n\n // Blended distance metric, pow-free (variable-exponent pow lowers to\n // exp2+log2 on mobile): diamond (L1) -> circle (L2) -> square (Linf).\n vec2 q = abs(gv);\n float dDiamond = (q.x + q.y) * 0.7071;\n float dCircle = length(q);\n float dSquare = max(q.x, q.y);\n float d = (uShape < 1.0)\n ? mix(dDiamond, dCircle, clamp(uShape, 0.0, 1.0))\n : mix(dCircle, dSquare, clamp(uShape - 1.0, 0.0, 1.0));\n\n float m = smoothstep(radius + AA, radius - AA, d);\n vec3 color = mix(uPaper, uInk, m);\n\n // Opaque procedural background; the person is composited over it downstream.\n oColor = vec4(color, 1.0);\n}\n";
11
+ export declare const AURORA_SILK_FRAG_SRC = "#version 300 es\nprecision highp float;\n\nuniform float uTime; // seconds, monotonically increasing; range [0, inf)\nuniform vec2 uResolution; // framebuffer size in pixels; both components > 0\nuniform vec3 uColorLow; // gradient color at the flow's low side\nuniform vec3 uColorHigh; // gradient color at the flow's high side\nuniform vec3 uRibbonColor; // ribbon tint; shades blend toward uColorHigh\nuniform float uRibbons; // visible ribbon count, 1..5 (MAX_RIBBONS)\nuniform float uSoftness; // ribbon edge softness, 0..1\nuniform float uAngle; // flow direction, radians\nuniform float uSpeed; // drift rate; 0 freezes\nuniform float uStyle; // 0 flat paper-cut .. 1 glowing silk\nuniform float uCalm; // 0..1 eases ribbons at frame center (face zone)\n\nin highp vec2 vUv;\nout vec4 oColor;\n\nconst int MAX_RIBBONS = 5;\n\nfloat hash11(float n) {\n return fract(sin(n) * 43758.5453123);\n}\n\n// 1D value noise: smooth, cheap, non-repeating drift source per ribbon.\nfloat vnoise(float x, float seed) {\n float i = floor(x);\n float f = fract(x);\n float a = hash11(i + seed);\n float b = hash11(i + 1.0 + seed);\n return mix(a, b, f * f * (3.0 - 2.0 * f));\n}\n\nvoid main() {\n // Aspect-correct, screen-centered coordinates (matches plasma/nebula).\n vec2 fragCoord = vUv * uResolution;\n vec2 uv = (fragCoord - 0.5 * uResolution) / uResolution.y;\n float centerDist = length(uv);\n\n // Rotate into flow space: ribbons run along q.x, stack along q.y.\n float cs = cos(uAngle);\n float sn = sin(uAngle);\n vec2 q = mat2(cs, -sn, sn, cs) * uv;\n\n float t = uTime * uSpeed;\n\n // Base: soft two-stop gradient across the stacking axis, with a slow\n // breathing tilt so the field is alive even at uRibbons = 0 edge cases.\n float g = clamp(q.y * 0.85 + 0.5 + 0.04 * sin(t * 0.17), 0.0, 1.0);\n vec3 color = mix(uColorLow, uColorHigh, g);\n\n float ribbons = clamp(uRibbons, 0.0, float(MAX_RIBBONS));\n float calm = 1.0 - uCalm * (1.0 - smoothstep(0.15, 0.62, centerDist));\n\n for (int i = 0; i < MAX_RIBBONS; i++) {\n float fi = float(i);\n if (fi >= ribbons) break;\n\n // Stack centers across the frame, each with its own slow vertical sway.\n float center = -0.42 + 0.84 * (fi + 0.5) / ribbons + 0.07 * sin(t * 0.19 + fi * 1.7);\n // Lateral warp: low-frequency noise plus one sine, per-ribbon phase and\n // rate so the bands never move in lockstep.\n float warp = (vnoise(q.x * 1.4 + t * (0.1 + 0.04 * fi), fi * 17.0) - 0.5) * 0.5\n + 0.1 * sin(q.x * 2.3 + t * (0.26 + 0.06 * fi) + fi * 2.1);\n float dy = abs(q.y - (center + warp));\n\n float widthR = mix(0.06, 0.15, hash11(fi * 7.3 + 1.0));\n float soft = mix(0.008, widthR * 1.6, uSoftness);\n float band = (1.0 - smoothstep(widthR - soft, widthR + soft, dy)) * calm;\n\n // Ribbon shade: deeper tints at the back of the stack.\n vec3 rc = mix(uRibbonColor, uColorHigh, fi / float(MAX_RIBBONS) * 0.6);\n\n // uStyle blends two composites of the same band: flat paint-over vs\n // additive glow.\n vec3 flat_ = mix(color, rc, band * 0.85);\n vec3 glow = color + rc * band * 0.4;\n color = mix(flat_, glow, uStyle);\n }\n\n // Opaque procedural background; the person is composited over it downstream.\n oColor = vec4(color, 1.0);\n}\n";
8
12
  export declare const CLOUDS_FRAG_SRC = "#version 300 es\nprecision highp float;\n\nuniform float uTime;\nuniform vec2 uResolution;\nuniform vec3 uSkyLowColor;\nuniform vec3 uSkyHighColor;\nuniform vec3 uCloudLightColor;\nuniform vec3 uCloudDarkColor;\nuniform float uExposure;\nuniform float uStepSize;\nuniform float uCloudSpeed;\nuniform float uCloudScale;\nuniform float uDensity;\nuniform float uCoverage;\nuniform float uSoftness;\n\nin highp vec2 vUv;\nout vec4 oColor;\n\n// STEPS must stay a compile-time constant (GLSL ES loop bound).\n// 32 (was 48; issue #37): the distance-growing step in main() keeps the\n// marched range, so fewer steps buys speed instead of clipping the horizon.\n#define STEPS 32\n\nfloat hash(vec3 p) {\n p = fract(p * 0.3183099 + 0.1);\n p *= 17.0;\n return fract(p.x * p.y * p.z * (p.x + p.y + p.z));\n}\n\nfloat rand(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat noise(vec3 p) {\n vec3 i = floor(p);\n vec3 f = fract(p);\n f = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(\n mix(hash(i + vec3(0,0,0)), hash(i + vec3(1,0,0)), f.x),\n mix(hash(i + vec3(0,1,0)), hash(i + vec3(1,1,0)), f.x),\n f.y),\n mix(\n mix(hash(i + vec3(0,0,1)), hash(i + vec3(1,0,1)), f.x),\n mix(hash(i + vec3(0,1,1)), hash(i + vec3(1,1,1)), f.x),\n f.y),\n f.z);\n}\n\n// 4 octaves (was 5; issue #37): the 5th octave is fine wisp detail the\n// smoothstep(uCoverage, uCoverage + uSoftness, n) threshold mostly eats; each\n// octave is 8 hash() calls per sample, so this is a flat -20% on the march.\nfloat fbm(vec3 p) {\n float v = 0.0;\n float a = 0.5;\n for (int i = 0; i < 4; i++) {\n v += a * noise(p);\n p *= 2.03;\n a *= 0.5;\n }\n return v;\n}\n\nfloat cloudDensity(vec3 p) {\n p += vec3(uTime * uCloudSpeed, 0.0, uTime * uCloudSpeed * 0.35);\n // Outside the slab the height mask is 0, so the sample is 0; bail before fbm.\n if (p.y <= 0.0 || p.y >= 3.0) return 0.0;\n float n = fbm(p * uCloudScale);\n float bottom = smoothstep(0.0, 0.7, p.y);\n float top = smoothstep(3.0, 1.2, p.y);\n float heightMask = bottom * top;\n float cloud = smoothstep(uCoverage, uCoverage + uSoftness, n);\n return cloud * heightMask;\n}\n\nvoid main() {\n vec2 fragCoord = vUv * uResolution;\n vec2 uv = (fragCoord - 0.5 * uResolution) / uResolution.y;\n vec3 ro = vec3(0.0, 1.2, -4.0);\n vec3 rd = normalize(vec3(uv, 1.5));\n float skyGradient = clamp(rd.y * 0.5 + 0.5, 0.0, 1.0);\n vec3 skyColor = mix(uSkyLowColor, uSkyHighColor, skyGradient);\n vec3 accum = vec3(0.0);\n float alpha = 0.0;\n float t = rand(fragCoord) * uStepSize;\n for (int i = 0; i < STEPS; i++) {\n vec3 p = ro + rd * t;\n // The slab is crossed monotonically in t; once past it, all samples are 0.\n if (rd.y > 0.0 && p.y >= 3.0) break;\n if (rd.y < 0.0 && p.y <= 0.0) break;\n float d = cloudDensity(p);\n // Distance-growing step (issue #37): far clouds are small on screen and\n // tolerate coarser sampling, so the step stretches with t. 32 growing\n // steps reach slightly past where 48 uniform steps did, spending the\n // samples up close where banding would show. growth also scales the\n // per-sample opacity so optical depth per unit distance stays consistent\n // with the uniform-step tuning the presets were dialed against.\n float growth = 1.0 + t * 0.15;\n if (d > 0.01) {\n float light = smoothstep(0.4, 2.8, p.y);\n vec3 sampleColor = mix(uCloudDarkColor, uCloudLightColor, light);\n float a = min(d * uDensity * growth, 1.0);\n accum += (1.0 - alpha) * sampleColor * a;\n alpha += (1.0 - alpha) * a;\n }\n t += uStepSize * growth;\n if (alpha > 0.95) break;\n }\n vec3 color = mix(skyColor, accum, alpha);\n color *= uExposure;\n color = pow(color, vec3(0.9));\n oColor = vec4(color, 1.0);\n}\n";
9
13
  export declare const NEBULA_FRAG_SRC = "#version 300 es\nprecision highp float;\n\nuniform float uTime; // seconds, monotonically increasing; range [0, inf)\nuniform vec2 uResolution; // framebuffer size in pixels; both components > 0\nuniform vec3 uColor; // overall tint / color grade; [1,1,1] = untinted\nuniform float uBrightness; // final glow multiplier; 1.0 = stock\nuniform float uSpeed; // drift + rotation rate; 1.0 = stock, 0 freezes\nuniform float uTwinkleSpeed; // star color-cycle rate; 1.0 = stock\nuniform float uScale; // starfield zoom / density; >1 = more, smaller stars\nuniform float uStarGlow; // star-core size; 1.0 = stock\n\nin highp vec2 vUv;\nout vec4 oColor;\n\nconst float PI = 3.14159265;\nconst float MIN_DIVIDE = 64.0;\nconst float MAX_DIVIDE = 0.01;\n// Number of stacked starfield layers. Compile-time constant so the layer\n// loop has a fixed integer bound (cross-compile-safe; no float loop counter).\n// 8 (was 12) for low-end-mobile cost (issue #39); the work is linear in the\n// count and dimByDensity rebalances per-star brightness automatically.\nconst int STARFIELD_LAYERS_COUNT = 8;\n\nmat2 Rotate(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n return mat2(c, -s, s, c);\n}\n\nfloat Star(vec2 uv, float flaresize, float rotAngle, float randomN) {\n float d = length(uv);\n // The concentric fade at the bottom is exactly 0 for d >= 1.0; the star is\n // invisible there, so skip everything (issue #39: a large share of the 3x3\n // neighbor sweep lands outside this radius; the cull is output-identical).\n if (d >= 1.0) return 0.0;\n // Star core. Guard the division: length(uv) can be exactly 0 at a cell\n // center, which yields inf/NaN under Metal. max(d, 1e-4) caps the core\n // brightness without visibly changing the look (the concentric\n // smoothstep fade below already clamps it).\n float starcore = 0.05 * uStarGlow / max(d, 1e-4);\n // Flares exist only on the brightest stars: flaresize is exactly 0 below the\n // smoothstep(0.9, 1.0, size) knee (~90% of cells), and both Rotates feed\n // nothing but the flares. Skipping the block is output-identical, and\n // flaresize is constant per cell, so the branch is coherent (issue #39).\n if (flaresize > 0.0) {\n uv *= Rotate(-2.0 * PI * rotAngle);\n float flareMax = 1.0;\n\n // flares\n float starflares = max(0.0, flareMax - abs(uv.x * uv.y * 3000.0));\n starcore += starflares * flaresize;\n uv *= Rotate(PI * 0.25);\n starflares = max(0.0, flareMax - abs(uv.x * uv.y * 3000.0));\n starcore += starflares * 0.3 * flaresize;\n }\n // light can't go forever, fade it concentrically.\n starcore *= smoothstep(1.0, 0.05, d);\n return starcore;\n}\n\nfloat PseudoRandomizer(vec2 p) {\n // not really random, but it looks random.\n p = fract(p * vec2(123.45, 345.67));\n p += dot(p, p + 45.32);\n return fract(p.x * p.y);\n}\n\nvec3 StarFieldLayer(vec2 uv, float rotAngle) {\n vec3 col = vec3(0.0);\n\n vec2 gv = fract(uv) - 0.5;\n vec2 id = floor(uv);\n\n float deltaTimeTwinkle = uTime * 0.35 * uTwinkleSpeed;\n\n // sweep the 8 neighbors plus the home cell so stars are not clipped at\n // cell borders. Constant 3x3 bounds.\n for (int y = -1; y <= 1; y++) {\n for (int x = -1; x <= 1; x++) {\n vec2 offset = vec2(float(x), float(y));\n\n float randomN = PseudoRandomizer(id + offset); // 0..1\n float randoX = randomN - 0.5;\n float randoY = fract(randomN * 45.0) - 0.5;\n vec2 randomPosition = gv - offset - vec2(randoX, randoY);\n // fract trick: random sizes\n float size = fract(randomN * 1356.33);\n float flareSwitch = smoothstep(0.9, 1.0, size);\n float star = Star(randomPosition, flareSwitch, rotAngle, randomN);\n\n // fract trick: random colors\n float randomStarColorSeed = fract(randomN * 2150.0) * (3.0 * PI) * deltaTimeTwinkle;\n vec3 color = sin(vec3(0.7, 0.3, 0.9) * randomStarColorSeed);\n\n // compress\n color = color * (0.4 * sin(deltaTimeTwinkle)) + 0.6;\n // filter\n color = color * vec3(1.0, 0.1, 0.9 + size);\n float dimByDensity = 15.0 / float(STARFIELD_LAYERS_COUNT);\n col += star * size * color * dimByDensity;\n }\n }\n\n return col;\n}\n\nvoid main() {\n // ShaderToy fragCoord, reconstructed from vUv (see header).\n vec2 fragCoord = vUv * uResolution;\n\n // Normalized pixel coordinates centered at screen middle.\n vec2 uv = (fragCoord - 0.5 * uResolution.xy) / uResolution.y;\n\n float deltaTime = uTime * 0.01 * uSpeed;\n\n vec3 col = vec3(0.0);\n\n float rotAngle = deltaTime * 0.09;\n\n // Layer accumulation. Integer-counted loop replacing the original\n // `for (float i = 0.0; i < 1.0; i += 1.0/COUNT)`. With n in [0, COUNT),\n // i = n/COUNT reproduces the exact same {0, 1/N, 2/N, ...} sequence and\n // the same iteration count, so visual output is unchanged; only the loop\n // form is cross-compile-safe.\n for (int n = 0; n < STARFIELD_LAYERS_COUNT; n++) {\n float i = float(n) / float(STARFIELD_LAYERS_COUNT);\n float layerDepth = fract(i + deltaTime);\n float layerScale = mix(MIN_DIVIDE, MAX_DIVIDE, layerDepth);\n float layerFader = layerDepth * smoothstep(0.1, 1.1, layerDepth);\n float layerOffset = i * (3430.0 + fract(i));\n mat2 layerRot = Rotate(rotAngle * i * -10.0);\n uv *= layerRot;\n vec2 starfieldUv = uv * layerScale * uScale + layerOffset;\n col += StarFieldLayer(starfieldUv, rotAngle) * layerFader;\n }\n\n // Glow + color grade, then opaque procedural background.\n col *= uBrightness * uColor;\n oColor = vec4(col, 1.0);\n}\n";
10
14
  export declare const GODRAYS_FRAG_SRC = "#version 300 es\nprecision highp float;\n\nuniform float uTime; // seconds, monotonically increasing\nuniform vec2 uResolution; // framebuffer size in pixels\nuniform vec3 uLightColor; // ray tint (linear-ish RGB, 0..1)\nuniform float uRayCount; // number of ray bands\nuniform float uRaySpeed; // drift speed\nuniform float uRayIntensity; // overall brightness / additive strength\nuniform float uRaySoftness; // edge falloff exponent (higher = crisper shafts)\nuniform float uTopGlow; // extra glow concentrated near the top\nuniform float uFadeDistance; // vertical falloff from the top\nuniform float uWobbleAmount; // horizontal wobble magnitude\nuniform float uWobbleSpeed; // wobble animation speed\n\nin highp vec2 vUv;\nout vec4 oColor;\n\nfloat hash(float n) {\n return fract(sin(n) * 43758.5453123);\n}\n\nfloat noise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n\n f = f * f * (3.0 - 2.0 * f);\n\n float a = hash(i.x + i.y * 57.0);\n float b = hash(i.x + 1.0 + i.y * 57.0);\n float c = hash(i.x + (i.y + 1.0) * 57.0);\n float d = hash(i.x + 1.0 + (i.y + 1.0) * 57.0);\n\n return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);\n}\n\nvoid main() {\n // vUv is already 0..1 with bottom-left origin; this is the Shadertoy `uv`.\n vec2 uv = vUv;\n\n float aspect = uResolution.x / uResolution.y;\n vec2 p = uv;\n p.x = (p.x - 0.5) * aspect + 0.5;\n\n float t = uTime;\n float fromTop = 1.0 - uv.y;\n\n float verticalFade = exp(-fromTop * uFadeDistance);\n float topGlow = exp(-fromTop * 8.0) * uTopGlow;\n\n float wobble =\n (noise(vec2(uv.y * 3.0, t * uWobbleSpeed)) - 0.5) * uWobbleAmount;\n\n float rayCoord = (p.x + wobble) * uRayCount;\n\n float raysA = sin(rayCoord + t * uRaySpeed);\n float raysB = sin(rayCoord * 1.73 - t * uRaySpeed * 0.7);\n\n float rays = raysA * 0.65 + raysB * 0.35;\n rays = rays * 0.5 + 0.5;\n rays = pow(rays, uRaySoftness);\n\n float shimmer = noise(vec2(uv.x * 10.0, uv.y * 4.0 - t * 0.3));\n rays *= mix(0.75, 1.25, shimmer);\n\n float alpha = rays * verticalFade * uRayIntensity;\n alpha += topGlow * uRayIntensity;\n alpha = clamp(alpha, 0.0, 1.0);\n\n // Premultiplied additive output: rgb already scaled by alpha.\n vec3 rayColor = uLightColor * alpha;\n oColor = vec4(rayColor, alpha);\n}\n";
@@ -1 +1 @@
1
- {"version":3,"file":"shaders.generated.d.ts","sourceRoot":"","sources":["../../web-driver/shaders.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,0NAQhC,CAAC;AAEF,eAAO,MAAM,yBAAyB,oLAQrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,6oBAwBnC,CAAC;AAEF,eAAO,MAAM,wBAAwB,2QAWpC,CAAC;AAEF,eAAO,MAAM,0BAA0B,kgBAiBtC,CAAC;AAEF,eAAO,MAAM,yBAAyB,2eAiBrC,CAAC;AAEF,eAAO,MAAM,eAAe,q6CAkC3B,CAAC;AAEF,eAAO,MAAM,eAAe,i/HAmH3B,CAAC;AAEF,eAAO,MAAM,eAAe,qgLA6I3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,u1EAyE5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,kmDAoD9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,62KA2IjC,CAAC;AAEF,eAAO,MAAM,6BAA6B,ssHA4GzC,CAAC;AAEF,eAAO,MAAM,8BAA8B,qrTA2O1C,CAAC;AAEF,eAAO,MAAM,wBAAwB,wiPAsMpC,CAAC;AAIF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUlD,CAAC"}
1
+ {"version":3,"file":"shaders.generated.d.ts","sourceRoot":"","sources":["../../web-driver/shaders.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,0NAQhC,CAAC;AAEF,eAAO,MAAM,yBAAyB,oLAQrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,6oBAwBnC,CAAC;AAEF,eAAO,MAAM,wBAAwB,2QAWpC,CAAC;AAEF,eAAO,MAAM,0BAA0B,kgBAiBtC,CAAC;AAEF,eAAO,MAAM,yBAAyB,2eAiBrC,CAAC;AAEF,eAAO,MAAM,eAAe,q6CAkC3B,CAAC;AAEF,eAAO,MAAM,qBAAqB,g6FAqEjC,CAAC;AAEF,eAAO,MAAM,oBAAoB,6rJA+HhC,CAAC;AAEF,eAAO,MAAM,uBAAuB,0kFA+DnC,CAAC;AAEF,eAAO,MAAM,oBAAoB,uwGAmFhC,CAAC;AAEF,eAAO,MAAM,eAAe,i/HAmH3B,CAAC;AAEF,eAAO,MAAM,eAAe,qgLA6I3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,u1EAyE5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,kmDAoD9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,62KA2IjC,CAAC;AAEF,eAAO,MAAM,6BAA6B,ssHA4GzC,CAAC;AAEF,eAAO,MAAM,8BAA8B,qrTA2O1C,CAAC;AAEF,eAAO,MAAM,wBAAwB,wiPAsMpC,CAAC;AAIF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAclD,CAAC"}