Passes
Full-screen passes as inputs: pass runs your own WGSL into a texture (at a reduced resolution if you like), downsample makes a cheap low-resolution copy of a source, and directionalBlur smears a source along a direction.
import {directionalBlur, downsample, pass} from 'shaders/std'
Types
| Type | What it is |
|---|---|
DirectionalBlurInput | interface DirectionalBlurInput extends InputNode { readonly kind: 'directionalBlur' readonly source: InputSource readonly angle: ScalarArg readonly length: ScalarArg } |
DownsampleInput | interface DownsampleInput extends InputNode { readonly kind: 'downsample' readonly source: InputSource readonly scale: number } |
PassFormat | The formats a pass may write. |
PassInput | interface PassInput extends InputNode { readonly kind: 'pass' readonly body: string readonly scale: number readonly format: PassFormat } |
Words
- directionalBlurA source smeared along a direction:
anglein degrees (0 points right, 90 down),lengthin canvas pixels. 32 weighted taps along the streak, at half resolution. - downsampleA smaller copy of a source, box-filtered so it does not alias.
- passYour own WGSL, rendered into a texture every frame before the body runs, read by name:
clouds(uv).