Register an element to track the position and render visual effects in the area.
OptionalinitialCapture: OffscreenCanvasRegister an element using html-in-canvas API.
Wraps the element in a <canvas layoutsubtree> and captures via drawElementImage.
Falls back to add() if html-in-canvas is not supported.
Destroy VFX and stop rendering.
Start rendering VFX.
Remove the element from VFX and stop rendering the shader.
Render the whole scene once, manually.
This is useful when you want to control the rendering timings manually by combining with autoplay: false.
Stop rendering VFX.
You can restart rendering by calling VFX.play() later.
Update the texture for the given element.
For an HTMLImageElement, reloads its current src — call this
after changing img.src. Videos refresh automatically (no-op).
Otherwise re-snapshots the element's DOM subtree.
Useful for elements whose contents change (input, textarea, or an
<img> whose src swaps).
Replace the effect chain on an already-registered effect-path
element in-place. Effects whose reference is unchanged keep their
init state and GPU resources; only added/removed effects run
init / dispose. The element's source texture is preserved.
Useful for live UIs that reorder or toggle effects without paying
the cost of vfx.remove + vfx.add (which reloads the source).
Staticinit
The main interface of VFX-JS.