shaders 3.1.461 → 3.1.463

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 (60) hide show
  1. package/dist/cli.js +2 -2
  2. package/dist/core/{CursorRipples-DB-pXdOa.js → CursorRipples-CgDYeS56.js} +1 -1
  3. package/dist/core/CursorTrail-CR8Yzb95.js +1687 -0
  4. package/dist/core/{Fog-Df_ScuGu.js → Fog-BZE-8zd_.js} +1 -1
  5. package/dist/core/{InkFlow-Bm5pXn7t.js → InkFlow-C8TiHmkM.js} +1 -1
  6. package/dist/core/{ParticleFlow-D5LhGlwp.js → ParticleFlow-CEWBGUct.js} +1 -1
  7. package/dist/core/{ReactionDiffusion-C7YAM_2K.js → ReactionDiffusion-z37SYWSB.js} +1 -1
  8. package/dist/core/{Smoke-B7-Lg6sy.js → Smoke-CK_dPkpu.js} +1 -1
  9. package/dist/core/{SmokeFill-g6J2PhDW.js → SmokeFill-BSu4o6eH.js} +1 -1
  10. package/dist/core/{SmokeFlow-Cin8S6uq.js → SmokeFlow-wijbufSp.js} +1 -1
  11. package/dist/core/gpu/index.d.ts +6 -0
  12. package/dist/core/gpu/index.d.ts.map +1 -1
  13. package/dist/core/gpu/kit/host/pointer.d.ts +9 -0
  14. package/dist/core/gpu/kit/host/pointer.d.ts.map +1 -1
  15. package/dist/core/gpu/passManager.d.ts +1 -1
  16. package/dist/core/gpu/passManager.d.ts.map +1 -1
  17. package/dist/core/index.js +40 -16
  18. package/dist/core/{pointer-DKBz1Qcc.js → pointer-CdyEZBpL.js} +11 -2
  19. package/dist/core/presetRenderer.d.ts.map +1 -1
  20. package/dist/core/registry.js +11 -11
  21. package/dist/core/{shaderRegistry-CpApZw3f.js → shaderRegistry-ByB1HjcV.js} +9 -9
  22. package/dist/core/shaders/CursorRipples/index.js +2 -2
  23. package/dist/core/shaders/CursorTrail/index.d.ts +33 -16
  24. package/dist/core/shaders/CursorTrail/index.d.ts.map +1 -1
  25. package/dist/core/shaders/CursorTrail/index.js +3 -3
  26. package/dist/core/shaders/Fog/index.js +2 -2
  27. package/dist/core/shaders/InkFlow/index.js +2 -2
  28. package/dist/core/shaders/ParticleFlow/index.js +2 -2
  29. package/dist/core/shaders/ReactionDiffusion/index.js +2 -2
  30. package/dist/core/shaders/Smoke/index.js +2 -2
  31. package/dist/core/shaders/SmokeFill/index.js +2 -2
  32. package/dist/core/shaders/SmokeFlow/index.js +2 -2
  33. package/dist/js/bundle.js +149 -149
  34. package/dist/js/createShader.js +1 -1
  35. package/dist/js/utils/generatePresetCode.d.ts.map +1 -1
  36. package/dist/js/utils/generatePresetCode.js +1 -0
  37. package/dist/react/Shader.js +1 -1
  38. package/dist/react/bundle.js +158 -158
  39. package/dist/react/components/CursorTrail.d.ts +4 -2
  40. package/dist/react/components/CursorTrail.d.ts.map +1 -1
  41. package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
  42. package/dist/react/utils/generatePresetCode.js +1 -0
  43. package/dist/registry.js +36 -6
  44. package/dist/solid/components/CursorTrail.d.ts +4 -2
  45. package/dist/solid/components/CursorTrail.d.ts.map +1 -1
  46. package/dist/solid/engine/Shader.js +1 -1
  47. package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
  48. package/dist/solid/utils/generatePresetCode.js +1 -0
  49. package/dist/svelte/components/CursorTrail.svelte.d.ts +2 -1
  50. package/dist/svelte/index.js +1 -1
  51. package/dist/svelte/source/components/CursorTrail.svelte +1 -0
  52. package/dist/svelte/utils/generatePresetCode.js +1 -0
  53. package/dist/vue/CursorTrail.vue_vue_type_script_setup_true_lang.js +1 -0
  54. package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
  55. package/dist/vue/components/CursorTrail.vue.d.ts +2 -1
  56. package/dist/vue/components/CursorTrail.vue.d.ts.map +1 -1
  57. package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
  58. package/dist/vue/utils/generatePresetCode.js +1 -0
  59. package/package.json +1 -1
  60. package/dist/core/CursorTrail-Dk3-1Y0B.js +0 -1224
