GlslShader interface
Default export of a `?shader` import.
import type { GlslShader } from '@dioramajs/diorama/glsl'build needs nothing but three/tsl.
interface GlslShader<P extends ParamSpec = ParamSpec>Members
| Name | Type | Description |
|---|---|---|
readonly animate | 'hover' | 'input' | 'visible' | Frame policy of the effect. |
readonly animateFromPragma | boolean | Whether |
readonly bleed | number | Extra space around the box, CSS px. |
readonly colorSpace | 'srgb' | 'linear' | Colour space of its output. |
readonly dialect | 'three' | 'glsl3' | 'shadertoy' | GLSL flavour the source was written in. |
readonly externals | readonly string[] | Prototypes the caller provides through |
readonly file | string | Source file. |
readonly media | boolean | Whether it reads the element's image. |
readonly name | string | Effect name, from the file name or the pragma. |
readonly params | P | Params of the effect, from |
readonly presence? | 'fade' | 'custom' |
|
readonly reducedMotion? | 'static' | 'off' |
|
readonly segments | number | Plane segments per side, for position stages. |
readonly stage | 'uv' | 'color' | 'position' | What the shader changes: the UV, the colour or the vertex position. |
readonly textures | { [uniform: string]: string } | URLs from |
readonly uniforms | { [name: string]: UniformInfo } | Uniforms by GLSL name. |
readonly varyings | { [name: string]: GlslType } | Varyings this stage reads (fragment) or writes (vertex), besides uv. |
readonly when? | When |
|
readonly writes | readonly string[] | Varyings a vertex shader writes. |
build | | Runs on every material build. Returns vec2 for uv, vec4 for color, vec3 for position. |
Also exported from @dioramajs/glsl.
Defined in packages/glsl/src/types.ts.