Idea: anamorphic vecfield displace/distort module (name TBD)
Created: 2026-07-15Status: Idea — graduated out of f_lens v2 scope, not yet named, not specced
Origin
Originally planned as part of f_lens v2 (see .specify/f_lens/spec.md git history / plan.md ADR-6 for the full discussion). Pulled out after a design conversation established:
- Static anamorphic (fixed axis + squeeze ratio) is a real, non-redundant degree of freedom versus
f_lens's existingdistortion/distortion_mod— a mod-texture can vary warp magnitude spatially (e.g. an angled sine WFG intodistortion_modproduces directionally-patterned warp strength), but at any given pixel the existing distortion math is always isotropic (warp_cxandwarp_cyshare the same multiplier). Anamorphic squeeze is a constant per-axis scale ratio applied uniformly everywhere — a structurally different thing, not a spatial variant of whatdistortion_modalready does. - Despite being non-redundant,
f_lenswas judged "already very full of expressive potential" — Matt's call, 2026-07-15 — and the field-driven variant specifically needs a vecfield inlet, a signal type nothing else inf_lensuses, which is a structurally closer match to thef_vf_consumer family (f_vf_warp,f_vf_streak) than tof_lens's own radial-optical character. - Decision: both variants (static + field-driven) move out together into their own module, rather than splitting static-stays/ field-driven-leaves. One module owns the whole "anamorphic" concept; static is just the
field_amt=0case of the same mechanism.
Concept
A UV displace/distort processor providing anamorphic-style directional squeeze — static (fixed axis + ratio) and field-driven (vecfield inlet biases the squeeze axis per-pixel) in one module.
Static half — same math as would have gone into f_lens: per-axis multiplier on a (1.0 + k*r2)-style radial scale, applied along a chosen axis instead of uniformly.
Field-driven half — vecfield inlet (f_vf_ consumer family convention: "vecfield in" label, nabla in f_modules menu) biases the static axis. Mechanism already worked out during the f_lens design conversation (2026-07-15), reusable here directly:
- Convert the static axis param to a unit vector:
theta = axis * pi; static_dx = cos(theta); static_dy = sin(theta); - Decode the vecfield per
f_vecfieldconvention (RG=XY, 0.5=zero):field_dx = (sample(vf_in,uv).x - 0.5)*2.0; field_dy = (sample(vf_in,uv).y - 0.5)*2.0; - Hemisphere-align the field vector to the static axis before blending — a squeeze axis is a line, not a direction (0° and 180° mean the same thing), so the field vector needs to be flipped toward the "short way" before blending, or a naive angle-blend can land on the wrong side of the wraparound:
align = step(0.0, static_dx*field_dx + static_dy*field_dy) * 2.0 - 1.0;field_dx = field_dx * align; field_dy = field_dy * align; - Blend the two vectors by
field_amt, then re-derive the final angle viaatan2— sidesteps the angle-wraparound discontinuity entirely, since vector blending has no discontinuity the way angle blending does. - Use the final angle to drive the per-axis squeeze multiplier.
Cross-reference: same line/axis problem as tensor fields (added 2026-10-11)
Step 3's hemisphere-align hack (step(0.0, dot) * 2.0 - 1.0, then flip) is a from-scratch solution to a problem vector_field_math_concepts.md #9 names generally: a squeeze axis is a line, not a direction, so a signed-vector representation needs this kind of manual sign-correction before blending at all. f_tensorfield.md's f_tf_tensormap producer encodes exactly this class of quantity natively — angle-doubled (2θ) storage, no sign to re-align by construction, same underlying fix f_weave_orientation_blend.md arrived at independently for the same reason. Not a drop-in replacement here — this module's field-driven half still wants a vecfield inlet by its own stated reasoning (closer to the f_vf_ consumer family than to f_lens's own radial-optical character) — but worth a second look once f_tensorfield.md's outlet 2 and its atan2-safety open question (its #6) are both settled: the align-then-blend mechanism above might simplify to a direct angle-doubled blend with no hemisphere step at all.
Update 2026-10-12: the atan2 half of that condition is settled — verified GPU-safe (tests/records/spike_atan2_safety.py: correct on decoded sampled-texture input across all quadrants to 5.6e-7 rad, branch cut properly wrapped, one benign ±π quirk at the Fy==0, Fx<0 boundary). The angle-doubled simplification still waits on outlet 2's representation (OQ2), which is unchanged.
Rough param contract (candidate, not locked)
| Param | Range | Default | Description |
|---|---|---|---|
squeeze | -1..1 | 0.0 | Squeeze amount (bipolar, per the library's current direction on aberration/distortion/etc. — confirm this convention still applies once this module is actually specced). |
axis | 0–1 | 0.0 | Static squeeze axis angle, same wrap convention as f_lens's old tilt_axis. |
field_amt | 0–1 | 0.0 | Vecfield inlet's influence on axis. 0 = static axis only. 1 = axis fully field-driven. |
Names are placeholders — no naming-collision check done yet, no gain/mix convention check done yet (this module has no composite/blend outlet as currently conceived, so that convention may not even apply — confirm when specced).
Open questions (unresolved — this is an idea file, not a spec)
- Module name. Deferred (Matt's call, 2026-07-15). Something in the
f_vf_family, per the consumer-family reasoning above. - Chain position / archetype. Processor, presumably — needs upstream texture. Confirm against the two established archetypes in
vsynth-bpatcher/SKILL.mdonce specced. - Does this want its own radial distortion math at all, or should it purely be a squeeze layer that composes with
f_lensdownstream/ upstream in a chain (i.e., no redundantdistortion-style base warp of its own, just the anisotropic scale)? Not decided — the mechanism above assumes a(1.0+k*r2)-shaped base, but that was inherited wholesale from thef_lensdesign context, not re-derived for this module's own identity. - Relationship to
f_vf_warp—f_vf_warpis already "UV warp via f_vecfield" in the README's module table. Worth checking directly whether this new module is meaningfully different fromf_vf_warpbefore speccing it as a separate thing, or whether it's actually a mode/extension off_vf_warpitself. Not checked yet.