Shaders

Vertex shaders

A vertex shader beside a fragment shader: how the two are paired, shown, edited and shared.

An ISF shader can have a vertex shader next to its fragment shader. ISF Studio calls it the vertex companion of the shader: the two are one shader, shown as one, and they travel together.

Not every ISF software takes a vertex shader into account: the documentation of Resolume Wire says that Wire (version 7.22) does not read them. If an effect that uses one behaves differently in your software, try it without, and note where it works with Tested in.

How a vertex shader is paired

A .vs file is the companion of a .fs file when both are in the same folder and have the same name without the extension, case aside: wave.fs and wave.vs.

The vertex shader has no ISF header of its own. The header is the one of the fragment shader, and the inspector keeps showing it whichever source is in front.

In the explorer

  • A .vs has no row of its own: the fragment shader that owns it carries a vertex badge on its right.
  • Click the badge to unfold two rows, the fragment source and the vertex source. Each one opens the shader on that source.
  • A .vs that has no .fs of the same name stays listed on its own, with a warning: Vertex shader without a fragment shader of the same name. Rename one of the two files to pair them.
  • A .istshader bundle shows an archive badge instead. Unfolding it lists what the archive holds: the fragment shader, the vertex shader if there is one, and the images. The sources open on their tab, the images are only listed.

In the editor

  • The switch at the bottom of the editor, FRAGMENT and VERTEX, appears only for a shader that has a vertex shader. Without one, there is nothing to switch to.
  • The vertex source has no header, so there is no header to fold while it is in front.
  • The preview plays both sources together. A compile error of either one appears in the console with its line, and an ISF 1 name in the vertex shader comes with the same fix as in the fragment one (see ISF 1 shaders).

Adding and removing

  • Add Vertex Shader creates name.vs beside the .fs with the default vertex shader, and opens the shader on it.
  • Remove Vertex Shader sends the .vs to the Trash. The shader shows its fragment source again.

Both are in the context menu of the shader. The Edit menu has one item for the two: it reads Add Vertex Shader or Remove Vertex Shader depending on whether the shader has one, and is greyed out when there is no fragment shader to act on (the shader in front, or the one selected in the explorer).

  • In a .istshader bundle, the vertex shader lives in the archive: adding or removing it takes effect when the bundle is saved.

Moving, copying and sharing

The .vs follows its .fs: when the fragment shader is renamed, moved, copied, deleted or exported, the vertex shader goes with it, and its open tab follows. A .istshader holds both sources and the images in one file (see Sharing). A pipeline that has a vertex graph compiles to a vertex shader as well, kept inside its .istpipe.