shaderNode function
The fragment shader as a vec4 node for a custom material.
import { shaderNode } from '@dioramajs/diorama/glsl'The element's image is texture(map, coverUV(uv)) times the box mask.
function shaderNode<P extends ParamSpec>(
ctx: EffectContext<P>,
shader: GlslShader,
options?: ApplyOptions & { readonly uv?: Node<'vec2'> },
): Node<'vec4'>Parameters
| Name | Type | Description |
|---|---|---|
ctx | EffectContext<P> | |
shader | GlslShader | |
options? | ApplyOptions & { readonly uv?: Node<'vec2'> } | Default |
- Throws
EFFECT_SETUPwhen a shader uniform is bound to a missing param.
Also exported from @dioramajs/glsl.
Defined in packages/glsl/src/runtime.ts.