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.
idstringrequiredThe 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.
namestringThe name the Add Effect menu and the effect's header show. Leave it out to show the id.
authorstringWho made the effect. Not shown in the app yet.
versionstringThe 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.
descriptionstringWhat the effect does, in a sentence. AI assistants read it (the list_effects tool); the app doesn't show it yet.
categorystringThe 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 parametersThe effect's settings, in the order the Effects panel shows them. Leave it out for none.
passeslist of passesThe 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.
compositeModestringHow 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 falseNot 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.
idstringrequiredThe 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.
namestringThe label the Effects panel shows. Leave it out to show the id.
typestringrequiredWhat 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.
defaultanyThe 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.
minnumberThe smallest value the panel's number fields allow ("int", "float" and "vec2"). Leave it out for 0.
maxnumberThe largest value the panel's number fields allow ("int", "float" and "vec2"). Leave it out for 1 ("float") or 100 ("int", "vec2").
optionslist of stringsAn "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.
shaderstringrequiredThe fragment shader's file name in the
.sgfxzip. GLSL ES 3.00 (#version 300 es); a shader written as#version 330 coreis 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).uniformsobjectValues 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.
compositeModestringNot used yet: only the effect's own
compositeModeis.
For your editor#
Point the manifest at its JSON Schema, and editors that read schemas (VS Code does) complete the fields and flag mistakes:
{
"$schema": "https://spritegrid.com/schemas/sgfx-manifest.schema.json",
"id": "burn"
}