# applyShader

function in `@dioramajs/diorama/glsl`

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

Adds a shader to the surface from a custom effect's setup. Call the result to remove it.

```ts
function applyShader<P extends ParamSpec>(
  ctx: EffectContext<P>,
  shader: GlslSource,
  options?: ApplyOptions,
): Off
```

| Parameter | Type | Description |
| --- | --- | --- |
| `ctx` | `EffectContext<P>` |  |
| `shader` | `GlslSource` |  |
| `options?` | `ApplyOptions` |  |

Also exported from `@dioramajs/glsl`.

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