Shader Node Manifest

A shader plugin's plugin.toml names the node, points at its shader, and lists its image inputs and parameters. Framewright reads it when it loads the plugin and refuses a manifest with a missing key, an unknown key, or a value of the wrong type, reporting which one.

The node #

The top level of the manifest describes the node:

KeyTypeRequiredMeaning
idStringYesThe node type's id, which projects save. It must contain a dot, as in example.tint.
versionWhole numberYesStarts at 1.
nameStringYesThe name in the node library and on the node.
categoryStringYesThe library group the node appears in, such as Filter.
shaderStringNoThe shader file, relative to the plugin folder. The default is shader.wgsl.
varies_with_timeBooleanNoWhether the output changes over time even with constant parameters. The default is false.
inputsArray of tablesNoThe node's image inputs, written as [[inputs]] tables.
paramsArray of tablesNoThe node's parameters, written as [[params]] tables.

Every node has one image output.

Keep version at 1. Framewright can't open a project saved with an older version of a plugin node, because a shader plugin has no way to convert the parameters such a project saved. A project saved with a newer version than the one installed keeps the node unchanged, and reports it as unavailable when rendering.

When varies_with_time is true, Framewright renders the node again at every frame instead of reusing one result while its inputs and parameters stay the same. The shader receives no time value, so set the key only when something the shader reads varies over time in a way Framewright can't see.

Inputs #

Each [[inputs]] table adds an image input, in order:

KeyTypeMeaning
idStringThe name the shader reads the input by, and the name projects save its connection under
nameStringThe label on the node's port

A node needs at least one input. Without an [[inputs]] table, it has one called image, labeled Image. The shader reads the first input as c, whatever its id, and every other input by its id.

Parameters #

Each [[params]] table adds a parameter. The inspector shows parameters in the order the manifest lists them:

KeyTypeRequiredMeaning
idStringYesThe name the shader reads the value by, and the name projects save it under
nameStringYesThe label in the inspector
typeStringYesOne of the parameter types in the table of types
defaultDepends on typeNoThe value of a new node
unitStringNoHow the value is shown, for float and vec2
rangeTwo numbersNoThe span the slider of a float covers
limitsTwo numbersNoThe values Framewright accepts for a float, vec2, or color, checked on each component
sectionStringNoThe inspector section the parameter appears in. Without one, it's in the section named after the node.
animatableBooleanNoWhether the value can change over time with keyframes
optionsArray of tablesFor choiceThe choices, each with an id and a name

A value outside range is still allowed, as long as it is within limits. A default outside limits makes the manifest invalid. Parameters are animatable by default, except choices.

Parameter types #

Each type takes its default in its own form:

TypedefaultWithout a defaultIn the shader
floatA number0f32
intA whole number0i32
booltrue or falsefalsebool
choiceThe id of one optionThe first optioni32, the position of the option picked, counting from 0
vec2Two numbers, [x, y][0, 0]vec2<f32>
colorThree or four numbers, [r, g, b] or [r, g, b, a], in linear Rec.709[0, 0, 0, 1]vec4<f32>, unpremultiplied, in the working color space

A choice parameter declares its options like this:

[[params]]
id = "mode"
name = "Mode"
type = "choice"
default = "screen"
options = [
  { id = "multiply", name = "Multiply" },
  { id = "screen", name = "Screen" },
]

The shader reads mode as 0 for Multiply and 1 for Screen. Projects save the option's id, so you can reorder or add options without changing what saved projects mean.

Units #

The unit key takes one of these values:

ValueShown as
none0.500, a plain number (the default)
pixels12.0 px
degrees45.0°
seconds1.500 s
decibels-6.0 dB
stops1.00 EV, stops of exposure
ratio1.500×
percent50.0%

Ids #

Input and parameter ids become names in the shader, so they follow these rules:

  • They use lowercase letters, digits, and underscores, and start with a letter.
  • They don't repeat each other: no parameter shares an id with an input or with another parameter.
  • They avoid the names Framewright declares around the shader: c, pos, frame, base, prm, params, src, dst, and main, any name made of e or ex followed by digits, and any name starting with fw_ or op_.
  • They avoid WGSL keywords and type names, such as let, fn, f32, and vec4.

Edit this page