← f_ notebook · docs/f-reference/f_vf_vortex_multi.md

f_vf_vortex_multi ​

Type: Generator (f_vecfield producer) Status: Complete


What it does ​

Three-site additive vortex field generator — sums three independent f_vf_vortex-style fields (each with its own position, convergence, and curl, sharing one global falloff) into a single f_vecfield texture. Drop-in replacement for f_vf_vortex wherever multi-focal caustic/optical effects are wanted. Primary consumer: f_caustic (multiple independent bright zones).

Sites contribute additively per-pixel, each weighted by its own exponential falloff — sites close together reinforce convergence, sites far apart create independent focal zones, with no visible seams downstream.


Signal Flow ​

in0 (control only; renders on its own `r draw`) → params route to dials → vf_vortex_multi_pix
in1 (cx mod texture, optional)          → vs_inState → vf_vortex_multi_pix
in2 (cy mod texture, optional)          → vs_inState → vf_vortex_multi_pix
in3 (convergence mod texture, optional) → vs_inState → vf_vortex_multi_pix
in4 (curl mod texture, optional)        → vs_inState → vf_vortex_multi_pix

vf_vortex_multi_pix (@type float32) → out0

Site position inlets (vsc_center_ctrl-driven, injected post-build at indices 5–7) allow each site's cx/cy to be animated independently — three separate vsc_center_ctrl instances can drive orbital motion per site. Unconnected site position falls back to that site's static sN_cx/sN_cy dial values.


Parameters ​

ParamRangeDefaultDescription
s1_cx / s1_cy0–10.3 / 0.3Site 1 position
s1_conv0–10.5Site 1 convergence
s1_curl-1–10.0Site 1 curl
s2_cx / s2_cy0–10.5 / 0.5Site 2 position
s2_conv0–10.5Site 2 convergence
s2_curl-1–10.0Site 2 curl
s3_cx / s3_cy0–10.7 / 0.7Site 3 position
s3_conv0–10.5Site 3 convergence
s3_curl-1–10.0Site 3 curl
falloff0–102.0Shared exponential falloff rate across all three sites
cx_amt0–10.0Global cx modulation depth (inlet 1) — offsets all three sites together
cy_amt0–10.0Global cy modulation depth (inlet 2)
conv_amt0–10.0Global convergence modulation depth (inlet 3)
curl_amt0–10.0Global curl modulation depth (inlet 4)
bypass0/10Outputs the neutral field (0.5, 0.5, 0.5, 1.0)

Prefix: vf_vortex_multi — Object name: vf_vortex_multi_pix


Field Encoding ​

f_vecfield convention: R = fx * 0.5 + 0.5, G = fy * 0.5 + 0.5, B = 0.5, A = 1.0. Consumers decode via (sample - 0.5) * 2.0. Global modulation inlets decode the same way and offset all three sites' cx/cy/convergence/curl simultaneously — there is no per-site modulation depth in v1 (shared depth, per-site base values only).


Algorithm ​

Each site independently computes a standard vortex field (radial + tangential components weighted by convergence/curl) about its own center, scaled by exp(-r * falloff). All three sites' (fx, fy) contributions sum additively before the limit and encoding:

for each site N in {1,2,3}:
    dx, dy = uv - (sN_cx + cx_mod, sN_cy + cy_mod)
    r = length(dx, dy); rx, ry = dx/r, dy/r; tx, ty = -ry, rx
    fN = (sN_conv + conv_mod) * (-rx, -ry) + (sN_curl + curl_mod) * (tx, ty)
    fN *= exp(-r * falloff)

fx, fy = f1 + f2 + f3
k = 1 / max(|fx|, |fy|, 1);  R, G = fx*k*0.5+0.5, fy*k*0.5+0.5

Sites at identical positions sum to roughly 3x single-site magnitude (limited so the larger component is at most 1, direction kept) — produces a single very bright zone rather than a capped-equal one.


Notes ​

  • Falloff is shared across all three sites (not per-site) — deliberate v1 scope limit, per spec.md's "Out of Scope."
  • No per-site modulation inlets in v1 — only the four global (all-sites) modulation inlets exist; per-site modulation is listed as a possible v2 addition following the f_vf_vortex pattern.
  • More than three sites, a Voronoi/nearest-site-wins combination mode, and built-in LFO/animation are explicitly out of scope for v1.
  • A second, differing copy, f_vf_vortex_multi_version.maxpat, used to sit beside the primary patcher, undocumented. It was moved out of package/patchers/ to archive/ on 2026-10-05 (build_cleanup/T007), so it no longer ships; it is kept there, and in git history, in case it turns out to be wanted.
  • See docs/f-reference/f_vecfield_type.md for full type contract.