GlslEffectOptions interface
Options of `glslEffect`: definition fields plus how uniforms are bound.
import type { GlslEffectOptions } from '@dioramajs/diorama/glsl'interface GlslEffectOptions<P extends ParamSpec> extends Partial<Omit<EffectDefinition<P>, 'setup' | 'params' | 'name' | 'media'>>Members
| Name | Type | Description |
|---|---|---|
readonly animate? | AnimatePolicy<P> | Defaults to the update's answer when it returns a boolean, else to what the effect reads: |
readonly bleed? | number | Extra px around the box for visibility, for copies displaced past it. Default 0. |
readonly burst? | boolean | Objects in |
readonly colorSpace? | 'srgb' | 'linear' | Overrides the shader's colour space. |
readonly functions? | { [name: string]: ShaderFunction } | Bodies for GLSL prototypes, written in TSL. |
readonly mode? | 'surface' | 'plane' |
|
readonly name? | string | Default: the shader's name. |
readonly on? | string | Selector of the elements this effect accepts. Others are skipped with a warning. |
readonly presence? | 'fade' | 'custom' | Page transitions. 'fade' (default) multiplies the copy's alpha by |
readonly quality? | QualitySpec<P> | How the effect gets cheaper on weaker GPUs. Read by the runtime and by the docs. |
readonly rebuild? | readonly (keyof P & string)[] | Params whose change re-runs setup. String and choice params always do. |
readonly reducedMotion? | 'static' | 'off' | 'static' (default) runs with motion inputs zeroed and time frozen. 'off' skips the effect. |
readonly textures? | { [uniform: string]: TextureSource } | Sources for |
readonly uniforms? | { [uniform: string]: Binding | (ctx: EffectContext<P>) => Node } | Binding overrides, keyed by GLSL uniform name. |
readonly when? | When | Media query the page must match or the instance is |
setup? | | Runs after the shader is bound. May return a per-frame update. |
Also exported from @dioramajs/glsl.
Defined in packages/glsl/src/runtime.ts.