SpriteGrid

Developer documentation

The manifest

manifest.json sits at the top of the plugin's zip. Field names are camelCase. Anything the manifest doesn't know is ignored, so "$schema" is fine.

idstringrequired

The effect's id, different from every other effect's. Lowercase words joined by dashes ("drop-shadow") by convention. Documents store it, so an effect whose id changes disappears from the documents that used it.

namestring

The name the Add Effect menu and the effect's header show. Leave it out to show the id.

authorstring

Who made the effect. Not shown in the app yet.

versionstring

The effect's version, like "1.0". Not shown in the app yet. SpriteGrid rewrites its own built-in effects when their version changes, so copy one under a new file name and id before changing it.

descriptionstring

What the effect does, in a sentence. AI assistants read it (the list_effects tool); the app doesn't show it yet.

categorystring

The Add Effect menu's submenu for the effect, like "Stylize" or "Color". Effects without one go in "Other". With only one category in use, the menu lists the effects without submenus.

parameterslist of parameters

The effect's settings, in the order the Effects panel shows them. Leave it out for none.

passeslist of passes

The shader passes, run in order. The first pass reads the layer; each pass after it reads the one before. The last pass's output is the effect's. An effect without passes does nothing.

compositeModestring

How the effect's output joins the layer (one of composite modes). "replace", the default, makes it the layer's new look, and the next effect works on it. "behind" draws it behind the layer, for shadows and glows, and the next effect works on the layer as it was before this one. Anything else acts as "replace".

tilingtrue or false

Not used yet. Whether effects wrap around a layer's edges is the layer's own choice: Tileable (Wrap Edges) in the Effects panel's ≡ menu.

Parameters#

Each entry of parameters is one setting.

idstringrequired

The setting's id, different from the effect's other settings. A pass's uniforms use it as "$id". Documents store values by it, so changing it resets the setting in documents that set it.

namestring

The label the Effects panel shows. Leave it out to show the id.

typestringrequired

What kind of value it is: "int", "float", "bool", "color", "vec2", "enum", "gradient" or "palette" (see setting types, which also says what each becomes in a shader). Case doesn't matter.

defaultany

The value a new effect starts with. A number for "int" and "float"; true or false for "bool"; "#RRGGBB" or "#RRGGBBAA" for "color"; [x, y] for "vec2"; an option's name or index for "enum"; for "gradient", { "colorStops": [{ "position": 0, "color": "#000000", "midpoint": 0.5 }, ...], "opacityStops": [{ "position": 0, "opacity": 255 }, ...] }. Leave it out for 0, false, white, [0, 0], the first option, or black to white. A palette always starts as black and white.

minnumber

The smallest value the panel's number fields allow ("int", "float" and "vec2"). Leave it out for 0.

maxnumber

The largest value the panel's number fields allow ("int", "float" and "vec2"). Leave it out for 1 ("float") or 100 ("int", "vec2").

uistring

Not used yet: the panel picks the editor from type.

optionslist of strings

An "enum" setting's choices, in order. The dropdown shows them; shaders get the chosen one's index, from 0.

Passes#

Each entry of passes is one shader pass.

shaderstringrequired

The fragment shader's file name in the .sgfx zip. GLSL ES 3.00 (#version 300 es); a shader written as #version 330 core is changed to that when it loads. Besides its own uniforms, every pass is given the layer, its size and each pixel's position (the shader inputs, in the docs).

uniformsobject

Values for the shader's own uniforms, by uniform name. "$id" gives a setting's value (see setting types for its GLSL type). Or give a value that never changes: a number (an int if it's whole, else a float), [x, y] (a vec2), [r, g, b, a] (a vec4), or true/false (an int, 1 or 0). A "$id" that names no setting stops the effect loading.

compositeModestring

Not used yet: only the effect's own compositeMode is.

For your editor#

Point the manifest at its JSON Schema, and editors that read schemas (VS Code does) complete the fields and flag mistakes:

manifest.json
{
  "$schema": "https://spritegrid.com/schemas/sgfx-manifest.schema.json",
  "id": "burn"
}