Shaders

The ISF header

Read and edit the header of a shader with the inspector.

An ISF shader begins with a comment holding JSON: its description, its inputs, its passes. It can be written by hand, or edited with the inspector.

The sections

  • Info: facts about the file (including the weight of its vertex shader, if it has one), the softwares it was tested in, and a five-star rating.
  • Metadata: description, credit, categories, version, license and ISF version.
  • Inputs: the list of inputs; + adds one, each row opens its options.
  • Imported: the images the shader imports. + opens the gallery.
  • Passes: the passes of a multi-pass shader.

A section with nothing in it is folded and greyed. When there is only one, it opens by itself.

Tested in

The Info section also says where a shader or a pipeline was tried. This is for who will use it: a shader that works in ISF Studio may behave differently in another software.

  • Each software appears as a small label, with a cross to remove it. Add opens the list of softwares to choose from.
  • The list comes from Preferences > Softwares, section Tested in, where softwares are added and removed. When it is empty, the Add menu says so and points to the Preferences.
  • A shader or a pipeline can name up to 30 softwares.
  • It is a note of your own, kept with the library like the ratings, on your computer. It is not written in the file, neither in the header of a shader nor in a pipeline. It travels when you share the file as a .istshader, in a .istlib, or as a pipeline, which carries it in its own file: see Your notes travel. It follows the file when it is moved or renamed, and goes when the file is deleted.

What it edits

The inspector edits the header in memory, and the code follows. The change is one step in the history, and it is saved when you save. Nothing else in the file is touched.

When the header is wrong

Studio reads the header leniently and tells you what it finds, in the console:

  • invalid JSON (a trailing comma, for instance);
  • a misspelled key, or a key from an older ISF (PERSISTENT_BUFFERS, for instance);
  • a list that is not a list, or an entry that is not an object;
  • an input without a name, without a type, or with an unknown type;
  • an import that is not an object, whose path is missing, empty or of the wrong type, or whose file does not exist;
  • a redundant NAME on an import, or a cube map with six paths: these are warnings, as the shader works without them.

Keys that ISF does not define are kept, and marked, so Studio never deletes something it does not understand.

When the answer is obvious, the console offers a Fix button: see The console and fixes, which also explains how ISF 1 shaders are converted.

See the header reference for every key.