Custom shader
Last updated
Custom shader is a Utility effect.
What it does
Section titled “What it does”Runs a program you write. Edit shader… opens a code editor, or
Load from file… reads a .wgsl file. The
program is one WGSL function, fn shade(uv: vec2<f32>) -> vec4<f32>.
Parameters the shader declares become ordinary rows in Effect controls, with sliders, keyframes and expressions like any built-in effect’s.
The effect also holds an inner node graph: double-click the effect — its box on the Graph panel or its heading in Effect controls, and it opens the way a precomp does. The panel draws three kinds of graph on the one canvas: a layer’s stack, this inner graph, and a node graph composition.
Parameters
Section titled “Parameters”| Parameter | Control | Range | Default | Unit |
|---|---|---|---|---|
| Second input | Layer | Any layer in the composition | None | - |
| Edit shader… | Button | - | - | - |
| Load from file… | Button | - | - | - |
| Mix | Slider | 0 to 100 | 100 | Per cent |
| Blend | Dropdown | Normal · Darken · Multiply · Colour burn · Linear burn · Darker colour · Add · Lighten · Screen · Colour dodge · Lighter colour · Overlay · Soft light · Hard light · Linear light · Vivid light · Pin light · Hard mix · Difference · Exclusion · Subtract · Divide · Hue · Saturation · Colour · Luminosity | Normal | - |
| Matte | Layer | Any layer in the composition | None | - |
| Invert | Checkbox | On or off | Off | - |
| Channel | Dropdown | Luminance · Alpha · Red · Green · Blue | Luminance | - |
In the Effect Controls panel:
- Matte is an input to an effect, scaling the strength. Invert inverts the mattes for calculating strength.
What each control does
Section titled “What each control does”- Second input: one extra layer the shader can sample. A shader that needs three inputs is two shaders in a stack.
- Edit shader…: opens the code editor.
- Load from file…: reads the shader text from a file.
- Mix: how much of the result replaces the original.
- Matte and Invert drive the strength of the effect from another layer; see Effects.
Rows the shader declares appear below these, and are the shader’s own.