Studio Yotsuba
Back to Node List

FX Boundary Response

fx_boundary_response

Makes deterministic FX particles react to a fixed image mask without introducing a separate physics system.

Reviewed
Guide available

Input Ports

NameTypeDescription
FX
fx
FxState2D
Required
FX state to constrain.
Boundary Mask
mask
Image
Required
Opaque pixels are obstacles by default. Use a mask matching the FX canvas for predictable contact positions.

Output Ports

NameTypeDescription
FX
fx
FxState2D
FX state with the boundary rule appended.
Debug Mask
debug_mask
Image
The exact mask stored in the FX state, useful for checking scale and alignment.
Boundary Count
boundary_count
Int
Number of fixed mask boundaries in this FX state.
Summary
summary
Text
Short summary after adding the boundary.

Parameters

NameTypeDefaultRangeDescription / Options
Response
response
Enum
Reflect—

Choose how particles react after entering the mask: bounce, slide along it, stop, or disappear.

  • reflectReflect
  • slideSlide
  • stopStop
  • killKill
Bounce
restitution
Float
0.650–1 / step 0.01

Retained normal speed after a bounce. Around 0.2 feels heavy; 0.6-0.8 suits sparks; 1.0 keeps full speed.

Surface Friction
friction
Float
0.150–1 / step 0.01

Reduces motion along the boundary. Use 0-0.2 for wet roofs and 0.6 or more when particles should settle quickly.

Mask Threshold
threshold
Float
0.50–1 / step 0.01

Alpha at which the mask becomes solid. 0.5 is a good default; raise it to ignore soft antialiased edges.

Keep Inside Mask
invert
Bool
false—

Treats transparent pixels as obstacles instead, keeping particles inside the opaque mask shape.

Overview

Adds fixed-image obstacles to FxState2D. It creates deterministic, lightweight effects such as rain sliding over a roof, sparks bouncing from the floor, or smoke stopping at a wall without introducing a fluid or general-purpose physics engine.

Usage tips

  • A common chain is fx_domain_2d → fx_emitter_2d → fx_force → fx_boundary_response → fx_rasterize. Put the boundary response after forces.
  • Match the mask dimensions to the FX canvas. Preview debug_mask to see the exact pixels used by collision tests.
  • For sparks, start with Bounce, restitution 0.6–0.8, and surface friction 0.1–0.3. For rain, start with Slide and friction 0–0.2.
  • Enable Keep Inside Mask for effects contained inside a vessel or cave.
  • Chain multiple boundary nodes when different obstacles need different responses, such as sliding on a roof and disappearing on the ground.

Common mistakes

  • Particles pass through: per-frame speed may exceed mask thickness. Reduce speed or thicken the mask; this version uses per-frame pixel tests rather than continuous collision.
  • Particles react too early at a translucent edge: raise Mask Threshold to 0.7–0.9.
  • Stamps are clipped at canvas edges: enable horizontal or vertical wrapping in fx_domain_2d on the required axes.
  • Particles cannot leave the mask: verify that Keep Inside Mask matches the intended use.

Related nodes

  • fx_domain_2d — define canvas dimensions and periodic boundaries
  • fx_emitter_2d — emit particles
  • fx_force — add gravity, wind, and turbulence
  • fx_rasterize — render the post-collision particle state
Back to Node List