2 Filters Magic
Flaig edited this page 2026-10-08 00:32:15 +02:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Magic

Shields, globes, webs and splashes.

Example status: these are parameter demonstrations, many adapted from TokenMagicFX. Every example passes leanFX's validator. Live appearance checks are recorded below each macro; matching colours and the result still depend on your source image. These checks do not establish long-running stability. Some examples intentionally darken or hide the original image.

Columns: Default is the value used when the spec omits the parameter. Animate says whether it can be driven by animated (Animation). Construction options are fixed when the filter is built; changing them rebuilds it.

field · globes · web · splash

field

Force Field. A spherical shield with twelve surface styles.

A grey circle instead of a coloured water/smoke surface can be the inherited noise precision defect. Updated shaders use highp, initialize the coordinates in styles 9/10 and keep the sphere projection finite.

Default zOrder 2000

Parameter Type Default Animate Description
alphaDiscard boolean false — Discard the faint, dark parts of the effect instead of drawing them.
blend number 2 yes How the shield is mixed with the image. See Blend Modes; this filter adds 14 and 15.
chromatic boolean false — Rainbow color shift.
color color 0xbbbbbb color modes Effect color as a number, 0xRRGGBB.
discardThreshold number 0.25 yes With alphaDiscard, brightness below which shield pixels are cut.
hideRadius number 0 yes Hide the shield inside this radius (0–1) so the object stays visible; 0 is off.
intensity number 1 yes Shield intensity.
lightAlpha number 1 yes Opacity of the light spot, 0–1.
lightSize number 0.483 yes Size of the light spot.
posLightX number 0.65 yes Light spot position X, 0–1.
posLightY number 0.25 yes Light spot position Y, 0–1.
radius number 1 yes Shield radius relative to the filter area; 1 fills it.
scale number 1 yes Pattern scale.
shieldType number 1 yes Surface style: 1 ripples, 2 hexagons, 3 fire, 4–5 cells, 6 turbulence, 7 noise, 8 dense smoke, 9 dancing fumes, 10 large smoke, 11 grid, 12 galaxy.
time number 0 yes Shader clock. Static values freeze one frame; animate it with move (see the example) to make the effect flow.
await leanFX.addUpdateFiltersOnSelected([{
  filterType: "field",
  filterId: "hexa-field",
  shieldType: 2,
  gridPadding: 2,
  color: 0xcc00cc,
  blend: 3,
  intensity: 1,
  lightAlpha: 0.5,
  lightSize: 0.5,
  scale: 1,
  radius: 1,
  animated: {time: {animType: "move", speed: 0.0015}}
}]);

Visual check: User marked this example working on a Token in Foundry v14 on 2026-10-08. Other images and target types still need their own visual check.

globes

Globes. Floating, glowing orbs.

Default zOrder 270

Parameter Type Default Animate Description
alphaDiscard boolean false — Discard the faint, dark parts of the effect instead of drawing them.
color color 0xaa3050 color modes Effect color as a number, 0xRRGGBB.
distortion number 0.25 yes Globe distortion.
scale number 20 yes Number and size of the globes; larger values give more, smaller globes.
time number 0 yes Shader clock. Static values freeze one frame; animate it with move (see the example) to make the effect flow.
await leanFX.addUpdateFiltersOnSelected([{
  filterType: "globes",
  filterId: "globes",
  color: 0xaa3050,
  scale: 20,
  distortion: 0.25,
  animated: {time: {animType: "move", speed: 0.001}}
}]);

Visual check: User marked this example working on a Token in Foundry v14 on 2026-10-08. Other images and target types still need their own visual check.

web

Spider Web. A spider web over the image.

Web motion can be subtle. Updated shaders use higher precision for the noise and clock, and defined smoothstep edges; coarse half-precision calculations can make short intervals look frozen.

Default zOrder 260

Parameter Type Default Animate Description
alphaDiscard boolean false — Discard the faint, dark parts of the effect instead of drawing them.
amplitude number 0.8 yes Thread waviness.
anchorX number 0.5 yes Horizontal center of the effect as a fraction of the filtered area: 0 left, 0.5 middle, 1 right.
anchorY number 0.5 yes Vertical center of the effect as a fraction of the filtered area: 0 top, 0.5 middle, 1 bottom.
color color 0xbbbbbb color modes Effect color as a number, 0xRRGGBB.
div1 number 10 yes Number of radial threads.
div2 number 10 yes Number of rings.
tear number 0.54 yes How torn the web is.
thickness number 1 yes Thread thickness.
time number 0 yes Shader clock. Static values freeze one frame; animate it with move (see the example) to make the effect flow.
await leanFX.addUpdateFiltersOnSelected([{
  filterType: "web",
  filterId: "web",
  color: 0xffffff,
  thickness: 2,
  div2: 5,
  time: 98.8,
  animated: {time: {animType: "cosOscillation", loopDuration: 5000, val1: 98.8, val2: 99.7}}
}]);

Visual check: User marked this example working on a Token in Foundry v14 on 2026-10-08. Other images and target types still need their own visual check.

splash

Splash. A splash of blood, paint or slime.

Without time, every effect gets its own stable splash shape, identical on all clients.

Default zOrder 5

Parameter Type Default Animate Description
anchorX number 0.5 yes Horizontal center of the effect as a fraction of the filtered area: 0 left, 0.5 middle, 1 right.
anchorY number 0.5 yes Vertical center of the effect as a fraction of the filtered area: 0 top, 0.5 middle, 1 bottom.
blend number 8 yes How the splash is mixed with the image. See Blend Modes; this filter adds 14.
color color 0xf00505 color modes Effect color as a number, 0xRRGGBB.
cut boolean false — Remove the original image outside the splash shape. This does not clip the splash to the image.
dimX number 1 yes Horizontal pattern scale. Smaller values stretch the pattern.
dimY number 1 yes Vertical pattern scale. Smaller values stretch the pattern.
seed number 0.1 yes Shape seed.
splashFactor number 2 yes Number of splash arms.
spread number 5 yes Splash size.
textureAlphaBlend boolean false — Clip and fade the splash with the image's opacity. false allows splash marks outside the silhouette.
time number per effect yes Splash shape. Without it, a stable value is derived from the document and filter ID.
await leanFX.addUpdateFiltersOnSelected([{
  filterType: "splash",
  filterId: "wound",
  color: 0x990505,
  spread: 7,
  splashFactor: 2,
  dimX: 1,
  dimY: 1,
  blend: 8,
  cut: false
}]);

Visual check: User marked the revised example working on a Token in Foundry v14 on 2026-10-08. Other images and target types still need their own visual check.

Examples run on the selected placeables; see API Reference for other targets.