# shaderNode

function in `@dioramajs/diorama/glsl`

```ts
import { shaderNode } from '@dioramajs/diorama/glsl'
```

The fragment shader as a vec4 node for a custom material. The element's image is
`texture(map, coverUV(uv))` times the box mask.

```ts
function shaderNode<P extends ParamSpec>(
  ctx: EffectContext<P>,
  shader: GlslShader,
  options?: ApplyOptions & { readonly uv?: Node<'vec2'> },
): Node<'vec4'>
```

| Parameter | Type | Description |
| --- | --- | --- |
| `ctx` | `EffectContext<P>` |  |
| `shader` | `GlslShader` |  |
| `options?` | `ApplyOptions & { readonly uv?: Node<'vec2'> }` |  |

Throws `EFFECT_SETUP` when a shader uniform is bound to a missing param.

Also exported from `@dioramajs/glsl`.

Defined in [packages/glsl/src/runtime.ts](https://github.com/MasterKurosava/diorama/blob/main/packages/glsl/src/runtime.ts#L789).
