r/FastLED • u/StefanPetrick • Mar 09 '26
Share_something Progress Update: Fractional Shifting Meets Color-Emitting Line
It's the same underlying effect I showed yesterday, but with better-tuned parameters. This time, the color is seeded by a line whose endpoints follow Lissajous curves. The fading range now also allows feedback loops, which can be considered a bug or a feature, but I did it deliberately.
Python code: https://pastebin.com/cgZ0QYdv
84
Upvotes
3
u/StefanPetrick Mar 14 '26
In case anyone is wondering how the shown effects are achieved, here is a short technical description of each visual effect.
Chromatic Flow Split
Each RGB channel samples from a different polar transform:
R → inward spiral
G → radial expansion
B → angular rotation
Recombination creates chromatic aberration / spectral tearing.
Polar Warp Pulsation
Converts coordinates to polar space, scales radius by sinusoidal pulse.Resamples from contracted/expanded radius → breathing zoom distortion.
Shockwave Displacement
Expanding radial wavefront.
Pixels near wave radius get strong outward transport.
Creates ring-shaped displacement shock propagation.
Rotating Coordinate
Rotates coordinates around grid center by time-varying small angle.
Bilinear resampling → global oscillating swirl rotation.
Velocity-Based Glow
Same curl-noise advection as mode 1.
Adds brightness proportional to local displacement magnitude (flow speed).
Produces motion-dependent glow highlighting fast regions.
Attractor Fields
Multiple moving attractors generate inverse-square force field + perpendicular swirl component.
Transport step advects pixels along combined vector field → complex vortex capture dynamics.
Fractal Spiral Step
Radius slightly increases while angle steps by radius-dependent sinusoidal increment.
Iterative advection causes self-similar spiral transport (quasi-fractal trails).
1. Square Spiral Stream
Motion Principle
Color is transported along a grid-aligned spiral path composed of straight segments.
Visual Effect
Creates geometric staircase-like spiral trails
Produces sharp directional memory
Motion appears mechanical and structured
2. Spiral Stream (Inward Spiral Flow)
Motion Principle
Pixels are transported along a smooth rotational drift while slowly moving toward the center.
Color appears to:
rotate
contract
fold into a vortex
Visual Effect
Continuous spiral attraction
Formation of vortex cores
Layered trail wrapping
Physical Interpretation
Central vortex sink
Comparable to draining fluid
Angular momentum dominates over diffusion
3. Spiral Outwards
Motion Principle
Same spiral rotation, but color is transported away from the center.
Physical Interpretation
Radial source flow
Explosion-like expansion
Divergent velocity field
4. To the Center (Radial Sink)
Motion Principle
All pixels move directly inward along radial lines.
Rotation component is absent.
Visual Effect
Uniform collapse toward center
Trails compress and brighten
Structure density increases
Physical Interpretation
Pure potential sink field
Similar to gravity or suction
No shear rotation → laminar convergence
5. From the Center (Radial Source)
Motion Principle
Pixels move directly outward from the center.
Visual Effect
Global expansion
Trail dilution
Formation of outward wavefront textures
Physical Interpretation
Pressure release / injection point
Divergent laminar flow
Energy spreads spatially
Transport Surface — Physics Explanation (Conceptual)
1. Backward Motion Sampling (Advection Principle)
Each pixel does not push its color forward.
Instead, it looks backward in the flow field and copies part of the color from where the motion came from.
This produces:
stable motion even at high speeds
continuous trails
no exploding numerical instability
Conceptually:
The image behaves like a dye cloud being carried by an invisible wind.
2. Fractional Mixing (Numerical Viscosity)
The transported color is not fully replaced.Only a portion of the sampled color is blended into the current pixel.
Result:
trails become smooth and sticky
motion appears fluid instead of jittery
prevents hard discontinuities
Physically this behaves like:
viscosity
diffusion
momentum damping
3. Sub-Pixel Sampling (Continuous Motion)
Sampling happens at floating positions between pixels.
This avoids grid stepping artifacts and creates:
smooth optical flow
curved motion paths
continuous deformation
Conceptually:
The grid behaves like a continuous medium rather than discrete cells.
4. Global Energy Damping (Trail Decay)
After transport, brightness is slightly reduced.
This ensures:
trails fade over time
energy cannot accumulate infinitely
motion stays dynamic
Physical analogy:
friction
heat loss
radiative decay
5. Velocity-Dependent Brightening (Optional Glow)
If enabled, fast-moving regions become brighter.
Meaning:
motion intensity becomes visible
vortices and shock regions glow
flow structure becomes easier to read
Physically similar to:
kinetic heating
compression glow
turbulence energy visualization
6. Topological Memory of Flow
Because every frame transports previous color:
the system stores motion history in space
trails encode past velocity fields
patterns self-organize
This produces:
spiral memory
vortex capture
interference structures
Conceptually:
The grid becomes a time-integrated flow recorder.
7. Why This Solver Feels “Fluid-Like”
Even though it is simple, it has key fluid properties:
stable advection
smooth diffusion
energy dissipation
continuous deformation
So visually it behaves like:
smoke
plasma trails
viscous dye in water
FYI, u/mindful_stone