Your system asks for reduced motion, so VFX-JS draws nothing. Demos on this site show plain HTML.
API Reference
Every class, function and type in @vfx-js/core and
@vfx-js/effects, generated from the source. New to VFX-JS?
Start with Getting Started.
@vfx-js/core
The VFX class, its options, and the types for custom effects and transitions.
Classes
-
CrossfadeA transition made of one shader.fragdefinesvec4 transition(vec2 uv, float t)and reads the two sides withreadFrom/readTo. -
ShaderTransitionA transition made of one shader.fragdefinesvec4 transition(vec2 uv, float t)and reads the two sides withreadFrom/readTo. -
VFXThe main interface of VFX-JS.
Functions
-
isHicCanvasTrue ifelis a canvas that captures its children with drawElementImage. -
markHicCanvasMarkcanvasas an html-in-canvas wrapper andchildas drawable. -
setupCaptureSet up the paint handler + ResizeObservers on an html-in-canvas wrapper (<canvas layoutsubtree content="drawable">). Returns the initial OffscreenCanvas from the first paint. -
supportsHtmlInCanvas -
teardownCaptureTear down onpaint handler + ResizeObservers set up by setupCapture.
Interfaces
-
CaptureOpts -
EffectEffect interface. -
TransitionA transition: one effect plus the defaults a spec can override. Write it as a class. -
TransitionEffectAn effect that takes part in a run. Outside a run it is skipped and the chain passes its input through.renderalso runs while the old content is held (ctx.holding); pass the input through then unless you need those frames.updateruns only while the animation plays. -
TransitionHandleControls the transitions of one element.
Types
-
AddTransitionOpts -
EffectAttributeDescriptor -
EffectAttributeTypedArray -
EffectBlendMode -
EffectBlitOpts -
EffectContextContext passed to each Effect lifecycle hook. Fields are updated each frame automatically. -
EffectDimsPer-stage layout snapshot. Same shape onEffectContext.dims(frame-fresh inupdate/render) and as the argument toEffect.outputRect. -
EffectDrawOpts -
EffectGeometryCustom geometry forctx.draw({ geometry }). -
EffectQuadOpaque handle for the default fullscreen quad.ctx.draw()uses it by default whengeometryis omitted. SeeEffectContext.quadfor details. -
EffectRenderTargetA handle to an offscreen render target. -
EffectRenderTargetOpts -
EffectTextureA handle to a GPU texture. -
EffectTextureFilter -
EffectTextureSourceSource types accepted byEffectContext.wrapTexture. -
EffectTextureWrap -
EffectUniforms -
EffectUniformValueA value you can assign to a shader uniform. The upload variant (uniform1fetc) is picked automatically from the shader's declared uniform type. -
EffectVFXPropsSubset ofVFXPropsexposed to effects viactx.vfxProps. -
GlslVersionGLSL ES version of a shader. When omitted on a VFX prop, it is auto-detected from the fragment shader: GLSL 100 markers (gl_FragColor,texture2D,varying,attribute) pick"100", otherwise"300 es". -
MarginOptsValues for margin, padding, overflow etc. -
RunContextPassed to therun()callback. -
RunOpts -
ShaderPreset -
ShowOpts -
SlideRefA direct child of the container, its index, or a selector inside it. -
TransitionClassA transition class. Core makes one instance per container withnew Class(params). -
TransitionEaseHowtfollows linear progress. A function maps 0..1 progress tot. -
TransitionEffectContextThe effect context during a run. -
TransitionProgressxis linear progress,tthe eased one. Both go from 0 to 1 and ignorereverse. -
TransitionRunOne run of a transition, passed toTransitionEffect.start. -
TransitionSpec -
TransitionUniformsNumbers, vectors and arrays; no textures. -
TransitionWaitForWhat to wait for after the DOM changes, before the new content is captured."media"waits for pending images, videos and fonts, up to about 300 ms. -
VFXOptsOptions to initializeVFXclass. -
VFXPassA single render pass in a multipass shader pipeline. -
VFXPostEffectConfiguration for post effects that are applied to the final canvas output. -
VFXPropsProperties for the element passed toVFX.add(). -
VFXUniforms -
VFXUniformValueType for the values of uniform variables. Scalars/tuples map to GLSLfloat/vec2/vec3/vec4. Flat numeric arrays (e.g.Float32Array) map to array uniforms — aFloat32Arrayof lengthN*4feedsuniform vec4 foo[N](oruniform float foo[N*4]). -
VFXWrapTexture wrapping mode. This corresponds togl.CLAMP_TO_EDGE,gl.REPEATandgl.MIRRORED_REPEATin WebGL API.
Variables
-
shadersShader code for presets. Shaders inshadercan be looked up with keys inShaderPreset.
@vfx-js/effects
Ready-made effects to pass to the effect option, and their parameters.
Classes
-
AsciiEffectASCII / glyph-mosaic effect. -
BadJpegEffectSimulates JPEG degradation: chroma subsampling, blocky DCT quantization, and generation loss from re-encoding the resultiterationstimes. Mutatequality/iterations/downscaledirectly for runtime tweaks. -
BloomEffectCOD:AW-style bloom. Mutateparamsdirectly or viasetParams— uniforms andoutputRectread live each frame, so a reactive UI (e.g. Tweakpane) can bind directly toeffect.params. -
ChromaticEffectEffect interface. -
ColoredEdgesEffectEffect interface. -
DatamoshEffectPseudo-datamosh via a faked H.264 block codec. Passes the input through untilenable(), then holds a motion-compensated accumulator so motion smears stale texture around. Mutateparamsdirectly or viasetParams; toggle the mosh withenable()/disable(). -
DitherEffectEffect interface. -
DuotoneEffectEffect interface. -
FluidEffectStable Fluid as a single Effect. Mutateparamsdirectly for runtime tweaks; tracked sim state is owned by the effect and reset on dispose. -
GlitchEffectEffect interface. -
GradientMapEffectEffect interface. -
HalftoneEffectEffect interface. -
HueShiftEffectEffect interface. -
JPEGGlitchEffectReal (codec-level) JPEG glitch. Reads the element back to the CPU, re-encodes it as a JPEG with the browser's native encoder, corrupts random bytes in the compressed scan stream, and draws the browser's decode of the broken file — so the artifacts are produced by an actual JPEG decoder rather than approximated in a shader. -
LightStreakEffectLight-streak effect (anamorphic flare / aperture starburst) built from instanced streak sprites. Mutateparamsdirectly or viasetParams; uniforms are read live each frame, so a reactive UI (e.g. Tweakpane) can bind straight toeffect.params. -
MatrixEffect"Digital rain" / Matrix-movie effect. -
ParticleEffectEffect interface. -
ParticleExplodeEffectEffect interface. -
PatternRefractionEffectEffect interface. -
PixelateEffectEffect interface. -
PixelSortEffectThreshold-based pixel sort. Scans each row/column for runs whosekeyfalls in therangeband and reorders the run bykey. Setangleto sort along an arbitrary direction. Mutateparamsdirectly or viasetParams. -
PixelStretchEffectEffect interface. -
RainbowEffectEffect interface. -
RgbGlitchEffectEffect interface. -
RgbShiftEffectEffect interface. -
ScanlineEffectEffect interface. -
SinewaveEffectEffect interface. -
SliceShiftEffectEffect interface. -
TilePixelateEffectEffect interface. -
TritoneEffectEffect interface. -
VignetteEffectEffect interface. -
VoronoiEffectEffect interface. -
WarpEffectEffect interface.
Types
-
AsciiCharRampA character ramp ordered dark → light: index0maps to the darkest input luminance, the last entry to the brightest. Pass a string (split per Unicode code point) or an array of single chars. -
AsciiColorRGBA colour, each channel in [0, 1]. -
AsciiImageSourceAn image tile source. Strings are treated as URLs (loaded and decoded ininit()); the rest are used directly. -
AsciiParams -
AsciiPresetNameName of a built-inASCII_PRESETSramp. -
BadJpegEffectOptions -
BloomParams -
ChromaticParams -
ColoredEdgesParams -
DatamoshColorSpace -
DatamoshParams -
DatamoshViewStage routed to the canvas; non-outputviews are for debugging. -
DitherParams -
DitherStyle -
DuotoneParams -
FluidParams -
GlitchParams -
GradientMapMixSpace -
GradientMapParams -
GradientMapRepeat -
HalftoneInk -
HalftoneInkPalette -
HalftoneInkPresetName -
HalftoneMode -
HalftoneParams -
HueShiftParams -
JPEGGlitchParams -
LightStreakParams -
MatrixColorRGBA colour, each channel in [0, 1]. -
MatrixGlyphsThe pool of glyphs rained down the columns. Pass a string (split per Unicode code point) or an array of single chars. The order is irrelevant — a random glyph is picked for every cell. -
MatrixParams -
MatrixTrailColorTrail colour: a singleMatrixColor, or an array of two or more colour stops forming a gradient along each drop's trail (first stop at the head, last at the tail end). Stops are interpolated in OKLCH. -
ParticleExplodeParams -
ParticleParams -
PatternRefractionParams -
PixelateParams -
PixelSortDirection -
PixelSortKey -
PixelSortParams -
PixelStretchParams -
RainbowParams -
RefractionEdgeWrap -
RefractionPattern -
RgbaRGBA colour, each channel in [0, 1]. -
RgbGlitchParams -
RgbShiftParams -
ScanlineParams -
SinewaveParams -
SliceShiftParams -
TilePixelateParams -
TilePixelateShape -
TritoneParams -
VignetteParams -
VoronoiParams -
WarpParams -
WarpType
Variables
-
ASCII_PRESETSBuilt-in character ramps, ordered dark → light. Suited for light-on-dark output (more "ink" = brighter); flip withinvert: truefor dark-on-light. -
MATRIX_GLYPHSDefault glyph pool: half-width katakana (the look the film used) plus digits and a few symbols. Mirrored katakana isn't reproducible from a normal font, so these render upright.