Shaders

Input controls

Drive the inputs of a shader while it runs.

Right of the code, a panel holds one control for each input of the shader. Show or hide it with the button at the bottom right of the editor.

Input typeControl
floatA slider, and the value.
longA choice of labelled options declared in VALUES and LABELS.
boolA checkbox.
colorA colour picker.
point2DTwo values.
imageA choice of source: a file of the library, a built-in image or video, a camera.
eventA button that fires once.

The edge of each control is coloured by type, the same colour the inspector uses.

Default, Min, Max and Identity

Click an input in the inspector to configure it. A float has a number for each of Default, Min, Max and Identity. A point2D has two (x, y) and a color four (r, g, b, a, each from 0 to 1, with a swatch to see it). Tick a key to write it in the header: a key that is off is not written. A key you switch on starts from a value (a point at the origin, an opaque white), and a field that is not a number is refused with a message.

Configure integer options

In the input configuration dialog, a long input has an Options list. Add or remove options and edit their labels, then choose Default and Identity from the same labelled choices. Existing integer values are preserved when labels change; removing the selected option chooses the first remaining option, or clears the optional property when none remain. A long without options can still declare an integer default or identity.

Bind an input

Right-click an input and choose Bind to to let a source drive it. The menu lists what can drive that input: the mouse, a pen or a finger (try them in the Pointer view of the Resources activity), a MIDI device (see the MIDI view) and an OSC address (see the OSC view). An input that nothing can drive (an image, an audio) has no menu, and an input follows one source at a time. A point2D and a color are bound piece by piece (see below).

Drag across the preview and the bound inputs follow:

  • A point2D follows the pointer in one click: Position gives it in the pixels of the picture, Position 0–1 between 0 and 1. It does not need the dialog below.
  • A float or a long follows a channel you pick in the submenu: Position X, Position Y, Pressure, Tilt X, Tilt Y or Twist. A float takes a value between its MIN and MAX; a long takes the option that matches where the channel is between 0 and 1.
  • A bool is on while the button is down, and an event fires once when it goes down.

MIDI

The whole story of the devices, of learning and of what a control does to each type of input is in MIDI. In short:

Choose MIDI · Learn… and move a control of your device (a knob, a fader, a button) or play a note: the input takes the first one that comes, from the device that sent it. While it waits, the input is outlined in amber and says Move a control…; press Escape, or Stop learning in the menu, to give up. A float follows the control between its MIN and MAX, a long picks the option at that place, a bool is on from the half of a control or while a note is held, and an event fires when a control reaches the half or a note is played. The bindings follow the shader that is in the preview.

A bound input shows what it follows under its control, and its own control is locked. Right-click it again and choose Unbind to free it. The bindings are kept: they are written in the hidden .isf-studio folder of your library, beside the presets, and are there at the next launch. They follow the shader when you rename or move it, are copied with it and go to the trash with it. They are also part of the presets.

They travel with the shader, as its stars and its presets do: they are put in a .istshader you export, and in the .istpipe file of a pipeline. Whoever opens it finds the inputs bound as you left them. A MIDI control is the one of your device: they have to learn it again for theirs (right-click the input, Bind to, MIDI · Learn…).

OSC

Choose OSC · Learn… and move a control in the application that sends OSC (a fader, a pad, a button): the input takes the address of the first message that moves. It works as MIDI does, and the server turns itself on if it was off. A number is brought to the range of the input (MIN to MAX for a float), a bool is on while a flag is true, an event fires when it comes on. A point2D can follow one address that sends two numbers, such as an XY pad. The numbers are expected between 0 and 1; set the range of the sender (0 to 127, for instance) in the dialog below. See OSC for all of it.

The pieces of a point and of a colour

A point2D has two pieces, X and Y, and a color four, R, G, B and A. Each piece is bound on its own, to the mouse, to its own MIDI control or to its own OSC address (X to one knob, Y to another): right-click the input, and each piece has a submenu of its own, or use the dialog below. A piece is a number between the MIN and MAX that the header gives it (0 to 1 when it gives none), and the other pieces keep their value. A point can also follow the pointer as a whole (Position, from the right-click menu, no dialog needed); that and its pieces exclude each other.

A button for each item of a list

A list (long) can be bound as a whole, and also item by item: right-click it, Buttons for the items, and each item has a submenu to bind it to a MIDI note or control or to an OSC address, which gives the list that item when it is played. See A button for each item of a list. The presets can be bound the same way: see Bind a preset.

The dialog of the interactions

View > Input Interactions… (Shift+Cmd+K), Interactions… in the right-click menu of an input, or Bindings in the header of the input controls (with the number of bindings) opens a dialog that lists what the inputs of the shader in front are bound to, and nothing else: the input or the piece of it, its source (the mouse, MIDI), the control (Pressure, CC 74 · ch 1, with a dot that lights when it moves) and the device. Unbind frees one, Unbind all frees them all.

To add a binding there, choose the input in the first list (a point has Position, X and Y, a colour R, G, B and A), then what drives it in the second, and press Add. A MIDI · Learn… binding waits for a control: move it, or press Escape to stop. A control that has just been learned says so for a moment, and learning stops by itself: one control, one binding. When the list is long, a search box appears.

Resetting the inputs also frees them.

Save as defaults, Reset

What you tried is not saved in the file until you say so. Save as defaults writes the current values as the DEFAULT of each input (one undoable step). Reset brings the controls back to the preset you selected, or to the defaults when none is selected (the Defaults entry of the presets). The sources you chose (images, videos, sounds) and the bindings (mouse, MIDI, OSC) stay: Reset gives the values back, not what drives them.

Moving a slider changes nothing in the files.

Presets

To keep the state of the controls and come back to it later, use the presets at the bottom left of the panel: see Presets.