Skip to content

Custom shader

Last updated

Custom shader is a Utility effect.

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.

ParameterControlRangeDefaultUnit
Second inputLayerAny layer in the compositionNone-
Edit shader…Button---
Load from file…Button---
MixSlider0 to 100100Per cent
BlendDropdownNormal · 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 · LuminosityNormal-
MatteLayerAny layer in the compositionNone-
InvertCheckboxOn or offOff-
ChannelDropdownLuminance · Alpha · Red · Green · BlueLuminance-

In the Effect Controls panel:

  • Matte is an input to an effect, scaling the strength. Invert inverts the mattes for calculating strength.
  • 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.