API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classBlurFilter

@codexo/exojs / rendering / stable

Gaussian blur Filter, run as two separable passes. The input is swept along X into a scratch target, then that scratch is swept along Y into the output, each sweep sampling a Gaussian kernel of strength standard deviations in ONE draw. Because the two sweeps are chained rather than summed, the effective 2D kernel is their product - a real isotropic blur that reaches diagonally as well as along the axes. (Summing the two sweeps into one target instead, which is what this filter used to do, produces a cross: a pixel diagonally off a corner is touched by neither sweep and stays black at any strength.) ```ts // The same blur as CSS `filter: blur(4px)`. subtree.filters = [new BlurFilter({ strength: 4 })]; ``` The kernel is truncated at three standard deviations, so the filter reaches `strength * 3` logical units outside its input on every edge and the tap count follows the strength without the caller choosing one. Runs on a ShaderFilter carrying both a GLSL and a WGSL source, so it works on either backend without the caller choosing one.

3
props
4
methods
0
events
Import
import { BlurFilter } from '@codexo/exojs'

Gaussian blur Filter, run as two separable passes.

The input is swept along X into a scratch target, then that scratch is swept along Y into the output, each sweep sampling a Gaussian kernel of strength standard deviations in ONE draw. Because the two sweeps are chained rather than summed, the effective 2D kernel is their product - a real isotropic blur that reaches diagonally as well as along the axes.

(Summing the two sweeps into one target instead, which is what this filter used to do, produces a cross: a pixel diagonally off a corner is touched by neither sweep and stays black at any strength.)

```ts // The same blur as CSS `filter: blur(4px)`. subtree.filters = [new BlurFilter({ strength: 4 })]; ```

The kernel is truncated at three standard deviations, so the filter reaches `strength * 3` logical units outside its input on every edge and the tap count follows the strength without the caller choosing one.

Runs on a ShaderFilter carrying both a GLSL and a WGSL source, so it works on either backend without the caller choosing one.

Constructors1
Methods4
Execute one filter pass: sample from input, write the result to output. Both textures are bounds × resolution texels - NOT the drawable's logical bounding box. Any parameter a subclass expresses in pixels (a blur radius, a displacement amount) is in LOGICAL units by convention and must be multiplied by resolution before it is used as a texel offset; otherwise the effect shrinks by 1/resolution on a HiDPI display. Parameters expressed as a fraction of the target (or as pure colour maths) need no adjustment. The engine always passes resolution. It is optional for the hand-rolled case - a post-processing chain that creates its own RenderTextures and calls apply directly - where the textures are whatever size the caller made them and 1 is the honest answer.
destroy(): void
Release any GPU-side resources held by this filter (uniform buffers, pipelines, intermediate textures). The base drops the attachment list; subclasses with GPU state (BlurFilter, ColorMatrixFilter) override and call super.destroy().
The blur reaches strength * 3 logical units outside its input on every edge - the point the kernel is truncated at, and therefore the furthest a value can travel along one sweep. Chaining the two sweeps means it can travel that far in BOTH, which is the corner of the box this rectangle already declares. quality redistributes the taps inside that reach and does not change it.
invalidate(): void
Tell every node this filter is attached to that its rendered output is out of date. Call it after mutating anything that changes what the filter draws or how far it reaches - the stock filters do this from their own setters. Without it a cached or retained representation of the owning node keeps replaying the result the filter produced before the change.
Properties3
resolution: TargetResolution
Resolution this filter's render targets are rasterized at, in device pixels per logical unit. 'inherit' (the default) matches the surface the result is composited into, so a filtered subtree stays as sharp as its surroundings on a HiDPI display. Lower it for a filter whose output is low-frequency anyway - a heavy blur at 0.5 costs a quarter of the fragments and is hard to tell apart. A filter CHAIN shares one target size, so the whole chain runs at the lowest resolution any of its filters asks for. ts const blur = new BlurFilter({ strength: 4 }); blur.resolution = 0.5; // half-resolution blur, quarter the fill cost
quality: number
Tap cap per side - see BlurFilterOptions.quality. 0 means derived.
strength: number
Gaussian standard deviation in LOGICAL units. Independent of the display: the filter scales it into target texels itself, so a strength of 8 covers the same on-screen distance at every Filter.resolution and every device pixel ratio.
Source