API
blotter.ts/materials
Five subclasses of Material, each constructed with no arguments. Their uniforms are listed here from the running code; the materials pages explain what each one does.
On this page
import {
ChannelSplitMaterial,
FliesMaterial,
LiquidDistortMaterial,
RollingDistortMaterial,
SlidingDoorMaterial,
} from "blotter.ts/materials"; ChannelSplitMaterial class · extends Material
Lets the red, green and blue channels drift apart along an angle, with an optional motion blur. Live demo and uniform notes.
new ChannelSplitMaterial()
| Uniform | Type | Default |
|---|---|---|
uOffset | "1f" | 0.05 |
uRotation | "1f" | 45 |
uApplyBlur | "1f" | 1 |
uAnimateNoise | "1f" | 1 |
FliesMaterial class · extends Material
Redraws the text as a swarm of points that can dodge a position you feed it. Live demo and uniform notes.
new FliesMaterial()
| Uniform | Type | Default |
|---|---|---|
uPointCellWidth | "1f" | 0.04 |
uPointRadius | "1f" | 0.75 |
uDodge | "1f" | 0 |
uDodgePosition | "2f" | [0.5,0.5] |
uDodgeSpread | "1f" | 0.25 |
uSpeed | "1f" | 1 |
LiquidDistortMaterial class · extends Material
Bends the text through a slow field of noise, like tiles under water. Live demo and uniform notes.
new LiquidDistortMaterial()
| Uniform | Type | Default |
|---|---|---|
uSpeed | "1f" | 1 |
uVolatility | "1f" | 0.15 |
uSeed | "1f" | 0.1 |
RollingDistortMaterial class · extends Material
Rolls a wave across the text with finer noise underneath, like a failing television. Live demo and uniform notes.
new RollingDistortMaterial()
| Uniform | Type | Default |
|---|---|---|
uSineDistortSpread | "1f" | 0.05 |
uSineDistortCycleCount | "1f" | 2 |
uSineDistortAmplitude | "1f" | 0.25 |
uNoiseDistortVolatility | "1f" | 20 |
uNoiseDistortAmplitude | "1f" | 0.01 |
uDistortPosition | "2f" | [0.5,0.5] |
uRotation | "1f" | 170 |
uSpeed | "1f" | 0.08 |
SlidingDoorMaterial class · extends Material
Cuts the text into panes that slide out of their frames and back, one after another. Live demo and uniform notes.
new SlidingDoorMaterial()
| Uniform | Type | Default |
|---|---|---|
uDivisions | "1f" | 5 |
uDivisionWidth | "1f" | 0.25 |
uAnimateHorizontal | "1f" | 0 |
uFlipAnimationDirection | "1f" | 0 |
uSpeed | "1f" | 0.2 |