@@ -0,0 +1,1687 @@
1
+ import { I as colorMixing_exports, Lt as vec4f, Mt as vec2f, Ot as smoothstep, Pt as vec2u, Wt as texture2d, _t as max, b as vec4, ct as clamp, d as ZERO, et as typegpu_default, ft as exp, gt as length, it as abs, ln as u32, m as call, rt as select, sn as f32, vt as min, yt as mix } from "./edges-CV-BHMpI.js";
2
+ import { A as toHalfFloat, I as textureLoad } from "./device-DKcu50_C.js";
3
+ import { V as colorStopsPropConfig, q as mixColorStopsRuntime } from "./porters-j7yWJYy2.js";
4
+ import { a as transformColor, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-u-UZrXjj.js";
5
+ import { n as createPointerVelocityTracker } from "./pointer-CdyEZBpL.js";
6
+ var MAX_POINTS = 64;
7
+ var HALF_ONE = toHalfFloat(1);
8
+ var WIDTH_MIN = .2;
9
+ var SPEED_FULL = 1.5;
10
+ var BEZIER_SUBDIVISIONS = 3;
11
+ const cursorTrailScan = typegpu_default.fn([
12
+ texture2d(f32),
13
+ vec2f,
14
+ f32,
15
+ f32,
16
+ f32,
17
+ f32,
18
+ f32
19
+ ], vec2f)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((pointsTex, uv, aspect, radius, shrink, softness, viewportH) => {
20
+ "use gpu";
21
+ const px = __tsover_mul(uv.x, aspect);
22
+ const py = uv.y;
23
+ const baseRadius = __tsover_mul(radius, .1);
24
+ const edgeW = __tsover_add(__tsover_div(1.5, max(viewportH, 1)), __tsover_mul(softness, baseRadius));
25
+ const sharp = __tsover_div(4, max(baseRadius, .005));
26
+ let minSdf = f32(100);
27
+ let ageSum = f32(0);
28
+ let wSum = f32(0);
29
+ let prev = vec4f(0, 0, 1, 0);
30
+ let prev2 = vec4f(0, 0, 1, 0);
31
+ for (let i = 0; i < MAX_POINTS; i++) {
32
+ const cur = textureLoad(pointsTex, vec2u(u32(i), 0), 0);
33
+ if (cur.z < 1) {
34
+ const cx = __tsover_mul(cur.x, aspect);
35
+ const cy = cur.y;
36
+ const linked = select(f32(0), f32(1), cur.w > 0);
37
+ const prevAlive = select(f32(0), f32(1), prev.z < 1);
38
+ if (__tsover_mul(linked, prevAlive) > .5) {
39
+ const usePrev2 = __tsover_mul(select(f32(0), f32(1), prev.w > 0), select(f32(0), f32(1), prev2.z < 1)) > .5;
40
+ const jx = __tsover_mul(prev.x, aspect);
41
+ const jy = prev.y;
42
+ const sx0 = select(jx, __tsover_mul(__tsover_add(__tsover_mul(prev2.x, aspect), jx), .5), usePrev2);
43
+ const sy0 = select(jy, __tsover_mul(__tsover_add(prev2.y, jy), .5), usePrev2);
44
+ const ageS = select(prev.z, __tsover_mul(__tsover_add(prev2.z, prev.z), .5), usePrev2);
45
+ const widPrev = abs(prev.w);
46
+ const widS = select(widPrev, __tsover_mul(__tsover_add(abs(prev2.w), widPrev), .5), usePrev2);
47
+ const ex = __tsover_mul(__tsover_add(jx, cx), .5);
48
+ const ey = __tsover_mul(__tsover_add(jy, cy), .5);
49
+ const ageE = __tsover_mul(__tsover_add(prev.z, cur.z), .5);
50
+ const widE = __tsover_mul(__tsover_add(widPrev, abs(cur.w)), .5);
51
+ let sx = sx0;
52
+ let sy = sy0;
53
+ let sAge = ageS;
54
+ let sWid = widS;
55
+ let jMin = f32(100);
56
+ let jAge = f32(1);
57
+ for (let k = 0; k < BEZIER_SUBDIVISIONS; k++) {
58
+ const t = __tsover_div(__tsover_add(f32(k), 1), BEZIER_SUBDIVISIONS);
59
+ const omt = __tsover_sub(1, t);
60
+ const bx = __tsover_add(__tsover_add(__tsover_mul(__tsover_mul(omt, omt), sx0), __tsover_mul(__tsover_mul(__tsover_mul(2, omt), t), jx)), __tsover_mul(__tsover_mul(t, t), ex));
61
+ const by = __tsover_add(__tsover_add(__tsover_mul(__tsover_mul(omt, omt), sy0), __tsover_mul(__tsover_mul(__tsover_mul(2, omt), t), jy)), __tsover_mul(__tsover_mul(t, t), ey));
62
+ const bAge = mix(ageS, ageE, t);
63
+ const bWid = mix(widS, widE, t);
64
+ const ra = __tsover_mul(__tsover_mul(baseRadius, sWid), __tsover_sub(1, __tsover_mul(sAge, shrink)));
65
+ const rb = __tsover_mul(__tsover_mul(baseRadius, bWid), __tsover_sub(1, __tsover_mul(bAge, shrink)));
66
+ const bax = __tsover_sub(bx, sx);
67
+ const bay = __tsover_sub(by, sy);
68
+ const tt = clamp(__tsover_div(__tsover_add(__tsover_mul(__tsover_sub(px, sx), bax), __tsover_mul(__tsover_sub(py, sy), bay)), max(__tsover_add(__tsover_mul(bax, bax), __tsover_mul(bay, bay)), 1e-8)), 0, 1);
69
+ const dist = __tsover_sub(length(vec2f(__tsover_sub(px, __tsover_add(sx, __tsover_mul(bax, tt))), __tsover_sub(py, __tsover_add(sy, __tsover_mul(bay, tt))))), mix(ra, rb, tt));
70
+ if (dist < jMin) {
71
+ jMin = dist;
72
+ jAge = mix(sAge, bAge, tt);
73
+ }
74
+ sx = bx;
75
+ sy = by;
76
+ sAge = bAge;
77
+ sWid = bWid;
78
+ }
79
+ minSdf = min(minSdf, jMin);
80
+ const w = exp(__tsover_mul(__tsover_mul(jMin, -1), sharp));
81
+ ageSum = __tsover_add(ageSum, __tsover_mul(jAge, w));
82
+ wSum = __tsover_add(wSum, w);
83
+ } else {
84
+ const dist = __tsover_sub(length(vec2f(__tsover_sub(px, cx), __tsover_sub(py, cy))), __tsover_mul(__tsover_mul(baseRadius, abs(cur.w)), __tsover_sub(1, __tsover_mul(cur.z, shrink))));
85
+ minSdf = min(minSdf, dist);
86
+ const w = exp(__tsover_mul(__tsover_mul(dist, -1), sharp));
87
+ ageSum = __tsover_add(ageSum, __tsover_mul(cur.z, w));
88
+ wSum = __tsover_add(wSum, w);
89
+ }
90
+ }
91
+ prev2 = vec4f(prev);
92
+ prev = vec4f(cur);
93
+ }
94
+ const age = __tsover_div(ageSum, max(wSum, 1e-20));
95
+ return vec2f(age, __tsover_mul(__tsover_sub(1, smoothstep(__tsover_mul(edgeW, -1), edgeW, minSdf)), __tsover_sub(1, smoothstep(.8, 1, age))));
96
+ }), {
97
+ v: 2,
98
+ name: void 0,
99
+ ast: {
100
+ "params": [
101
+ {
102
+ "type": "i",
103
+ "name": "pointsTex"
104
+ },
105
+ {
106
+ "type": "i",
107
+ "name": "uv"
108
+ },
109
+ {
110
+ "type": "i",
111
+ "name": "aspect"
112
+ },
113
+ {
114
+ "type": "i",
115
+ "name": "radius"
116
+ },
117
+ {
118
+ "type": "i",
119
+ "name": "shrink"
120
+ },
121
+ {
122
+ "type": "i",
123
+ "name": "softness"
124
+ },
125
+ {
126
+ "type": "i",
127
+ "name": "viewportH"
128
+ }
129
+ ],
130
+ "body": [0, [
131
+ [
132
+ 13,
133
+ "px",
134
+ [
135
+ 1,
136
+ [
137
+ 7,
138
+ "uv",
139
+ "x"
140
+ ],
141
+ "*",
142
+ "aspect"
143
+ ]
144
+ ],
145
+ [
146
+ 13,
147
+ "py",
148
+ [
149
+ 7,
150
+ "uv",
151
+ "y"
152
+ ]
153
+ ],
154
+ [
155
+ 13,
156
+ "baseRadius",
157
+ [
158
+ 1,
159
+ "radius",
160
+ "*",
161
+ [5, "0.1"]
162
+ ]
163
+ ],
164
+ [
165
+ 13,
166
+ "edgeW",
167
+ [
168
+ 1,
169
+ [
170
+ 1,
171
+ [5, "1.5"],
172
+ "/",
173
+ [
174
+ 6,
175
+ "std.max",
176
+ ["viewportH", [5, "1"]]
177
+ ]
178
+ ],
179
+ "+",
180
+ [
181
+ 1,
182
+ "softness",
183
+ "*",
184
+ "baseRadius"
185
+ ]
186
+ ]
187
+ ],
188
+ [
189
+ 13,
190
+ "sharp",
191
+ [
192
+ 1,
193
+ [5, "4"],
194
+ "/",
195
+ [
196
+ 6,
197
+ "std.max",
198
+ ["baseRadius", [5, "0.005"]]
199
+ ]
200
+ ]
201
+ ],
202
+ [
203
+ 12,
204
+ "minSdf",
205
+ [
206
+ 6,
207
+ "d.f32",
208
+ [[5, "100"]]
209
+ ]
210
+ ],
211
+ [
212
+ 12,
213
+ "ageSum",
214
+ [
215
+ 6,
216
+ "d.f32",
217
+ [[5, "0"]]
218
+ ]
219
+ ],
220
+ [
221
+ 12,
222
+ "wSum",
223
+ [
224
+ 6,
225
+ "d.f32",
226
+ [[5, "0"]]
227
+ ]
228
+ ],
229
+ [
230
+ 12,
231
+ "prev",
232
+ [
233
+ 6,
234
+ "d.vec4f",
235
+ [
236
+ [5, "0"],
237
+ [5, "0"],
238
+ [5, "1"],
239
+ [5, "0"]
240
+ ]
241
+ ]
242
+ ],
243
+ [
244
+ 12,
245
+ "prev2",
246
+ [
247
+ 6,
248
+ "d.vec4f",
249
+ [
250
+ [5, "0"],
251
+ [5, "0"],
252
+ [5, "1"],
253
+ [5, "0"]
254
+ ]
255
+ ]
256
+ ],
257
+ [
258
+ 14,
259
+ [
260
+ 12,
261
+ "i",
262
+ [5, "0"]
263
+ ],
264
+ [
265
+ 1,
266
+ "i",
267
+ "<",
268
+ "MAX_POINTS"
269
+ ],
270
+ [
271
+ 102,
272
+ "++",
273
+ "i"
274
+ ],
275
+ [0, [
276
+ [
277
+ 13,
278
+ "cur",
279
+ [
280
+ 6,
281
+ "std.textureLoad",
282
+ [
283
+ "pointsTex",
284
+ [
285
+ 6,
286
+ "d.vec2u",
287
+ [[
288
+ 6,
289
+ "d.u32",
290
+ ["i"]
291
+ ], [5, "0"]]
292
+ ],
293
+ [5, "0"]
294
+ ]
295
+ ]
296
+ ],
297
+ [
298
+ 11,
299
+ [
300
+ 1,
301
+ [
302
+ 7,
303
+ "cur",
304
+ "z"
305
+ ],
306
+ "<",
307
+ [5, "1"]
308
+ ],
309
+ [0, [
310
+ [
311
+ 13,
312
+ "cx",
313
+ [
314
+ 1,
315
+ [
316
+ 7,
317
+ "cur",
318
+ "x"
319
+ ],
320
+ "*",
321
+ "aspect"
322
+ ]
323
+ ],
324
+ [
325
+ 13,
326
+ "cy",
327
+ [
328
+ 7,
329
+ "cur",
330
+ "y"
331
+ ]
332
+ ],
333
+ [
334
+ 13,
335
+ "linked",
336
+ [
337
+ 6,
338
+ "std.select",
339
+ [
340
+ [
341
+ 6,
342
+ "d.f32",
343
+ [[5, "0"]]
344
+ ],
345
+ [
346
+ 6,
347
+ "d.f32",
348
+ [[5, "1"]]
349
+ ],
350
+ [
351
+ 1,
352
+ [
353
+ 7,
354
+ "cur",
355
+ "w"
356
+ ],
357
+ ">",
358
+ [5, "0"]
359
+ ]
360
+ ]
361
+ ]
362
+ ],
363
+ [
364
+ 13,
365
+ "prevAlive",
366
+ [
367
+ 6,
368
+ "std.select",
369
+ [
370
+ [
371
+ 6,
372
+ "d.f32",
373
+ [[5, "0"]]
374
+ ],
375
+ [
376
+ 6,
377
+ "d.f32",
378
+ [[5, "1"]]
379
+ ],
380
+ [
381
+ 1,
382
+ [
383
+ 7,
384
+ "prev",
385
+ "z"
386
+ ],
387
+ "<",
388
+ [5, "1"]
389
+ ]
390
+ ]
391
+ ]
392
+ ],
393
+ [
394
+ 11,
395
+ [
396
+ 1,
397
+ [
398
+ 1,
399
+ "linked",
400
+ "*",
401
+ "prevAlive"
402
+ ],
403
+ ">",
404
+ [5, "0.5"]
405
+ ],
406
+ [0, [
407
+ [
408
+ 13,
409
+ "usePrev2",
410
+ [
411
+ 1,
412
+ [
413
+ 1,
414
+ [
415
+ 6,
416
+ "std.select",
417
+ [
418
+ [
419
+ 6,
420
+ "d.f32",
421
+ [[5, "0"]]
422
+ ],
423
+ [
424
+ 6,
425
+ "d.f32",
426
+ [[5, "1"]]
427
+ ],
428
+ [
429
+ 1,
430
+ [
431
+ 7,
432
+ "prev",
433
+ "w"
434
+ ],
435
+ ">",
436
+ [5, "0"]
437
+ ]
438
+ ]
439
+ ],
440
+ "*",
441
+ [
442
+ 6,
443
+ "std.select",
444
+ [
445
+ [
446
+ 6,
447
+ "d.f32",
448
+ [[5, "0"]]
449
+ ],
450
+ [
451
+ 6,
452
+ "d.f32",
453
+ [[5, "1"]]
454
+ ],
455
+ [
456
+ 1,
457
+ [
458
+ 7,
459
+ "prev2",
460
+ "z"
461
+ ],
462
+ "<",
463
+ [5, "1"]
464
+ ]
465
+ ]
466
+ ]
467
+ ],
468
+ ">",
469
+ [5, "0.5"]
470
+ ]
471
+ ],
472
+ [
473
+ 13,
474
+ "jx",
475
+ [
476
+ 1,
477
+ [
478
+ 7,
479
+ "prev",
480
+ "x"
481
+ ],
482
+ "*",
483
+ "aspect"
484
+ ]
485
+ ],
486
+ [
487
+ 13,
488
+ "jy",
489
+ [
490
+ 7,
491
+ "prev",
492
+ "y"
493
+ ]
494
+ ],
495
+ [
496
+ 13,
497
+ "sx0",
498
+ [
499
+ 6,
500
+ "std.select",
501
+ [
502
+ "jx",
503
+ [
504
+ 1,
505
+ [
506
+ 1,
507
+ [
508
+ 1,
509
+ [
510
+ 7,
511
+ "prev2",
512
+ "x"
513
+ ],
514
+ "*",
515
+ "aspect"
516
+ ],
517
+ "+",
518
+ "jx"
519
+ ],
520
+ "*",
521
+ [5, "0.5"]
522
+ ],
523
+ "usePrev2"
524
+ ]
525
+ ]
526
+ ],
527
+ [
528
+ 13,
529
+ "sy0",
530
+ [
531
+ 6,
532
+ "std.select",
533
+ [
534
+ "jy",
535
+ [
536
+ 1,
537
+ [
538
+ 1,
539
+ [
540
+ 7,
541
+ "prev2",
542
+ "y"
543
+ ],
544
+ "+",
545
+ "jy"
546
+ ],
547
+ "*",
548
+ [5, "0.5"]
549
+ ],
550
+ "usePrev2"
551
+ ]
552
+ ]
553
+ ],
554
+ [
555
+ 13,
556
+ "ageS",
557
+ [
558
+ 6,
559
+ "std.select",
560
+ [
561
+ [
562
+ 7,
563
+ "prev",
564
+ "z"
565
+ ],
566
+ [
567
+ 1,
568
+ [
569
+ 1,
570
+ [
571
+ 7,
572
+ "prev2",
573
+ "z"
574
+ ],
575
+ "+",
576
+ [
577
+ 7,
578
+ "prev",
579
+ "z"
580
+ ]
581
+ ],
582
+ "*",
583
+ [5, "0.5"]
584
+ ],
585
+ "usePrev2"
586
+ ]
587
+ ]
588
+ ],
589
+ [
590
+ 13,
591
+ "widPrev",
592
+ [
593
+ 6,
594
+ "std.abs",
595
+ [[
596
+ 7,
597
+ "prev",
598
+ "w"
599
+ ]]
600
+ ]
601
+ ],
602
+ [
603
+ 13,
604
+ "widS",
605
+ [
606
+ 6,
607
+ "std.select",
608
+ [
609
+ "widPrev",
610
+ [
611
+ 1,
612
+ [
613
+ 1,
614
+ [
615
+ 6,
616
+ "std.abs",
617
+ [[
618
+ 7,
619
+ "prev2",
620
+ "w"
621
+ ]]
622
+ ],
623
+ "+",
624
+ "widPrev"
625
+ ],
626
+ "*",
627
+ [5, "0.5"]
628
+ ],
629
+ "usePrev2"
630
+ ]
631
+ ]
632
+ ],
633
+ [
634
+ 13,
635
+ "ex",
636
+ [
637
+ 1,
638
+ [
639
+ 1,
640
+ "jx",
641
+ "+",
642
+ "cx"
643
+ ],
644
+ "*",
645
+ [5, "0.5"]
646
+ ]
647
+ ],
648
+ [
649
+ 13,
650
+ "ey",
651
+ [
652
+ 1,
653
+ [
654
+ 1,
655
+ "jy",
656
+ "+",
657
+ "cy"
658
+ ],
659
+ "*",
660
+ [5, "0.5"]
661
+ ]
662
+ ],
663
+ [
664
+ 13,
665
+ "ageE",
666
+ [
667
+ 1,
668
+ [
669
+ 1,
670
+ [
671
+ 7,
672
+ "prev",
673
+ "z"
674
+ ],
675
+ "+",
676
+ [
677
+ 7,
678
+ "cur",
679
+ "z"
680
+ ]
681
+ ],
682
+ "*",
683
+ [5, "0.5"]
684
+ ]
685
+ ],
686
+ [
687
+ 13,
688
+ "widE",
689
+ [
690
+ 1,
691
+ [
692
+ 1,
693
+ "widPrev",
694
+ "+",
695
+ [
696
+ 6,
697
+ "std.abs",
698
+ [[
699
+ 7,
700
+ "cur",
701
+ "w"
702
+ ]]
703
+ ]
704
+ ],
705
+ "*",
706
+ [5, "0.5"]
707
+ ]
708
+ ],
709
+ [
710
+ 12,
711
+ "sx",
712
+ "sx0"
713
+ ],
714
+ [
715
+ 12,
716
+ "sy",
717
+ "sy0"
718
+ ],
719
+ [
720
+ 12,
721
+ "sAge",
722
+ "ageS"
723
+ ],
724
+ [
725
+ 12,
726
+ "sWid",
727
+ "widS"
728
+ ],
729
+ [
730
+ 12,
731
+ "jMin",
732
+ [
733
+ 6,
734
+ "d.f32",
735
+ [[5, "100"]]
736
+ ]
737
+ ],
738
+ [
739
+ 12,
740
+ "jAge",
741
+ [
742
+ 6,
743
+ "d.f32",
744
+ [[5, "1"]]
745
+ ]
746
+ ],
747
+ [
748
+ 14,
749
+ [
750
+ 12,
751
+ "k",
752
+ [5, "0"]
753
+ ],
754
+ [
755
+ 1,
756
+ "k",
757
+ "<",
758
+ "BEZIER_SUBDIVISIONS"
759
+ ],
760
+ [
761
+ 102,
762
+ "++",
763
+ "k"
764
+ ],
765
+ [0, [
766
+ [
767
+ 13,
768
+ "t",
769
+ [
770
+ 1,
771
+ [
772
+ 1,
773
+ [
774
+ 6,
775
+ "d.f32",
776
+ ["k"]
777
+ ],
778
+ "+",
779
+ [5, "1"]
780
+ ],
781
+ "/",
782
+ "BEZIER_SUBDIVISIONS"
783
+ ]
784
+ ],
785
+ [
786
+ 13,
787
+ "omt",
788
+ [
789
+ 1,
790
+ [5, "1"],
791
+ "-",
792
+ "t"
793
+ ]
794
+ ],
795
+ [
796
+ 13,
797
+ "bx",
798
+ [
799
+ 1,
800
+ [
801
+ 1,
802
+ [
803
+ 1,
804
+ [
805
+ 1,
806
+ "omt",
807
+ "*",
808
+ "omt"
809
+ ],
810
+ "*",
811
+ "sx0"
812
+ ],
813
+ "+",
814
+ [
815
+ 1,
816
+ [
817
+ 1,
818
+ [
819
+ 1,
820
+ [5, "2"],
821
+ "*",
822
+ "omt"
823
+ ],
824
+ "*",
825
+ "t"
826
+ ],
827
+ "*",
828
+ "jx"
829
+ ]
830
+ ],
831
+ "+",
832
+ [
833
+ 1,
834
+ [
835
+ 1,
836
+ "t",
837
+ "*",
838
+ "t"
839
+ ],
840
+ "*",
841
+ "ex"
842
+ ]
843
+ ]
844
+ ],
845
+ [
846
+ 13,
847
+ "by",
848
+ [
849
+ 1,
850
+ [
851
+ 1,
852
+ [
853
+ 1,
854
+ [
855
+ 1,
856
+ "omt",
857
+ "*",
858
+ "omt"
859
+ ],
860
+ "*",
861
+ "sy0"
862
+ ],
863
+ "+",
864
+ [
865
+ 1,
866
+ [
867
+ 1,
868
+ [
869
+ 1,
870
+ [5, "2"],
871
+ "*",
872
+ "omt"
873
+ ],
874
+ "*",
875
+ "t"
876
+ ],
877
+ "*",
878
+ "jy"
879
+ ]
880
+ ],
881
+ "+",
882
+ [
883
+ 1,
884
+ [
885
+ 1,
886
+ "t",
887
+ "*",
888
+ "t"
889
+ ],
890
+ "*",
891
+ "ey"
892
+ ]
893
+ ]
894
+ ],
895
+ [
896
+ 13,
897
+ "bAge",
898
+ [
899
+ 6,
900
+ "std.mix",
901
+ [
902
+ "ageS",
903
+ "ageE",
904
+ "t"
905
+ ]
906
+ ]
907
+ ],
908
+ [
909
+ 13,
910
+ "bWid",
911
+ [
912
+ 6,
913
+ "std.mix",
914
+ [
915
+ "widS",
916
+ "widE",
917
+ "t"
918
+ ]
919
+ ]
920
+ ],
921
+ [
922
+ 13,
923
+ "ra",
924
+ [
925
+ 1,
926
+ [
927
+ 1,
928
+ "baseRadius",
929
+ "*",
930
+ "sWid"
931
+ ],
932
+ "*",
933
+ [
934
+ 1,
935
+ [5, "1"],
936
+ "-",
937
+ [
938
+ 1,
939
+ "sAge",
940
+ "*",
941
+ "shrink"
942
+ ]
943
+ ]
944
+ ]
945
+ ],
946
+ [
947
+ 13,
948
+ "rb",
949
+ [
950
+ 1,
951
+ [
952
+ 1,
953
+ "baseRadius",
954
+ "*",
955
+ "bWid"
956
+ ],
957
+ "*",
958
+ [
959
+ 1,
960
+ [5, "1"],
961
+ "-",
962
+ [
963
+ 1,
964
+ "bAge",
965
+ "*",
966
+ "shrink"
967
+ ]
968
+ ]
969
+ ]
970
+ ],
971
+ [
972
+ 13,
973
+ "bax",
974
+ [
975
+ 1,
976
+ "bx",
977
+ "-",
978
+ "sx"
979
+ ]
980
+ ],
981
+ [
982
+ 13,
983
+ "bay",
984
+ [
985
+ 1,
986
+ "by",
987
+ "-",
988
+ "sy"
989
+ ]
990
+ ],
991
+ [
992
+ 13,
993
+ "tt",
994
+ [
995
+ 6,
996
+ "std.clamp",
997
+ [
998
+ [
999
+ 1,
1000
+ [
1001
+ 1,
1002
+ [
1003
+ 1,
1004
+ [
1005
+ 1,
1006
+ "px",
1007
+ "-",
1008
+ "sx"
1009
+ ],
1010
+ "*",
1011
+ "bax"
1012
+ ],
1013
+ "+",
1014
+ [
1015
+ 1,
1016
+ [
1017
+ 1,
1018
+ "py",
1019
+ "-",
1020
+ "sy"
1021
+ ],
1022
+ "*",
1023
+ "bay"
1024
+ ]
1025
+ ],
1026
+ "/",
1027
+ [
1028
+ 6,
1029
+ "std.max",
1030
+ [[
1031
+ 1,
1032
+ [
1033
+ 1,
1034
+ "bax",
1035
+ "*",
1036
+ "bax"
1037
+ ],
1038
+ "+",
1039
+ [
1040
+ 1,
1041
+ "bay",
1042
+ "*",
1043
+ "bay"
1044
+ ]
1045
+ ], [5, "1e-8"]]
1046
+ ]
1047
+ ],
1048
+ [5, "0"],
1049
+ [5, "1"]
1050
+ ]
1051
+ ]
1052
+ ],
1053
+ [
1054
+ 13,
1055
+ "dist",
1056
+ [
1057
+ 1,
1058
+ [
1059
+ 6,
1060
+ "std.length",
1061
+ [[
1062
+ 6,
1063
+ "d.vec2f",
1064
+ [[
1065
+ 1,
1066
+ "px",
1067
+ "-",
1068
+ [
1069
+ 1,
1070
+ "sx",
1071
+ "+",
1072
+ [
1073
+ 1,
1074
+ "bax",
1075
+ "*",
1076
+ "tt"
1077
+ ]
1078
+ ]
1079
+ ], [
1080
+ 1,
1081
+ "py",
1082
+ "-",
1083
+ [
1084
+ 1,
1085
+ "sy",
1086
+ "+",
1087
+ [
1088
+ 1,
1089
+ "bay",
1090
+ "*",
1091
+ "tt"
1092
+ ]
1093
+ ]
1094
+ ]]
1095
+ ]]
1096
+ ],
1097
+ "-",
1098
+ [
1099
+ 6,
1100
+ "std.mix",
1101
+ [
1102
+ "ra",
1103
+ "rb",
1104
+ "tt"
1105
+ ]
1106
+ ]
1107
+ ]
1108
+ ],
1109
+ [
1110
+ 11,
1111
+ [
1112
+ 1,
1113
+ "dist",
1114
+ "<",
1115
+ "jMin"
1116
+ ],
1117
+ [0, [[
1118
+ 2,
1119
+ "jMin",
1120
+ "=",
1121
+ "dist"
1122
+ ], [
1123
+ 2,
1124
+ "jAge",
1125
+ "=",
1126
+ [
1127
+ 6,
1128
+ "std.mix",
1129
+ [
1130
+ "sAge",
1131
+ "bAge",
1132
+ "tt"
1133
+ ]
1134
+ ]
1135
+ ]]]
1136
+ ],
1137
+ [
1138
+ 2,
1139
+ "sx",
1140
+ "=",
1141
+ "bx"
1142
+ ],
1143
+ [
1144
+ 2,
1145
+ "sy",
1146
+ "=",
1147
+ "by"
1148
+ ],
1149
+ [
1150
+ 2,
1151
+ "sAge",
1152
+ "=",
1153
+ "bAge"
1154
+ ],
1155
+ [
1156
+ 2,
1157
+ "sWid",
1158
+ "=",
1159
+ "bWid"
1160
+ ]
1161
+ ]]
1162
+ ],
1163
+ [
1164
+ 2,
1165
+ "minSdf",
1166
+ "=",
1167
+ [
1168
+ 6,
1169
+ "std.min",
1170
+ ["minSdf", "jMin"]
1171
+ ]
1172
+ ],
1173
+ [
1174
+ 13,
1175
+ "w",
1176
+ [
1177
+ 6,
1178
+ "std.exp",
1179
+ [[
1180
+ 1,
1181
+ [
1182
+ 1,
1183
+ "jMin",
1184
+ "*",
1185
+ [
1186
+ 4,
1187
+ "-",
1188
+ [5, "1"]
1189
+ ]
1190
+ ],
1191
+ "*",
1192
+ "sharp"
1193
+ ]]
1194
+ ]
1195
+ ],
1196
+ [
1197
+ 2,
1198
+ "ageSum",
1199
+ "=",
1200
+ [
1201
+ 1,
1202
+ "ageSum",
1203
+ "+",
1204
+ [
1205
+ 1,
1206
+ "jAge",
1207
+ "*",
1208
+ "w"
1209
+ ]
1210
+ ]
1211
+ ],
1212
+ [
1213
+ 2,
1214
+ "wSum",
1215
+ "=",
1216
+ [
1217
+ 1,
1218
+ "wSum",
1219
+ "+",
1220
+ "w"
1221
+ ]
1222
+ ]
1223
+ ]],
1224
+ [0, [
1225
+ [
1226
+ 13,
1227
+ "dist",
1228
+ [
1229
+ 1,
1230
+ [
1231
+ 6,
1232
+ "std.length",
1233
+ [[
1234
+ 6,
1235
+ "d.vec2f",
1236
+ [[
1237
+ 1,
1238
+ "px",
1239
+ "-",
1240
+ "cx"
1241
+ ], [
1242
+ 1,
1243
+ "py",
1244
+ "-",
1245
+ "cy"
1246
+ ]]
1247
+ ]]
1248
+ ],
1249
+ "-",
1250
+ [
1251
+ 1,
1252
+ [
1253
+ 1,
1254
+ "baseRadius",
1255
+ "*",
1256
+ [
1257
+ 6,
1258
+ "std.abs",
1259
+ [[
1260
+ 7,
1261
+ "cur",
1262
+ "w"
1263
+ ]]
1264
+ ]
1265
+ ],
1266
+ "*",
1267
+ [
1268
+ 1,
1269
+ [5, "1"],
1270
+ "-",
1271
+ [
1272
+ 1,
1273
+ [
1274
+ 7,
1275
+ "cur",
1276
+ "z"
1277
+ ],
1278
+ "*",
1279
+ "shrink"
1280
+ ]
1281
+ ]
1282
+ ]
1283
+ ]
1284
+ ],
1285
+ [
1286
+ 2,
1287
+ "minSdf",
1288
+ "=",
1289
+ [
1290
+ 6,
1291
+ "std.min",
1292
+ ["minSdf", "dist"]
1293
+ ]
1294
+ ],
1295
+ [
1296
+ 13,
1297
+ "w",
1298
+ [
1299
+ 6,
1300
+ "std.exp",
1301
+ [[
1302
+ 1,
1303
+ [
1304
+ 1,
1305
+ "dist",
1306
+ "*",
1307
+ [
1308
+ 4,
1309
+ "-",
1310
+ [5, "1"]
1311
+ ]
1312
+ ],
1313
+ "*",
1314
+ "sharp"
1315
+ ]]
1316
+ ]
1317
+ ],
1318
+ [
1319
+ 2,
1320
+ "ageSum",
1321
+ "=",
1322
+ [
1323
+ 1,
1324
+ "ageSum",
1325
+ "+",
1326
+ [
1327
+ 1,
1328
+ [
1329
+ 7,
1330
+ "cur",
1331
+ "z"
1332
+ ],
1333
+ "*",
1334
+ "w"
1335
+ ]
1336
+ ]
1337
+ ],
1338
+ [
1339
+ 2,
1340
+ "wSum",
1341
+ "=",
1342
+ [
1343
+ 1,
1344
+ "wSum",
1345
+ "+",
1346
+ "w"
1347
+ ]
1348
+ ]
1349
+ ]]
1350
+ ]
1351
+ ]]
1352
+ ],
1353
+ [
1354
+ 2,
1355
+ "prev2",
1356
+ "=",
1357
+ [
1358
+ 6,
1359
+ "d.vec4f",
1360
+ ["prev"]
1361
+ ]
1362
+ ],
1363
+ [
1364
+ 2,
1365
+ "prev",
1366
+ "=",
1367
+ [
1368
+ 6,
1369
+ "d.vec4f",
1370
+ ["cur"]
1371
+ ]
1372
+ ]
1373
+ ]]
1374
+ ],
1375
+ [
1376
+ 13,
1377
+ "age",
1378
+ [
1379
+ 1,
1380
+ "ageSum",
1381
+ "/",
1382
+ [
1383
+ 6,
1384
+ "std.max",
1385
+ ["wSum", [5, "1e-20"]]
1386
+ ]
1387
+ ]
1388
+ ],
1389
+ [
1390
+ 13,
1391
+ "coverage",
1392
+ [
1393
+ 1,
1394
+ [
1395
+ 1,
1396
+ [5, "1"],
1397
+ "-",
1398
+ [
1399
+ 6,
1400
+ "std.smoothstep",
1401
+ [
1402
+ [
1403
+ 1,
1404
+ "edgeW",
1405
+ "*",
1406
+ [
1407
+ 4,
1408
+ "-",
1409
+ [5, "1"]
1410
+ ]
1411
+ ],
1412
+ "edgeW",
1413
+ "minSdf"
1414
+ ]
1415
+ ]
1416
+ ],
1417
+ "*",
1418
+ [
1419
+ 1,
1420
+ [5, "1"],
1421
+ "-",
1422
+ [
1423
+ 6,
1424
+ "std.smoothstep",
1425
+ [
1426
+ [5, "0.8"],
1427
+ [5, "1"],
1428
+ "age"
1429
+ ]
1430
+ ]
1431
+ ]
1432
+ ]
1433
+ ],
1434
+ [10, [
1435
+ 6,
1436
+ "d.vec2f",
1437
+ ["age", "coverage"]
1438
+ ]]
1439
+ ]]
1440
+ },
1441
+ externals: {
1442
+ "std.max": () => max,
1443
+ "d.f32": () => f32,
1444
+ "d.vec4f": () => vec4f,
1445
+ "MAX_POINTS": () => MAX_POINTS,
1446
+ "std.textureLoad": () => textureLoad,
1447
+ "d.vec2u": () => vec2u,
1448
+ "d.u32": () => u32,
1449
+ "std.select": () => select,
1450
+ "std.abs": () => abs,
1451
+ "BEZIER_SUBDIVISIONS": () => BEZIER_SUBDIVISIONS,
1452
+ "std.mix": () => mix,
1453
+ "std.clamp": () => clamp,
1454
+ "std.length": () => length,
1455
+ "d.vec2f": () => vec2f,
1456
+ "std.min": () => min,
1457
+ "std.exp": () => exp,
1458
+ "std.smoothstep": () => smoothstep
1459
+ }
1460
+ }) && $.f)({})).$name("cursorTrailScan");
1461
+ const componentDefinition = {
1462
+ name: "CursorTrail",
1463
+ boundingBoxDeclaration: { aspectRatio: null },
1464
+ category: "Interactive",
1465
+ description: "Animated trail effect that tracks cursor movement",
1466
+ usesPointer: true,
1467
+ props: {
1468
+ colorA: {
1469
+ default: "#00aaff",
1470
+ transform: transformColor,
1471
+ description: "Color of fresh trails",
1472
+ ui: {
1473
+ type: "color",
1474
+ label: "Start Color",
1475
+ group: "Colors"
1476
+ }
1477
+ },
1478
+ colorB: {
1479
+ default: "#ff00aa",
1480
+ transform: transformColor,
1481
+ description: "Color trails transition to as they fade",
1482
+ ui: {
1483
+ type: "color",
1484
+ label: "End Color",
1485
+ group: "Colors"
1486
+ }
1487
+ },
1488
+ stops: colorStopsPropConfig(),
1489
+ radius: {
1490
+ default: .5,
1491
+ description: "Base radius of the trail stroke",
1492
+ ui: {
1493
+ type: "range",
1494
+ min: .5,
1495
+ max: 2,
1496
+ step: .1,
1497
+ label: "Radius",
1498
+ group: "Effect"
1499
+ }
1500
+ },
1501
+ length: {
1502
+ default: .5,
1503
+ description: "How long the trail persists (in seconds)",
1504
+ ui: {
1505
+ type: "range",
1506
+ min: .1,
1507
+ max: 2,
1508
+ step: .1,
1509
+ label: "Trail Length",
1510
+ group: "Animation"
1511
+ }
1512
+ },
1513
+ shrink: {
1514
+ default: 1,
1515
+ description: "How much the stroke tapers as it fades out (0 = no taper, 1 = full taper)",
1516
+ ui: {
1517
+ type: "range",
1518
+ min: 0,
1519
+ max: 1,
1520
+ step: .1,
1521
+ label: "Shrink Amount",
1522
+ group: "Effect"
1523
+ }
1524
+ },
1525
+ softness: {
1526
+ default: 0,
1527
+ description: "Edge softness of the trail (0 = crisp paint edge, 1 = very soft)",
1528
+ ui: {
1529
+ type: ["range", "map"],
1530
+ min: 0,
1531
+ max: 1,
1532
+ step: .01,
1533
+ label: "Softness",
1534
+ group: "Effect"
1535
+ }
1536
+ },
1537
+ colorSpace: {
1538
+ default: "linear",
1539
+ transform: transformColorSpace,
1540
+ compileTime: true,
1541
+ description: "Color space for color interpolation",
1542
+ ui: {
1543
+ type: "select",
1544
+ options: colorSpaceOptions,
1545
+ label: "Color Space",
1546
+ group: "Colors"
1547
+ }
1548
+ }
1549
+ },
1550
+ fragment: (params) => {
1551
+ const { ctx, propValues, uniforms, gpu } = params;
1552
+ if (!gpu?.root) return ZERO;
1553
+ const { createDataTexture, registerMediaTexture, onBeforeRender, onCleanup, onResize, getCpuValue, dimensions } = params;
1554
+ const pts = [];
1555
+ const texData = new Uint16Array(MAX_POINTS * 4);
1556
+ for (let i = 0; i < MAX_POINTS; i++) texData[i * 4 + 2] = HALF_ONE;
1557
+ const dataTex = createDataTexture({
1558
+ width: MAX_POINTS,
1559
+ height: 1,
1560
+ format: "rgba16float",
1561
+ data: texData,
1562
+ label: "cursortrail-points"
1563
+ });
1564
+ onCleanup(() => dataTex.destroy());
1565
+ const pointsKit = registerMediaTexture(() => dataTex.texture);
1566
+ const tracker = createPointerVelocityTracker({
1567
+ minDrag: .001,
1568
+ teleportGuard: Number.POSITIVE_INFINITY
1569
+ });
1570
+ let curW = Math.max(1, Math.round(dimensions.width));
1571
+ let curH = Math.max(1, Math.round(dimensions.height));
1572
+ onResize(({ width, height }) => {
1573
+ curW = Math.max(1, Math.round(width));
1574
+ curH = Math.max(1, Math.round(height));
1575
+ });
1576
+ let headDist = 0;
1577
+ let wasActive = false;
1578
+ onBeforeRender((fp) => {
1579
+ const { pointer, deltaTime } = fp;
1580
+ const rawDt = Math.max(0, deltaTime ?? 0);
1581
+ const dt = Math.min(rawDt, .1);
1582
+ const length$1 = getCpuValue("length") ?? .5;
1583
+ const drawRadius = (getCpuValue("radius") ?? .5) * .1;
1584
+ const aspect = curW / curH;
1585
+ const move = tracker.update(pointer, dt);
1586
+ const ageRate = Math.min(rawDt, .25) / Math.max(.1, length$1);
1587
+ for (const p of pts) p.age = Math.min(1, p.age + ageRate);
1588
+ while (pts.length > 0 && pts[0].age >= 1) pts.shift();
1589
+ if (move.dragDist > .001) {
1590
+ const stepDist = Math.sqrt(move.dx * aspect * (move.dx * aspect) + move.dy * move.dy);
1591
+ const widthNow = Math.min(1, Math.max(WIDTH_MIN, Math.sqrt(move.smoothSpeed / SPEED_FULL)));
1592
+ if (pts.length === 0) {
1593
+ pts.push({
1594
+ x: move.prevX,
1595
+ y: move.prevY,
1596
+ age: 0,
1597
+ link: 0,
1598
+ width: widthNow
1599
+ });
1600
+ pts.push({
1601
+ x: move.x,
1602
+ y: move.y,
1603
+ age: 0,
1604
+ link: 1,
1605
+ width: widthNow
1606
+ });
1607
+ headDist = stepDist;
1608
+ } else {
1609
+ const head = pts[pts.length - 1];
1610
+ head.x = move.x;
1611
+ head.y = move.y;
1612
+ head.age = 0;
1613
+ head.width = widthNow;
1614
+ headDist += stepDist;
1615
+ if (headDist >= Math.max(.006, drawRadius * .5)) {
1616
+ const n = pts.length;
1617
+ if (n >= 3 && pts[n - 2].link === 1) {
1618
+ pts[n - 2].x = .25 * pts[n - 3].x + .5 * pts[n - 2].x + .25 * pts[n - 1].x;
1619
+ pts[n - 2].y = .25 * pts[n - 3].y + .5 * pts[n - 2].y + .25 * pts[n - 1].y;
1620
+ }
1621
+ pts.push({
1622
+ x: move.x,
1623
+ y: move.y,
1624
+ age: 0,
1625
+ link: 1,
1626
+ width: widthNow
1627
+ });
1628
+ headDist = 0;
1629
+ }
1630
+ }
1631
+ while (pts.length > MAX_POINTS - 1) pts.shift();
1632
+ }
1633
+ const active = pts.length > 0;
1634
+ if (active || wasActive) {
1635
+ const count = pts.length > 0 ? pts.length + 1 : 0;
1636
+ for (let i = 0; i < MAX_POINTS; i++) {
1637
+ const base = i * 4;
1638
+ if (i < count) {
1639
+ const p = pts[Math.min(i, pts.length - 1)];
1640
+ texData[base] = toHalfFloat(p.x);
1641
+ texData[base + 1] = toHalfFloat(p.y);
1642
+ texData[base + 2] = toHalfFloat(p.age);
1643
+ texData[base + 3] = toHalfFloat(i === pts.length || p.link === 1 ? p.width : -p.width);
1644
+ } else {
1645
+ texData[base] = 0;
1646
+ texData[base + 1] = 0;
1647
+ texData[base + 2] = HALF_ONE;
1648
+ texData[base + 3] = 0;
1649
+ }
1650
+ }
1651
+ dataTex.write(texData);
1652
+ }
1653
+ wasActive = active;
1654
+ });
1655
+ const scan = call(cursorTrailScan, "cursorTrailScan", [
1656
+ pointsKit.accessor(),
1657
+ ctx.uv,
1658
+ ctx.aspect,
1659
+ uniforms.radius,
1660
+ uniforms.shrink,
1661
+ uniforms.softness,
1662
+ ctx.viewportSize.member("y")
1663
+ ]);
1664
+ const trailAge = scan.member("x");
1665
+ const coverage = scan.member("y");
1666
+ const colorSpaceMode = propValues.colorSpace ?? 0;
1667
+ const stopCount = propValues.stopCount ?? 0;
1668
+ let trailColor;
1669
+ if (stopCount > 1) trailColor = mixColorStopsRuntime(trailAge, {
1670
+ colorsArray: uniforms.colorsArray,
1671
+ positionsArray: uniforms.positionsArray,
1672
+ convertedColorsArray: uniforms.convertedColorsArray,
1673
+ stopCount: uniforms.stopCount
1674
+ }, colorSpaceMode);
1675
+ else {
1676
+ const cm = colorMixing_exports;
1677
+ trailColor = call(cm.mixColorsVariants[colorSpaceMode] ?? cm.mixColorsLinear, "mixColors", [
1678
+ uniforms.colorA,
1679
+ uniforms.colorB,
1680
+ trailAge
1681
+ ]);
1682
+ }
1683
+ return vec4(trailColor.member("rgb"), trailColor.member("a").mul(coverage));
1684
+ }
1685
+ };
1686
+ var CursorTrail_default = componentDefinition;
1687
+ export { componentDefinition as n, cursorTrailScan as r, CursorTrail_default as t };