Developer documentation
When it goes wrong
SpriteGrid says what's wrong in the Effects panel, in red. There are two places it can go wrong.
It isn't in the + menu#
The file didn't load. The top of the Effects panel names the file and says why, and the message goes away when the file loads. The usual reasons:
- It isn't a zip. A
.sgfxfile is a zip renamed. Zip the files, then rename the zip. - The manifest is in a folder. Zipping a folder puts everything inside it. Zip the files themselves, so
manifest.jsonis at the top. - The manifest isn't valid JSON. The message says the line and position. A comma after the last item is the usual one.
- A field it needs is missing: the effect's
id, a parameter'sidortype, or a pass'sshader. - A shader the manifest names isn't in the zip, or its name is spelled differently.
- A uniform names a setting the effect doesn't have:
"$burn"needs a parameter with the idburn. - Another effect has its id. Each id belongs to one file. The one loaded first keeps it, and SpriteGrid's own effects load first.
It's in the menu, but it doesn't draw#
The shader didn't compile. The compiler's message shows under the effect's name in the Effects panel. Common causes:
- The first line must be
#version 300 es(or#version 330 core, which SpriteGrid changes to it), followed by aprecisionline. - The shader must write one
out vec4. - A uniform the manifest sets but the shader doesn't use is fine; a uniform the shader uses but nothing sets is zero.
Don't edit the built-in effects#
SpriteGrid writes its own effects into the same folder, and writes them again when it updates. To change one, copy it under a new file name and give it a new id.