# ISF Studio: the complete docs Source: https://isf-studio.app. Generated from the docs, the node definitions and the snippets of the application. # What is ISF Studio URL: https://isf-studio.app/getting-started/introduction ISF Studio is a desktop application for people who make [ISF](https://isf.video) shaders, and for people who want to build them without writing all of the GLSL by hand. ![ISF Studio showing a shader, its preview and its controls](/screenshots/overview.png) ::note **ISF is not an ISF Studio format.** The Interactive Shader Format is an open format created by [VIDVOX](https://vidvox.net) (see [isf.video](https://isf.video)). ISF Studio is a separate tool that builds on it. A shader is a plain ISF file. A pipeline, a shared shader or a library is an open, documented archive (see [File formats](/reference/file-formats)) that holds the ISF shader and the images it needs, so what you make stays yours, readable with or without ISF Studio. A shader (`.fs`) works in whatever reads ISF; a pipeline or a bundle is read by ISF Studio, which exports the ISF shader from it. :: ## What it does - **Manages libraries.** A library is an ordinary folder on your disk. ISF Studio shows it, searches it, and renames, moves and deletes its files without breaking what depends on them. - **Edits shaders.** A code editor for ISF fragment and vertex shaders, a live preview, and a control for every input. The console reports what is wrong with a shader or its header, fixes what has an obvious answer, and converts ISF 1 shaders to ISF 2. - **Builds shaders without writing all the code.** Pipelines are node graphs: connect shaders, nodes and snippets, and ISF Studio writes the ISF for you. The generated code can always be read. - **Delivers.** A shader, a pipeline or a library is installed in the applications that read ISF, exported as a video (MP4, ProRes), shared as a single file, played on the web with a small [runtime](/runtime/playing-pipelines), or delivered as an [OpenFX plug-in](/library/openfx-plugins) for DaVinci Resolve, Natron and other OpenFX hosts. ## A typical workflow 1. **Organize.** Open a folder as a library, and bring your shaders and images into it. 2. **Create.** Write a shader, or build a pipeline from nodes and from the snippets of the [Toolbox](/pipelines/snippets-and-toolbox). 3. **Refine.** Adjust the inputs while the preview runs, with images, video, a camera or a microphone, and keep the settings you like as [presets](/shaders/presets). 4. **Deliver.** [Install](/library/installing-in-software) the effect in your ISF application, export a [video](/media/video-export), or export it as an [OpenFX plug-in](/library/openfx-plugins). ## Who it is for - **Shader developers**, who want a comfortable editor, an inspector for the header and a console that points at the line, with a library that stays organized. - **VJs and visual artists**, who prefer to connect nodes rather than write code, and play the result in the application they perform with. - **Editors, colorists and motion designers**, who want custom effects in DaVinci Resolve, Natron or another OpenFX host, without writing a plug-in. - **Anyone with a folder of shaders** that has grown hard to navigate. ## What it is not ISF Studio is for making shaders, **not a performance tool**. Its preview is meant to check the work, not to run a show. For performing, use the application you perform with. # Installation and first launch URL: https://isf-studio.app/getting-started/installation ## Download The installers are on the [Download page](/download). ## Install ISF Studio is a desktop application. Open the installer you downloaded and put it where applications go. There is no account, no sign-in and no cloud. It is a program that runs on your computer. ::note ISF Studio is developed and tested on macOS, Windows and Linux. If something does not work on your system, write to us from **Help > Contact Support**: tell us which system you use. :: ## Open a folder On first launch the window is empty: it asks you to **Open a folder to begin**, with an **Open Folder…** button. ![The empty window, with its Open Folder button](/screenshots/welcome.png) Click **Open Folder…**, or choose **File > Open Folder…** (`Cmd+O`), and pick the folder that holds your shaders, or an empty one to start fresh. That folder is your **library**. With a folder open and nothing in the tabs, the window offers **Create Shader** and **Create Pipeline**. - A library is just a folder. Studio does not copy it, index it elsewhere or lock it. You can still open it in the Finder, in a text editor, or in anything else. - One folder, one window. Open a second window for another folder (the free edition opens one window at a time). - Studio remembers, for each folder, what you had open: tabs, panel sizes, which folders were unfolded. Reopening it restores that state. - The **File** menu lists the libraries used recently, and the list can be cleared. ## Opening a file from the system `.istpipe`, `.istshader`, `.istlib`, `.istmacro` and `.istlicense` files are associated with ISF Studio. Double-click one: if it is inside a library that is already open it opens there, otherwise Studio opens a window for it. A `.istlib` opened from your file manager is **unpacked where it is**, into a new folder that takes its name (another name when that one is taken: nothing is overwritten), and that folder is what opens in a window of its own; the archive stays where it was (see [Sharing](/library/sharing#unpack)). A `.istmacro` installs its macros after a dialog (see [Macros](/pipelines/macros#share-macros)), and a `.istlicense` activates the license it holds. ## Files lifecycle Studio writes to a file only when you save (`Cmd+S`). Until then your changes are **drafts**. They survive a reload or a crash, and they are written only when you say so. See [Saving and drafts](/workspace/saving). # Your first shader URL: https://isf-studio.app/getting-started/first-shader Five minutes and one folder are enough. ## Create it Right-click a folder in the explorer, then **New… > Shader…**. Or choose **File > New > Shader** (`Cmd+N`): the shader is made in the selected folder. ![The New menu of the explorer](/screenshots/new-submenu.png){width=560} Studio asks which template to start from (see [Shader templates](/shaders/templates)). Pick **Generator** if unsure: it draws something straight away. Type a name, press `Enter`, and the shader opens in a tab. ## Look around Three things matter right now: - the **preview** at the top, where the shader runs; - the **code** below it, with the ISF header at the top and `main()` underneath; - the **controls** to the right of the code: one per input the shader declares. ![A shader open in the editor](/screenshots/overview.png) ## Change something Move a slider: the picture follows. Change a number in the code: the picture follows that too. Introduce an error on purpose: the **Console** (top left) tells you what and where, and sometimes offers a **Fix** button. See [The console](/shaders/console). ## Give it an input A shader with no inputs always draws the same picture. In the inspector on the right, open **Inputs** and press `+`, or write the input in the header by hand. It appears in the controls at once. When a value pleases you, **Save as defaults** keeps it. ## Complete Metadata In the inspector on the right, open **Metadata** and fill in the fields. This information helps you and others understand what the shader does and who made it. ## Save it `Cmd+S`. The tab's modified dot disappears. Closing a tab that has changes asks for confirmation first. # Your first pipeline URL: https://isf-studio.app/getting-started/first-pipeline A pipeline is a graph. People who were used to Quartz Composer will find it familiar. You place boxes (nodes), connect their ports with lines, and Studio turns the whole thing into an ISF shader. No GLSL needs to be written. ## Create it Right-click a folder, **New… > Pipeline…**, give it a name. An empty graph opens. **File > New > Pipeline** (`Cmd+P`) does the same in the selected folder. ## Add nodes Right-click the canvas: a menu with a search field opens, and under it the nodes in categories. ![The add-node menu](/screenshots/pipeline-addmenu.png){width=290} You can also **drag a shader or a pipeline from the explorer** onto the canvas. Its inputs become ports. Or drag a **snippet** from the [Toolbox](/pipelines/snippets-and-toolbox). ## Connect them Drag from a port to another one. A line appears if the two can understand each other; if not, nothing happens. ![A pipeline: an image, a colour and a float feed a mix](/screenshots/pipeline-editor.png) Create **inputs** (image, colour, float…) to expose parameters. They show up in the controls panel and in the ISF header like any shader input. ## Move nodes Drag a node, or select several nodes and drag them together. Positions are committed when you release the pointer, as one undoable move, including inside groups. Canvas updates while dragging keep the nodes at their current dragged positions. ## Read what it wrote Switch the bottom toggle from **PIPELINE** to **CODE**: the ISF the pipeline compiles to. ![The CODE view of a pipeline](/screenshots/pipeline-code.png) That is the shader an ISF-reading application will play. The pipeline is a way to build it: the compiled shader can be used on its own. ## Save it `Cmd+S`. The `.istpipe` holds your graph, the compiled shader, and the images you used. It is one file you can move, share or open in a [web page](/runtime/playing-pipelines). ## Export or install it Right-click your pipeline and choose **Export ZIP Archive**, which will include the **compiled shaders** along with any associated images. You can also choose to **install it** directly into your preferred softwares, if you defined their paths in the Preferences. # Interface tour URL: https://isf-studio.app/getting-started/interface-tour ![The window](/screenshots/overview.png) | Area | What it is for | | --- | --- | | **Title bar** | Three buttons at the right: show or hide the sidebar, the monitors (console and performance) and the inspector. | | **Activity bar** (far left) | **Explorer**, **Toolbox** and **Resources**. | | **Sidebar** | The view of the chosen activity. Under the explorer: **Gallery**, **History** and **Clipboard**, folded until you want them. | | **Tabs** | One per open document. A dot marks unsaved changes, a colour marks a problem. | | **Console and Performance** (top left) | What went wrong, and what it costs. | | **Preview** (top right) | The shader or pipeline, running. Play, pause, resolution, alpha, frame rate. | | **Editor** (bottom) | The code, or the node graph of a pipeline. | | **Input controls** (bottom right) | A control for every input. | | **Inspector** (right) | The ISF header: Info, Metadata, Inputs, Imported, Passes. | | **Status bar** (bottom) | At the left, how many shaders, shared shader bundles and pipelines the opened folder holds (each with its icon), and how many generators, filters and transitions (see [the explorer](/library/explorer#generators-filters-and-transitions)); at the right, the processor and memory ISF Studio is using (hover for the detail of each process), and whether you are online. | ## The three activities - **Explorer.** Your library. See [The explorer](/library/explorer). - **Toolbox.** Snippets of GLSL. Nodes when building a pipeline. See [Snippets and the Toolbox](/pipelines/snippets-and-toolbox). - **Resources.** Images and videos that come with Studio to test tour inputs, and your cameras and microphones. See [Resources](/media/resources). ## Making room Every panel can be hidden from the title bar or the **View** menu, and the divider between two panels can be dragged. **View > Appearance > Console and Preview** hides the preview and the console above the editor of a shader or a pipeline. Studio remembers the layout for each folder. ## Menus and shortcuts The commands are in the menus, with their shortcuts. A short list is in [Keyboard shortcuts](/workspace/shortcuts). # The explorer URL: https://isf-studio.app/library/explorer The explorer shows the folder you opened: the same folders, the same names, in the same places as on disk, with two exceptions. A shader and its vertex shader are one row: the `.vs` is shown through its `.fs` (see [Reading a row](#reading-a-row)). And the files can be [listed by kind](#generators-filters-and-transitions) instead of by folder, when you ask. Studio adds what it knows about the files it recognises. ![The explorer](/screenshots/explorer.png){width=236} Use the refresh button beside the folder name to reread the folder from disk. ## The files it handles There is a growing list of file types that Studio recognises. The list below may not be exhaustive. At the time of writing, it handles: - **Fragment shaders** (`.fs`) - **Vertex shaders** (`.vs`) - **Pipelines** (`.istpipe`) - **Markdown notes** (`.md`) - **Text files** (`.txt`): they open in a plain editor, with no preview - **Fonts** (`.ttf`, `.otf`): a double-click, or **Font Image…** in the context menu, makes the image of the font that shaders read: see [Font images](/shaders/font-images) - **Images** (`.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.bmp`, `.svg`) - **TIFF, OpenEXR and Photoshop images** (`.tif`, `.tiff`, `.exr`, `.psd`, `.psb`): the studio decodes them, so they open in the image viewer like the others. The preview can save snapshots in these formats: see [The preview](/shaders/preview#snapshot). How large pictures are handled is in [Videos and sounds](/media/videos-and-sounds#large-files) - **Videos** (`.mp4`, `.webm`, `.mov`, `.m4v`, `.ogv`) - **Sounds** (`.wav`, `.mp3`, `.ogg`, `.oga`, `.opus`, `.flac`, `.m4a`, `.aac`, `.weba`) - **Archives** (`.zip`) - **Shared shader bundles** (`.istshader`) - **Shared libraries** (`.istlib`) - **Macro packs** (`.istmacro`): a double-click installs the macros they hold, see [Macros](/pipelines/macros#share-macros) ## Creating files Right-click a folder, or the empty space, then **New…**, or use **File > New** in the main menu: **Shader** (`Cmd+N`), **Pipeline** (`Cmd+P`), **Markdown**, **Text File** and **Folder**. From the menu, the new file is made in the folder selected in the explorer, or at the root of the library when none is. The explorer opens if it was hidden. See [Organizing files](/library/organizing-files#create). ## Reading a row - A **badge** on a shader says it has a vertex shader, or imports images. Click the vertex badge to unfold both sources. A `.vs` is shown only through its `.fs`, unless it has none: then it is listed with a warning. - A **red** name means the file has a problem: an invalid `IMPORTED` declaration, or an error the console found. - An **amber** image is one that no shader and no note uses. It is not necessarily useless: it may be needed later. - **Shared shader bundles** (`.istshader`) also have a badge you can click on to see their contents. - **Shared libraries** (`.istlib`) can be unarchived to create a folder with their contents. - A row that looks faded is still being read. Studio reads files when you need them, so opening a very large folder is quick. ## Searching and filtering Two buttons beside the refresh button, at the top of the explorer: - **Search** (or `Cmd+F` with the explorer focused) opens a field above the list. Type a part of a **file name**: the list keeps the files that match, even approximately, and the folders that hold them. Clearing the field, or closing the search, brings the whole list back. - **Filter** keeps the files by **rating** (from a number of stars up, or only those nobody rated), by **category** (the categories written in the header of shaders and pipelines) and by **error** (only the files that have one). The filter shows as chips under the header, and each chip can be removed. The filter is remembered with the folder; what is typed in the search is not. A category or an error is known once a file has been read: Studio reads the files a few at a time, so a file appears in the list when its turn comes. ## Generators, filters and transitions The **tag** button of the header shows a row of buttons under it, which sorts the shaders, the pipelines and the shared shader bundles (`.istshader`) by what they do with images: **GEN** for the generators, **FX** for the filters, **TSN** for the transitions, with how many there are of each. Click one to keep only those files; click it again, or **ALL**, to see everything. The choice is kept with the folder and shows as a chip, like the other filters. The kind comes from the **inputs**, not from the categories, which are free text: - a shader with a `startImage` and an `endImage` is a **transition**; - a shader with an image to change (an `inputImage`, say) is a **filter**; - a shader with no image input is a **generator**. A pipeline follows the same rule with the image inputs of its graph, and a bundle carries the kind of its shader in its manifest. A pipeline or a bundle written before this existed has no kind until it is saved or exported again; until then its categories are used when one of them says `Generator`, `Filter` or `Transition`, and it is otherwise left out of the buttons (a bundle has no categories to fall back on). As with categories, a file counts once it has been read, a few at a time. The last button of the row lists the files **by kind instead of by folder**: one section for each kind, with the files of every folder in it, and the other files (pictures, notes, archives) in the last section. A section folds with a click. While the files are grouped the folders are not shown and nothing can be dropped to move a file; a new file is made in the folder of the row you selected. Click the button again to see the folders. Pressing the tag button of the header again closes the row, and takes the kind that was kept and the grouping with it. ## Keyboard basics | Key | Does | | --- | --- | | `Cmd+↓` | Open the selected file. | | `Enter` or `F2` | Rename. | | `Cmd+D` | Duplicate. | | `Cmd+C`, `Cmd+X`, `Cmd+V` | Copy, cut, paste. | | `Cmd+Backspace` | Move to the Trash. | | `Cmd+A` | Select everything visible. | | `Cmd+F` | Search the file names. | | Arrow keys | Move through the rows. | A shader keeps its vertex shader close: `a.vs` always carries the name of `a.fs`, and it travels, is copied, renamed and deleted with it. See [Vertex shaders](/shaders/vertex-shaders). A file whose tab has unsaved changes can be renamed or moved. See [Organizing files](/library/organizing-files#rename-move-duplicate). # Creating and organizing files URL: https://isf-studio.app/library/organizing-files ## Create Right-click a folder, or the empty space, then **New…**. The **File > New** menu does the same, and has a shortcut for two of them: `Cmd+N` for a shader, `Cmd+P` for a pipeline. The file is made in the folder selected in the explorer, or at the root when none is. ![New: Pipeline, Shader, Markdown, Text File, Folder](/screenshots/new-submenu.png){width=560} Type the name on the row itself and press `Enter`. You do not need to type the extension, and typing it does not double it. ## The context menu ![The context menu of a shader](/screenshots/context-shader.png){width=390} - **Add / Remove Vertex Shader**: creates or removes the `.vs` beside a `.fs`. - **Open**, **Show in Finder** (`Alt+Cmd+R`). - **To Shader…** (a pipeline): makes the shader the pipeline compiles to, beside it, with no dialog. See [Sharing](/library/sharing#export). - **Copy**, **Cut**, **Paste**. - **Export…**: see [Sharing](/library/sharing). - **Rename**, **Duplicate**, **Delete**. The context menu of the **empty space** (and of the name of the opened folder) is the one of a folder, for the library itself: **New…**, **Show in Finder**, **Paste**, **Import…** and **Export as…** (the whole library, as a `.istlib` or a ZIP). There is nothing to copy, cut, rename, duplicate or delete there. ## Rename, move, duplicate These operations keep everything that depends on a file consistent. A shader's `.vs` follows it, and so do its open tabs. Documents write the paths of their images relative to themselves: when you move or rename a document, or an image one depends on, Studio writes those paths again (in shaders, notes and pipelines) so they keep pointing at the same image. If one cannot be written, the console says which; the move itself is done. A document does not have to be saved first, nor the documents that use an image you move. Their unsaved changes stay unsaved: they follow the file to its new name or folder, with the paths of their images written again, and the file on disk is rewritten the same way. What changes is the undo history of those documents, which starts again after the move. To move a file or a folder out of its folder, drop it on the name of the opened folder at the top of the explorer, on a file at the root, or on the empty space under the list. ## Copy and paste Copy, cut and paste work inside the library and with the Finder: drop files from the Finder onto the explorer, or paste them, and they are copied in. From the Finder, nothing is overwritten: a name already taken becomes "name copy". The other way works too: **Copy** in the explorer also puts the files on the system clipboard, so you can paste them in the Finder, in another folder, a mail or another library. A shader brings its `.vs` with it, and a folder goes whole. Pasting in the explorer itself is unchanged: it still reads what you copied in Studio. **Cut** stays inside Studio: pasted in the Finder it would copy, and leave the original where it is. This was tried with the Finder on macOS; the file managers of Windows and Linux have not been tried yet. A single file can also be dragged out of the explorer onto the Finder or the desktop: a copy lands where it is dropped. This takes one file at a time (a selection or a folder does not leave this way, and a shader leaves without its `.vs`: use Copy and paste), and it is checked on macOS only. An application that takes files but does not read that drag (the media bin of VDMX, for instance) needs a real file: hold **Option (⌥)** while you start the drag. The file then leaves as the Finder would give it. This drag belongs to the system: it is not taken by the explorer, the canvas of a pipeline or the viewers of Studio, so use it only to go out. It is tried on macOS only. When files come the other way and the sidebar shows another activity, hold them over the Explorer icon of the activities bar: it opens, and you can drop them in. ## Between two windows Each window has its own library, and a copy in one can be pasted in the other: select the pipelines or shaders, **Copy**, then **Paste** in the other window. Dragging them from one window to the other copies them too (it never moves what has the same name in the other library). The images a pipeline or a shader imports come with it, and the same goes for a paste from the Finder. An image beside the document, or below it, keeps its place relative to it. One that sits elsewhere (`../Images/a.png`) is put in an `images/` folder next to the copy, and the pipeline or shader is changed to say so. You can rename or move that folder afterwards: the pipelines follow. An image the folder already has and that is the same is not copied again. If it differs, Studio asks once: **Keep both** (the new one is named "name copy"), **Replace**, **Keep the existing ones** or **Cancel**, which pastes none of that document. Inside the library, pasting (or moving by cut and paste or by drag) a file onto a name the folder already has asks what to do. **Replace** puts the file in the way in the Trash and takes its place, **Keep both** (copies only) names the new one "name copy", and **Cancel** changes nothing. A `.vs` is replaced along with its `.fs`. Pasting beside the original is a duplicate, not a conflict. ## Delete Delete sends the file, or the folder and everything in it, to the Trash after asking. The tabs of what disappears are closed and their **drafts forgotten**. ## Show in Finder **File > Show in Finder** (`Alt+Cmd+R`), or the context menu, reveals the selected file. ## Ratings The **Info** section of the inspector has a row of five stars. Rate your shaders; Studio remembers it for the library. The rating lives in Studio's own state, not in your files. It goes with a shader, a pipeline or a library when you share them as a `.istshader`, a `.istpipe` or a `.istlib`: see [Your notes travel](/library/sharing#your-notes-travel). ## Tests The **Info** section of the inspector has a selector where you can add a software where you tested the shader. This allows you to keep track of which software environments you have used for testing, making it easier to reproduce or continue your work later. This lives in Studio's own state, not in your files. # Images and the gallery URL: https://isf-studio.app/library/images-and-gallery Images live in the library like everything else. Open one and it opens in a viewer, where you can pan and zoom. PNG, JPEG, GIF, WebP, BMP and SVG are read by the viewer as they are; **TIFF, OpenEXR and Photoshop** files (`.tif`, `.tiff`, `.exr`, `.psd`, `.psb`) are decoded by the studio first, so the viewer shows them as well, for a screen. The **Create shader** and **Create pipeline** buttons are for the first kind. ![The image viewer](/screenshots/image-viewer.png) ## The gallery Under the explorer, the **Gallery** shows thumbnails of the images of the open document first, then the others. Its header counts them: `N images`, `N used`, and, in amber, `N unused`. ![The gallery](/screenshots/gallery.png){width=236} Videos and sounds of the folder are listed below the images, under **Videos** and **Sounds**: see [Videos and sounds](/media/videos-and-sounds). They are not imported by shaders, so they are never counted as unused. ## Where an image is used An image counts as **used** when a shader imports it or a note displays it, unsaved changes included. Select an image and its info says **Used in N files**; open the list and click one to go there. ## Putting an image in a shader - In the image viewer, **Create shader** and **Create pipeline** at the centre of the toolbar make a new document next to the image that already shows it. The shader imports the image by its file name; the pipeline holds a copy of it. The new file opens at once. - In the inspector, open **Imported**, press `+` and choose it from the gallery. - In a note, drop it into the text: Studio writes the Markdown link with a relative path. - In a pipeline, drop it on the canvas: it is copied into the `.istpipe`, so the pipeline keeps working if the original goes away. # Sharing: pipelines, bundles and libraries URL: https://isf-studio.app/library/sharing Sharing a shader should not require a list of the images and the vertex shader to send along with it. ISF Studio has three archive formats, so that one thing is one file. | Format | Holds | Made from | | --- | --- | --- | | `.istshader` | One shader, its vertex shader and its images. | A `.fs` (and its `.vs`). | | `.istpipe` | A pipeline: the graph, the shader it compiles to, its images. | A pipeline. It is already one file. | | `.istlib` | A folder, or a whole library: folders, shaders, pipelines, images, notes. | A folder or the library. | All three are ordinary zip archives with a manifest, and can be opened with any zip tool. They carry a format version, and ISF Studio reports it when a file comes from a newer version than the one installed. ## Export Right-click a file or a folder in the explorer: ![Export in the context menu](/screenshots/context-shader.png){width=390} - A shader: **Export as…**, then **Shader Bundle (.istshader)**, or **ZIP Archive** for the plain files (`.fs`, `.vs`, and the images under `imported/`). - A shader, a pipeline or a `.istshader`: **Export as…**, then **To Folder…** puts it in a folder you choose in the system dialog, in a folder of its name, with the images beside the shader (what a software such as Millumin looks for). To put it where a given software reads its shaders, see [Installing in a software](/library/installing-in-software). - A pipeline: **To Shader…**, in the context menu under **Show in Finder**, makes the shader it compiles to (`.fs`, and `.vs` when it has a vertex graph) beside the pipeline, in the library, with no dialog. A name already taken is not overwritten: the file is called `Glow 2.fs`, `Glow 3.fs`… The images are not copied: the shader keeps naming them as the pipeline does. - A pipeline, a `.istshader` or a `.istlib`: **Export ZIP Archive**, for the places that accept a zip and nothing else. The document travels whole inside it. - A folder: **Export as…**, then **Library** (`.istlib`) or **ZIP Archive** (the folder as it is, files and sub-folders). - Several rows selected (files and folders): right-click one of them, **Export N Items as…**, then **Library** (`.istlib`) or **ZIP Archive**. A shader's vertex shader goes with it, and so do the images it needs. The file is named after the folder the items come from when they share one (`looks.istlib`), otherwise after the opened folder and the number of items (`My Library (3 items).istlib`). - Several rows selected (files and folders): right-click one of them, **Export N Items as…**, then **Library** (`.istlib`) or **ZIP Archive**. A shader's vertex shader goes with it, and so do the images it needs. The file is named after the opened folder and the number of items, like `My Library (3 items).istlib`. - The whole library: **File > Export Library (.istlib)…** or **File > Export Library as ZIP…** A **Library** (`.istlib`) also packs every other file of what you export: fonts, videos, sounds, text files, anything. They come back as they are, in their folders, when the library is unpacked. The **presets** and what the inputs are **bound to** (MIDI, OSC, mouse) travel with the shaders and pipelines of a library, as they do with a `.istshader` or a `.istpipe`, and come back when it is unpacked. A plain **ZIP** is the folder as it is: it holds none of them. Studio asks where to save, and nothing else. A file too big to be read whole is left out of the archive, and ISF Studio reports it instead of writing a partial file. ## Bring files in Drag them from the Finder into the explorer, or paste them. Studio copies them into the folder, and never over something that already exists. To take a file out, copy it in the explorer and paste it in the Finder: see [Copy and paste](/library/organizing-files#copy-and-paste). ## Unpack An archive in your library can be unpacked from its context menu: - a `.istshader` is unpacked beside itself: the `.fs`, the `.vs` and an `imported/` folder with its images; - a `.istlib` is unpacked into a new folder named after it. Double-clicked in your file manager, it is unpacked next to itself in the same way and the new folder opens in a window. - a plain `.zip` is unpacked into a new folder named after it. Double-click it: a dialog lists what it holds (files, folders, sizes) before anything is written, and **Unpack** (or `Enter`) goes on. System files such as `__MACOSX` and `.DS_Store`, and paths that would leave the folder, are left out. A `.istmacro` (a pack of macros) is not unpacked: it is **installed**. Double-click it, and a dialog lists the macros that come in and asks about the ones you already have. The macros go to the Toolbox, not to your library: see [Share macros](/pipelines/macros#share-macros). The archive stays where it is, and nothing is overwritten: names that are taken are renamed. If the pipelines of a library name the shaders of that library, they are reconnected to the files that were unpacked. An archive that cannot be read gives a short explanation in Studio's own dialog. ## A pipeline as text A pipeline can also travel as plain text, with no file: in a message, an issue, a forum post or a web page. Open it, click **View pipeline as text** in its toolbar and copy the text. Whoever receives it copies it and chooses **File > Import > Pipeline from Clipboard**: ISF Studio builds the graph, lays it out and opens it. The shaders, pipelines and images of your library are named by their path, so the receiver needs the same files in their library. To send a pipeline with its shaders and images, use a `.istpipe`. The same text is what an AI assistant reads and writes. See [Pipeline text](/reference/pipeline-text). It is a Pro feature, trial included. ## Your notes travel The stars you gave a file and the softwares you noted it was **tested in** are your own notes. They are not written in a shader, and they go with what you share: - **A shader** shared as a `.istshader` carries them in the archive. - **A folder or the library** shared as a `.istlib` carries the notes of every file in it. - **A pipeline** is an archive already: its notes are written into the `.istpipe` itself as soon as you change them. Copying the file, sending it or putting it in another library takes them along. Changing a rating therefore rewrites the file, and its modification date changes. When the notes of someone else reach your library (a `.istshader` or a `.istlib` is unpacked, or a `.istpipe` with notes is first seen): - **The stars** are given to a file that has none. The stars someone already gave a file are theirs and stay. - **The softwares** are added to those the file has, without doubles. What does not carry notes: a ZIP archive, and a `.fs` copied on its own, because a plain shader has nowhere to keep them without changing its header. Versions of ISF Studio before the notes ignore them, and keep them when they rewrite the archive. ## For other applications To put a document where another application reads its shaders, without exporting anything, see [Installing in other software](/library/installing-in-software). A pipeline compiles to a plain ISF shader, which is what an application that reads ISF plays. An application does not open the `.istpipe` itself: **Install** gives it the compiled shader and its images. The `.istpipe` keeps that shader inside, so it can also be unzipped by hand, and a [small runtime](/runtime/playing-pipelines) plays it in a web page. ## For video applications To use an effect on the timeline of DaVinci Resolve, Natron or another OpenFX host, export it as an [OpenFX plug-in](/library/openfx-plugins). # Installing in other software URL: https://isf-studio.app/library/installing-in-software Many applications read ISF shaders from a folder of their own. **Install** puts a document of your library there, laid out the way that application likes, so there is nothing to copy by hand. ## What is installed Install copies, it never moves: the document stays in your library. | Document | What the software is given | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | A shader (`.fs`) | The shader, its vertex shader if it has one (see [Vertex shaders](/shaders/vertex-shaders)), and the images it names. | | A `.istshader` bundle | Its shader, its vertex shader and its images. | | A pipeline (`.istpipe`) | The ISF shader the pipeline compiles to, its vertex shader if it has one, and its images. A pipeline that has never been saved has no compiled shader yet: open it and save it once. | Nothing else of the folder is installed. If the shader names an image that ISF Studio cannot find, the shader is installed anyway and the notification lists the missing image. ## Set up a software Open **Preferences > Softwares**, section **Install in**. 1. Add the software by its name. 2. Add the folder it reads shaders from, written as your system writes it, for example `~/Library/Application Support/Millumin/Shaders` on a Mac or `%APPDATA%\Millumin\Shaders` on Windows. A software can have several folders. 3. Under each folder, ISF Studio shows the place it stands for on this computer, or a warning when the folder does not exist or cannot be used. Two choices say how the software likes its files: - **A folder for each document**, on by default: everything goes in a folder named after the document, instead of loose among the other shaders. - **Images**: **In an imported/ folder** (the default, as an archive holds them), **Beside the shader** (the paths in the shader are rewritten to match), or **Not installed**, when the software already has them or does not need them. ## Install Right-click a shader, a pipeline or a bundle in the explorer and choose **Install in…**, then the software. The **File > Install** menu does the same for the document in front. A software with several folders lists each of them. The system dialog opens at the first folder of the software that exists, or at what is left of it, with a note, when none does. Go where you want and press OK. If files of the same name are already there, ISF Studio asks before replacing them: nothing is replaced without your agreement. A notification says where the document was installed. When no software is set up, the menu reads **No software: add one in the Preferences**. ## Not every software reads every shader ISF is an open format, and each application reads it in its own way. A shader that runs in ISF Studio may be refused, drawn differently, or crash the software that loads it: it depends on the shader and on the software. A vertex shader, for instance, is a part of ISF that not every software takes into account: the documentation of [Resolume Wire](https://resolume.com/support/en/isf?wire) says that Wire (version 7.22) does not read them. ISF Studio cannot test a shader in every software for you: **try it in the one you will use**. ## Where it was tested Once you have tried a shader or a pipeline in a software, note it: the **Info** section of the inspector has a **Tested in** row, where you add the software to each shader or pipeline. It is your own note, for the next time you choose what to bring. See [Tested in](/shaders/isf-header#tested-in). The list of names comes from **Preferences > Softwares**, and is independent of the list of the softwares to install in. ## For video editing suites DaVinci Resolve, Natron and other OpenFX hosts do not read ISF files: they load OpenFX plug-ins. See [OpenFX plug-ins](/library/openfx-plugins). # OpenFX plug-ins URL: https://isf-studio.app/library/openfx-plugins An **OpenFX** plug-in is an effect that a video application loads by itself: it appears in its effects library and works on the timeline like any other. ISF Studio exports shaders and pipelines in this format, so that an effect built here can be used in **DaVinci Resolve**, **Natron** and the other applications that load OpenFX plug-ins. What has been tried, and where, is said in [Tested with](#tested-with). Some plug-ins built with ISF Studio are offered ready to install on the [Add-ons page](/add-ons). ::note Every edition exports OpenFX plug-ins, and the trial included. Without **ISF Studio Publisher**, each image the plug-in draws carries a visible watermark, which leaves the image readable: see [Watermark and Publisher](#watermark-and-publisher). :: ## Export a plug-in 1. Select what you want to deliver in the explorer: shaders, pipelines, `.istshader` bundles, or a folder that holds some. 2. Right-click and choose **Export, OFX Plug-in…**, or use **File, Export, OFX Plug-in…** to export the whole opened library. 3. Name the plug-in, tick the effects it holds, choose the platforms, and press **Export**. ::note Nothing is compiled on your computer: the export copies the plug-in's engine that comes with ISF Studio and your shaders next to it. **You do not need Xcode, Visual Studio or any compiler.** Only notarizing for macOS needs Apple's tools (`notarytool`, from Xcode or its Command Line Tools) and an Apple Developer account. The signature for this Mac only needs nothing installed. :: A pipeline must have been saved at least once: the plug-in is made from the shader the pipeline compiles to. A document that is not a valid ISF shader is left out of the list, with the reason. ## The dialog | Setting | What it does | | --- | --- | | **Name of the plug-in** | The name of the bundle: `Name.ofx.bundle`. | | **Effects** | The documents that go in, **2048 at most**. Each one appears in the host under its own name. A bundle holds **512 effects**: a bigger plug-in is split into several bundles (`Name 1`, `Name 2`…) that the host lists in one section named after the plug-in. See [Big plug-ins](#big-plug-ins). | | **For** | The platforms to build for. Each platform gets a bundle of its own, with the binaries for its processors (Apple silicon and Intel in one, Windows and Linux for x64 and Arm). | | **Install on this computer** | Puts the plug-in of this computer's system where the host looks for it. The system asks for the administrator password. | | **Make an installer** | Delivers an installer in place of the bare bundle, to send to whoever uses the plug-in: a `.pkg` for macOS, a `.deb` for Linux. **There is none for Windows**: its bundle is delivered as it is. Only with a license that releases plug-ins (see [Watermark and Publisher](#watermark-and-publisher)). See [Installers](#installers). | | **macOS signature** | Signs the plug-in: with a Developer ID certificate when there is one, for this Mac only otherwise. **Notarize with Apple** makes a plug-in that opens on any Mac without a warning; it needs a `notarytool` keychain profile and takes a few minutes: **Cancel Export** stops the wait, and the form comes back. | Platforms that are not installed, or whose runtime is missing, are greyed out with the reason. The bundles for other platforms go to a folder you choose. Nothing is replaced in it without your agreement. ## Tested with An OpenFX plug-in is meant to load in any host that follows the standard, but each host has its own limits (the contexts it supports, how it renders in parallel). This is what has been tried: | Host | macOS | Windows | Linux | | --- | --- | --- | --- | | **DaVinci Resolve Studio** | Tested | Not tested | Not tested | | **Natron** | Tested | Not tested | Tested | | **Fusion Studio, Nuke, Vegas and others** | Not tested | Not tested | Not tested | The plug-ins for Windows are built, but have not been loaded in a host yet; those for Linux have been loaded in Natron only. If you try one, [tell us what happened](/support#reporting-a-problem): it is a report we want, whatever the result. ## Big plug-ins A bundle holds up to **512 effects**. With more, the export makes several bundles, as even as can be, named `Name 1.ofx.bundle`, `Name 2.ofx.bundle`… and the host lists all their effects in the one section `Name`. The dialog says how many bundles it makes, and every platform gets the same ones. - **An installer holds them all**: one `.pkg` or `.deb` puts every bundle in place at once. See [Installers](#installers). - **Install on this computer** installs all of them, with one request for the administrator password. - **Notarizing** (macOS) is done on the installer when there is one, and not on each bundle, which saves minutes. - A runtime built before this version holds **64 effects**. The export uses the smallest capacity of the platforms you check, so one old runtime makes bundles of 64 for all of them. ## Installers Whoever receives a bare bundle has to copy it into a folder that needs the administrator password. An installer does it for them, with every bundle of a [big plug-in](#big-plug-ins) in one file. | System | Installer | What it takes | | --- | --- | --- | | macOS | `Name.pkg`, signed and, if you ticked **Notarize with Apple**, notarized | A **Developer ID** signature for the plug-in and a **Developer ID Installer** certificate in your keychain (a different certificate from the Application one, from the same Apple account). It is made on a Mac. | | Linux | `isf-ofx-name__all.deb` | Nothing: it can be made on any computer. It is for Debian, Ubuntu and what comes from them; the distributions that use `.rpm` (Rocky, RHEL) get the bundle. | | Windows | none | The bundle is delivered as it is, and copied by hand. | The installer puts the plug-in in the folder of the table below, and an update replaces the earlier version: an effect that is no longer in it disappears. On Linux, the package manager can remove it. On macOS, an installer that is not notarized makes other Macs warn before they open it: ISF Studio tells you when that is the case. **Install on this computer** works as before, with the bundle. Ticked together with **Make an installer**, the plug-in is installed here and the installer goes to the folder you choose. ## Where plug-ins live Hosts read OpenFX plug-ins from a folder of the system. **Install on this computer** puts the bundle there; for the other platforms, copy it yourself. | System | Folder | | --- | --- | | macOS | `/Library/OFX/Plugins` | | Windows | `C:\Program Files\Common Files\OFX\Plugins` | | Linux | `/usr/OFX/Plugins` | Restart the host application to see the effects. They are listed in a section named after the plug-in (the name you gave it in the export): a plug-in called *ColorLab* puts its effects in a *ColorLab* section. ## What an effect becomes An effect appears in the host according to the images it takes: | The ISF shader has | The effect is | | --- | --- | | no image input | a **generator** | | an `inputImage` | a **filter** | | a `startImage` and an `endImage` | a **transition**, driven by the `progress` input | Its inputs become parameters of the effect: | ISF input | Parameter in the host | | --- | --- | | `float` | A number with its range. | | `long` | A menu when it has `VALUES` and `LABELS`, a whole number otherwise. | | `bool`, `event` | A checkbox. | | `color` | A color. | | `point2D` | Two numbers from 0 to 1 (a position on the image). The shader receives them **multiplied by the size of the picture**, in pixels, as the ISF specification says. | | images imported by the shader | Copied into the plug-in: it does not depend on your library. | Multi-pass shaders, persistent buffers, buffers of a different size (`WIDTH` and `HEIGHT` of a pass, which may use `$WIDTH`, `$HEIGHT` and the numeric inputs) and vertex shaders are supported. ## Good to know - **A shader that listens hears silence.** An `audio` or `audioFFT` input has nothing to listen to in a video application: the effect is made and runs, and its sound input is a black texture, so what reacts to the sound stays still. The notice at the end of the export lists the effects concerned. - **Effects that keep what they drew** (a pass with `PERSISTENT`: feedback, trails, an attractor that draws itself over time) need the host to play the video **in order**: the effect says so to the host, which then renders in sequence. The first image the effect renders is its image 0 (`FRAMEINDEX` is 0, so a shader that starts itself there does), wherever the clip sits in the timeline, and the state starts again from zero when the host goes back in time. Moving about in the timeline gives another state than a render from the first image to the last: judge these effects in continuous playback, and render them from the start. - **`TIME` counts from the start of the effect**, not from the start of the timeline: a clip placed at 01:00:00:00 sees `TIME` start at 0, as it does in ISF Studio. The start is the one the host gives the effect, or the first image it renders. A shader that **multiplies** the time (the frequency of a noise, of a warp) drifts further from what you drew the longer it runs: add the time instead. - **Effects that change with the time** (`TIME`, `TIMEDELTA`, `FRAMEINDEX`, `DATE`) tell the host that their image changes from one image to the next even if no parameter does, so that it does not reuse an image it has already drawn. - **A shader keeps the license of its author.** ISF has no license field, so authors write it in the credit, in the description or in a comment of the code. When the export reads one that does not let a plug-in be sold (non-commercial, copyleft, share-alike, all rights reserved) or a shader that comes from Shadertoy, where CC BY-NC-SA is the default, the export dialog lists them under the effects, before anything is made (only for the effects that are ticked), and the notice at the end of the export repeats them: each line names the effect and the words it found. It is a hint, not a check: a shader that says nothing may still have a license, and Publisher covers your own work, not the rights of others. - **A font image carries a copy of a font's outlines.** An effect that draws text with a [font image](/shaders/font-images) delivers that copy inside the plug-in. When the font says it may not be embedded, the notice at the end of the export lists the effects concerned: deliver such a plug-in only with the license of the font. - **A position (`point2D`) is in pixels in the host.** See [Positions](#positions) below: ISF Studio does not convert it for you. - **A graphics driver with OpenGL 3 or later** is needed, as it is for ISF Studio's own preview. - A plug-in is made from the documents as they are when you export: export it again after changing a shader. ## Positions In the host, a `point2D` input is a control from 0 to 1 on the image (`0.5, 0.5` is the center). The plug-in gives the shader that value **multiplied by the size of the picture**: on a 1920 × 1080 picture, `0.5, 0.5` reaches the shader as `960, 540`. This is the ISF convention for a position in pixels. ISF Studio's own preview does **not** do it: it gives the shader the value as it is. So a shader made for ISF Studio, with a position or an offset in picture units (`0.02`, `0.3`), does not look the same in a host: the value is multiplied by the picture's size, and the drawing ends up out of the frame, so that you only see the background. ISF Studio does not warn about it. - **A shader that expects pixels** (an ISF shader written for other applications) works as it is. In the host, type the position as a fraction of the picture: 540 pixels on a 1080-pixel-high picture is `0.5`, not `540`. - **A shader that expects a position or an offset in picture units** (most of the pipelines made in ISF Studio) has to use `float` inputs instead of a `point2D`: a `float` reaches the shader as it is, in the preview and in a host. Two floats (`x` and `y`) do the job of a position. In a pipeline, replace the position input by two number inputs. - **Check before you deliver**: open the plug-in in the host and move each position input. If the drawing leaves the frame as soon as the value is not 0, the shader does not expect pixels. ## Watermark and Publisher Without **ISF Studio Publisher**, an OpenFX plug-in carries the **ISF Studio icon, in grey, over every image**: a larger mark at the center and a grid of small ones across the frame. It leaves the image readable, so that you can try an effect in your editor, but it is not meant to be delivered. **ISF Studio Publisher** exports the same plug-ins with no watermark, and licenses their release: you may **distribute and sell** the plug-ins you make. Each plug-in is *sealed* when you export it, with a key your license server gave to this computer, so **the export works offline**: the key holds 30 days, as long as the activation, and ISF Studio renews it by itself while the computer is online (at launch, and in the last week of the key). The first time, the computer must be online once, to receive the key. If the key has run out and the computer is offline, the export still succeeds, but the plug-in carries the watermark: connect, and export it again. A seal is tied to the effects of the plug-in. Changing one of its shaders by hand, after the export, brings the watermark back. See [Pricing](/licensing/pricing) for what each edition includes. ## If something does not work - **The effects do not appear.** Restart the host, and check that the bundle is in the folder of the table above. - **macOS says the plug-in cannot be opened.** A plug-in signed for this Mac only does not run on another one. Sign it with a Developer ID certificate and notarize it, or remove the quarantine with `xattr -dr com.apple.quarantine `. - **Make an installer is greyed out.** It needs a platform that has one (macOS or Linux), a license that releases plug-ins, and, for macOS, a Developer ID signature and a *Developer ID Installer* certificate in the keychain. The line under it says which is missing. - **A platform is greyed out in the dialog.** The runtime for that platform is not part of this build of ISF Studio. - **An effect is missing from the plug-in.** It was left out of the list, with the reason under it: the file could not be read, or is not an ISF shader. # The code editor URL: https://isf-studio.app/shaders/code-editor Open a `.fs` and its code appears below the preview. ![The vertex shader of a shader, and the input controls beside it](/screenshots/editor-vertex.png) ## Fragment and vertex The switch at the bottom of the editor flips between **FRAGMENT** and **VERTEX**. The switch appears when the shader has a vertex shader (see [Vertex shaders](/shaders/vertex-shaders)). **Add Vertex Shader** (context menu, or **Edit** menu) creates `name.vs` beside it with the default one; **Remove Vertex Shader** sends it to the Trash. Whichever you look at, the inspector on the right keeps showing the ISF header of the shader. ## Writing The editor highlights GLSL and ISF, and shows the line where the compiler complains. Under it, the toolbar has: - **JSON metadata** and **main()**: fold or unfold the ISF header and the `main()` function (the gutter does the same); - **Minimap**: shows a small map of the code beside it; - **Format**: tidies the code, leaves the header alone, and counts as one step in the history; - **Find**: opens the search (see below); - **Copy**: copies the code; - **Input controls**, at the right end: shows or hides the live values of the inputs beside the code. It is disabled for a shader with no input. ## Finding and replacing `Cmd+F`, or **Find** in the toolbar, opens a search field at the top right of the code. It has the switches **Aa** for the case, **ab** for whole words and `.*` for a regular expression, a count of the matches, and the arrows to go from one to the next. Open the replacement field to replace one match or all of them. `Escape` closes it. The CODE view of a [pipeline](/pipelines/concepts) has the same search, without the replacement: the code is read only. The [Toolbox](/pipelines/snippets-and-toolbox) holds snippets you can drop into the code. ## Undo Every edit goes in the history of the document: undo with `Cmd+Z`, redo with `Cmd+Shift+Z`. The [History view](/workspace/history-and-clipboard) lists the steps and lets you go back to any of them. ## Save `Cmd+S`, **Save As…** or **Save All**. See [Saving and drafts](/workspace/saving). # The ISF header URL: https://isf-studio.app/shaders/isf-header 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 inspector](/screenshots/inspector.png){width=192} ## 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](/library/sharing#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](/shaders/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](/shaders/console), which also explains how ISF 1 shaders are converted. See the [header reference](/reference/isf-header-reference) for every key. # The preview URL: https://isf-studio.app/shaders/preview The preview sits at the top right. Its toolbar: ![The resolution menu of the preview](/screenshots/preview-resolution.png) | Control | Does | | --- | --- | | Pause / Play | Stops or resumes the shader. | | Resolution | The size it is **drawn** at, from QVGA 320 × 240 to 4K 3840 × 2160, or a size you add. | | Alpha | Shows a checkerboard behind the picture, to see transparency. Off, the alpha is left out: a shader that never writes it (most from Shadertoy) still shows. | | fps and ms | Frames per second (blue) and GPU time per frame (orange). | | Fit, move, zoom | Recenter the picture, drag it, zoom it. | The default is VGA 640 × 480, chosen for speed. The resolution is remembered for each document, and your own sizes are the same in every library: they are a setting of the app. The Alpha toggle is also remembered for each shader or pipeline in its folder, including after reopening Studio. ## Snapshot The camera button of the preview saves a picture of what it shows, next to the document or wherever you choose. A dialog shows the picture and asks for a format: | Format | What it holds | | --- | --- | | **PNG**, **JPEG**, **WebP** | The 8-bit picture of the preview. PNG and WebP keep the transparency; JPEG draws it on black. | | **TIFF** (Pro) | 8 bits per channel, with transparency. | | **OpenEXR · 16-bit float** (Pro) | Half floats. | | **OpenEXR · 32-bit float** (Pro) | Full floats. | | **TIFF · 32-bit float** (Pro) | Full floats, for the software that reads a float TIFF. | | **Photoshop (PSD) · 8-bit** (Pro) | One transparent layer called *Shader*, and the merged picture. For Photoshop, Affinity Photo, Krita and GIMP. | | **Photoshop (PSD) · 16-bit** (Pro) | Whole numbers (0 to 65535), values out of 0 to 1 are clamped. The merged picture with the transparency as an alpha channel. | | **Photoshop (PSD) · 32-bit float** (Pro) | Full floats. The merged picture with the transparency as an alpha channel; Photoshop reads a 32-bit file as linear light. | A snapshot saved in the folder you have open appears in the explorer at once. A TIFF, an OpenEXR or a Photoshop file opens in the studio's image viewer, which shows it **for a screen** (light encoded for sRGB, values under 0 or over 1 clamped): to check the numbers, open it in your editing software. The viewer reads uncompressed and ZIP OpenEXR, uncompressed or deflated TIFF, and PSD and PSB (8, 16 and 32 bits; RGB, grayscale, indexed, bitmap and CMYK, which is converted approximately, without the color profile of the file); for another compression or mode it says so. A Photoshop file shows the merged picture stored beside its layers: one saved without *Maximize Compatibility* has a blank one, and the viewer says so instead of showing white. A file the studio has no viewer for (a PDF, a Word file, a Blender scene…) shows the icon of its application in the explorer. Its context menu has **Open** (the application the system has for it) and **Open With…**; a double-click only selects it. A program (an `.exe`, a script, an `.app`…) is never opened from there: it is only shown in the file manager. ### Floating-point pictures A screen holds 8 bits per channel: nothing under 0 or over 1, and 256 steps between. A shader does not have that limit, and a normal map, a height map or a displacement map needs it: a normal has **negative** components, a height can be **more than 1**, and a slow slope in 8 bits turns into steps. The three float formats do not take the picture of the screen. The preview **draws the frame again**, at its resolution, into a texture of 32-bit floats, and writes what the shader wrote: not clamped, not rounded, not converted. A half float keeps about 3 decimal digits and goes up to 65 504; a float keeps 7 digits. **Values** says what the numbers mean: - **As drawn (data)**, the default: nothing is done to them. For normal, height and displacement maps, masks, depth, anything that is not a color. What the shader writes is what the file holds. - **Color (sRGB to linear light)**: the numbers are sRGB, as the shader of a picture usually writes them. The file is in linear light with the alpha multiplied in, which is what compositing software expects of an EXR. Things to know: - The size is the one of the preview: choose it in the resolution menu before the snapshot. A float file of 4096 × 4096 weighs 256 MB in memory while it is written. - **A pass with a `TARGET` is 8-bit unless it says `"FLOAT": true`.** If the last pass, or one that feeds it, keeps its result in a target without `FLOAT`, the precision is lost there, whatever the format. Give the target `"FLOAT": true` to keep it. - The frame is drawn once more: a shader that keeps a state from one frame to the next (a `PERSISTENT` target) goes one step on. - The transparency of the file is the alpha the shader writes. With the **Alpha** toggle off, the preview leaves the alpha out: the file has an alpha of 1 everywhere. - A graphics card that cannot draw into floats cannot write the 32-bit formats; the 16-bit OpenEXR is then written from the 8-bit picture, with the precision of the screen. ## Performance The **Performance** tab, next to the Console, tells how much of a frame a shader takes, and where to look when one that used to run smoothly has become slow. Measures are paused when you open the tab: press **Resume the measures** to start them, and **Pause the measures** to keep a reading. ![The performance panel](/screenshots/performance.png){width=640} - **The budget of a frame.** A bar shows how much of the time of one frame the graphics card takes, at the rate you aim at (24, 30 or 60 frames per second). - **The rate** reached, on average and at its lowest, and the **longest frame**. - **Estimated GPU time** at 720p, 1080p, 1440p, 4K and 8K, as milliseconds and the frame rate they would allow. It is an estimate: the cost of a shader follows the number of pixels. - **A warning** when the preview is drawn by a software renderer, which is far slower than a graphics card and not what the shader will cost on yours. If your graphics card cannot report its time, the milliseconds are not shown: this is what the card can report, not the cost of the shader. The frame rate is still measured. ### The computer The button at the far right of the tab shows a card with your computer: its system, processor, memory, graphics card and the version of ISF Studio. **Copy the measures as text** and **as Markdown** copy the measures together with this description, whether the card is shown or not. Paste it when you [report a problem](/support#reporting-a-problem), or to compare two computers. # Input controls URL: https://isf-studio.app/shaders/input-controls 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. ![The input controls](/screenshots/input-controls.png){width=362} | Input type | Control | | --- | --- | | `float` | A slider, and the value. | | `long` | A choice of labelled options declared in `VALUES` and `LABELS`. | | `bool` | A checkbox. | | `color` | A colour picker. | | `point2D` | Two values. | | `image` | A choice of source: a file of the library, a built-in image or video, a camera. | | `event` | A 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](/media/resources#pointer) 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](/media/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](/media/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](/media/midi#a-button-for-each-item-of-a-list). The presets can be bound the same way: see [Bind a preset](/shaders/presets#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](/shaders/presets) 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](/media/midi) (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](/shaders/presets). # Presets URL: https://isf-studio.app/shaders/presets A preset is the state of the [input controls](/shaders/input-controls) at a given moment: a calm version, a wild one, the one for the second chorus. Save it once, and recall it with one click. Presets exist for **shaders** and for **pipelines**. They are at the bottom left of the input controls. The button shows the name of the preset in use, or **Presets** when there is none. ## What a preset keeps - the **value** of each input: sliders, options, checkboxes, colours and points; - the **source** of each image input: a file of the library, or a built-in image or video; - how each **video** and **sound** plays: play or pause, loop, muted; - which **point2D** inputs follow the mouse, and whether they are normalised. A camera is not kept: it is a device of your computer, not a setting. A camera that is open stays as it is when you recall a preset. ## Save, recall, change The **+** button, left of the name, saves the inputs as a new preset. The menu of the name lists the presets. | Action | What it does | | --- | --- | | **Defaults** (first of the list) | Gives the inputs back to the `DEFAULT` of the header: the sources of the images and what the inputs are bound to stay. No preset is in use then. | | A preset in the list | Gives the inputs the state of the preset. It becomes the preset in use, and is ticked. | | **+**, or **Save as a new preset…** | Asks for a name and keeps the inputs as they are. A name that is taken gets a number: `Calm 2`. | | **Update "name"** | Keeps the inputs as they are in the preset in use. Available once the inputs have moved away from it. | | **Update a preset** (**Update another preset** when one is in use) | A list of the other presets: keeps the inputs as they are in the one you choose, which becomes the preset in use. After a restart no preset is in use, so this is where to update one. | | **Manage presets…** | A dialog that lists the **Defaults** and the presets, to rename them, keep the inputs in one of them, delete it, or [bind it](#bind-a-preset) to a MIDI control or an OSC address. The inputs stay as they are. | A small dot beside the name says that the inputs changed since the preset in use. Move them back, and the dot goes. Recalling a preset **replaces** what you gave the inputs: an input the preset does not mention goes back to the `DEFAULT` of the header. Presets are not written in the shader, **Reset** of the panel brings the inputs back to the preset in use (the defaults when none is), and **Save as defaults** works as before (see [Input controls](/shaders/input-controls#save-as-defaults-reset)). If you rename or remove an input of the shader afterwards, the presets still work: what they say of an input that is gone is ignored, and a new input keeps its default. ## Bind a preset Each preset, and the **Defaults**, can be recalled from a **MIDI note or control**, or from an **OSC address**: the pads of a controller become the scenes of a show. 1. Open **Manage presets…**. 2. On the line of the preset (or of **Defaults**), press **MIDI** or **OSC**: it says it is waiting. 3. Play the note, move the control past its first value, or send the message. The line tells what the preset is bound to. From then on that note, that control reaching the half, or that message gives the inputs the state of the preset, which becomes the preset in use. A control that stays at the top recalls it **once**: it must come back down to recall it again. **Unbind** frees it, and a small MIDI or OSC mark beside the name in the list says which presets are bound. **Esc** stops the waiting. The binding of a preset is **not part of the preset**: recalling or updating a preset never changes which control recalls which. It is kept with the other [bindings](/media/midi#where-the-bindings-are-kept) of the document, and goes when its preset is deleted. A control that is also bound to an input does both. In the same way, each item of a list has a [button](/media/midi#a-button-for-each-item-of-a-list) of its own. ## Where they are kept In the library, in a hidden folder: `.isf-studio/presets/`, with one small file for each shader or pipeline (`.isf-studio/presets/fx/rings.fs.json` for `fx/rings.fs`). The explorer does not show it. - They **follow the file**: rename it, move it, copy it in Studio, and its presets go with it. A file that is sent to the Trash takes its presets with it, and a file that comes back from the Trash does not bring them back. - A file moved in the Finder leaves its presets behind: move it in Studio instead. - To keep them elsewhere, copy the library folder with its hidden folder. - What the inputs of a shader are bound to (the mouse, MIDI) is kept in the same hidden folder, in `.isf-studio/bindings/`, and follows the file in the same way. See [Bind an input](/shaders/input-controls#bind-an-input). ## Sharing Presets travel inside the archives of Studio: - a **pipeline** (`.istpipe`) carries its presets: Studio writes them in the file each time it saves the pipeline. Open a pipeline someone sent you, and its presets are there, kept in your library from then on. Delete them all, and they do not come back from the archive; - a **shader bundle** (`.istshader`) carries the presets of the shader, and unpacking it keeps them for the shader it makes; - a **library** (`.istlib`) carries the presets of its shaders and of its pipelines, and unpacking it keeps them for what it makes. A `.fs` file alone does not carry them, and neither do **Export, To Folder** or a ZIP archive. ## In the free edition A shader or a pipeline keeps **3 presets**. The menu says **Pro** on **Save as a new preset…** once you have them, and so does the title of the **+** button. The ones you have stay, and can still be updated, renamed and deleted. See [Pricing](/licensing/pricing). # The console and fixes URL: https://isf-studio.app/shaders/console The **Console** is at the top left. It is empty when everything is fine, and says **No error**. ![The console with two problems and a Fix button](/screenshots/console-fix.png) ## What it shows Each line has the time, the file, the line number and the message. Problems come from: 1. the ISF **header** (invalid JSON, wrong keys); 2. the **imports** (a file that does not exist); 3. the **text** of the shader (invisible characters, misplaced comments); 4. the GLSL **compiler**; 5. **rendering** (a pass that fails while it is drawn). They are sorted by that order, then by severity. A red name on a tab or in the explorer means the console has something to say about that file. ## Go to the line Click a line and the editor jumps to the place, in the fragment or the vertex shader. For a header problem, to the line of the key that is wrong. ## Fix Some problems come with a **Fix** button, which rewrites the text for you (one step in the history, so it can be undone): - a comment before the ISF header moves below it; - invisible characters are removed; - trailing commas in the header JSON are removed, when they are the only fault; - the redundant `NAME` of an imported image is removed; - mistyped keys are corrected, when a key is one typo away from a key that ISF knows; - unknown keys are removed, all at once; - an input whose `NAME` cannot be a variable (an accent, a space, or a name ISF declares itself: `TIME`, `PASSINDEX`, `RENDERSIZE`…) is renamed in the header, and what you wrote stays as its label. An accent or a space is changed in the code too; a name ISF declares itself is not, because in the code `TIME` is ISF's variable and stays in capitals; - ISF 1 constructs become ISF 2 ones (see below). ![A shader that does not compile](/screenshots/console-error.png) The copy button under the console puts the messages in the clipboard, for pasting into a request for help. While the console shows at least one error, a **bug** button appears next to it. It opens the support dialog on the topic **Problem**, with the errors written in the message: read it, say what you were doing, change what you want, and send it. Nothing leaves your computer until you press **Send**. The same dialog opens from **Help, Report a Bug…**, and **Help, Request a Feature…** opens it on the topic **Feature request**. ## ISF 1 shaders ISF 1 shaders open as they are. ISF Studio recognises what ISF 1 hosts wrote that ISF 2 does not read, reports it, and converts it when the **Fix** button is pressed. Each conversion is one step in the history, so it can be undone. | In an ISF 1 shader | What the console reports | What **Fix** does | | --- | --- | --- | | `PERSISTENT_BUFFERS` at the root of the header | The key is obsolete: it stays in the file and is ignored. | **Declare PERSISTENT on the passes**: writes `PERSISTENT: true` on each pass the list named, and removes the list. | | `vv_FragNormCoord`, `vv_vertShaderInit` in the code | The shader does not compile: those names are ISF 1 ones. | **Rename the ISF 1 names (vv_) to ISF 2 (isf_)**: renames them everywhere in the shader, in the fragment or the vertex source. | # Shader templates URL: https://isf-studio.app/shaders/templates **New… > Shader…** asks which template to start from. ![The new shader dialog](/screenshots/new-shader-dialog.png) | Template | Starts you with | | --- | --- | | **Empty** | A header with no inputs and a `main()` that paints everything transparent black. A new empty pipeline is the same: nothing is wired to its output. | | **Generator** | Diagonal waves that move between two colors, with `scale`, `speed` and the two colors as inputs. It draws by itself, so you see something at once. | | **Filter** | A duotone: an image input, a color for the shadows and one for the highlights, and an `amount` to mix it with the original. | | **Transition** | A wipe from left to right: a start image, an end image, a `progress` input and a `softness` for the edge. | | **Blend** | A base image, a blend image and an `opacity`, with a blend function included. | Each one is short, on purpose: a few lines of GLSL, or a dozen nodes. The **pipeline** of a template does exactly what the shader of the same name does, so you can open both and see how the code and the nodes tell the same thing. A Transition or a Blend shows nothing until you give each image input a picture in the input controls. Press `Enter` to validate. Tick **Do not show again** and your choice becomes the default: the next new shaders skip the question. You can still start from another template by copying a shader you like. # Vertex shaders URL: https://isf-studio.app/shaders/vertex-shaders 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. ::note Not every ISF software takes a vertex shader into account: the documentation of [Resolume Wire](https://resolume.com/support/en/isf?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](/shaders/isf-header#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](/shaders/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](/shaders/console#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](/library/sharing)). A pipeline that has a [vertex graph](/pipelines/editing-graphs#the-vertex-graph) compiles to a vertex shader as well, kept inside its `.istpipe`. # Font images URL: https://isf-studio.app/shaders/font-images A shader has no fonts. **Font Image** turns a font into a picture: a grid of multi-channel distance fields, one cell for each character, that a shader reads from an **Imported** image to draw text at any size, sharp. What a shader needs to lay the text out (the width of each character, its line height) is written in the image itself, so the image is all you carry around: it works in the preview, in a pipeline, in a video export and in an [OpenFX plug-in](/library/openfx-plugins). ::note Font Image is a **Pro** feature. :: ## Make the image 1. Open a library, then choose **File, New, Font Image…** (or **New…, Font Image…** in the context menu of the explorer, or **Font Image…** on a font file). 2. Choose a font of the computer, or **Choose a file…** for a `.ttf` or `.otf` font. 3. Choose the **characters** (an image holds 256 consecutive characters: the first page is the Latin alphabet), the **cell** (the size of a character in the image) and the **range**. 4. Optionally, type a **text** and a name for it: the dialog then also makes the small image that holds that text, and gives the code that draws it. 5. Press **Create**. The images are written in the folder that was in front in the explorer (the one you right-clicked, the one of the font file, the library itself when none), which you can change in the **Folder** field. The explorer opens it, and **Show the image** opens the picture. A larger cell is sharper when the text is drawn big, and makes a larger image. The **Wide** range gives the effects (outline, glow, shadow) more room around the letters. ::warning The image is a copy of the outlines of the font. Check that the license of the font allows it, above all if you deliver the result (a plug-in, a video). The dialog tells when a font says that it cannot be embedded. :: ## Read it in a shader Add the image as an **Imported** input (**+**), then use the snippets of the **Text & sprites** family: | Snippet | What it gives | | --- | --- | | **Font Char** | How much of a pixel a character covers, from 0 to 1. | | **Font Text** | The same for a whole text held in a text image, up to 256 characters. A line break goes to the next line. | | **Font Char Distance**, **Font Text Distance** | The signed distance in pixels to the letters, for outlines and glows. | | **Font Advance**, **Font Line Height** | The metrics of the font, to lay text out yourself. | | **Sprite Cell** | The cell of a sprite sheet, for any grid of pictures. | The text reaches the shader in one of two ways: as **code** that the dialog gives (the text is written in a comment above it), or in a small **text image**, one pixel for each character, that you can swap without touching the shader. ## Draw text in a pipeline In a pipeline, the **Text** category has a **Draw Text** node. It takes the string that is wired to its `text` input, and draws it with the font image wired to `font` (an imported image): `p` is the pixel in pixels from the start of the first line, `size` the em in pixels, `spacing` and `lineSpacing` what is added to each character and to each line, as a fraction of `size` (0, the default, is the font's own: 0.1 opens the characters a little, a negative number closes them), `result` the coverage from 0 to 1 and `sdf` the signed distance in pixels, for outlines and glows. `aabbMin` and `aabbMax` give the box of the text, in the same pixels as `p` (from the start of the first line, `y` upwards): from the start of the lines to the end of the longest one, and from the descender of the last line to the ascender of the first. It is the box of the lines, not of the ink: spaces count, and every glyph is measured by its advance. Use it to centre or align a text, or to draw a background behind it. The string comes from a **Text**, **Comment** or **TODO** node of the same category: each has a string output. Write the text in the node, wire it to Draw Text. The text is written in the shader as code, one call for each character, so the shader has no string and no extra image to carry: it is the *Font Text* snippets' unrolled form. A text holds up to 256 characters, and a line break goes to the next line. A string cannot cross the edge of a group, a loop or a function: keep Text and Draw Text in the same graph. ### Type a text, one character at a time The **Typewriter** node (same category) takes the same string, the same font image and the same `p`, `size`, `spacing` and `lineSpacing` as **Draw Text**, and says **how much of the text is written** at a given time: `time` is the seconds since it starts and `speed` the characters a second. Its `result` is 1 where the text is written and 0 elsewhere, with an edge one pixel wide at the pen: multiply it by the `result` of Draw Text. It adds up the width of each character, with the font, as Draw Text places them, so the edge always falls between two letters, whatever the font. A line break counts as a character; the lines before the one being written are all there. It also gives `characters`, the length of the text, and `penEnd`, where the pen ends, in the same pixels as `p`. `index` is the number of the character under the pixel (-1 where there is none) and `cell` where the pixel lies in its cell: `x` from 0 to 1 across its advance, `y` in em above the baseline. They give **each letter a time of its own**: take the clock of the typewriter away by `index` and each letter starts after the one before. With `cell` round the middle of the letter, and the `sdf` of Draw Text (positive inside: pass its opposite), the **Draw On** snippet traces the outline of each letter by turning round it, then fills it, and **Staggered Progress** gives each letter its own time (the **Titles - Trace** example of ISF Studio does it). To type a second text, maybe in another font, after the first: take `penEnd` away from `p` for the second Draw Text and the second Typewriter, and start the clock of the second late by `characters / speed`. To make it start again, wrap the time (`mod`) by the length of the loop you want. For a text held in an **image** (made by the Font Image tool) the snippets do the same: **Font Text Length**, **Typewriter Count** and **Font Text Typed**. **Soft Wipe** is the other way to write a text on: a mask with a soft edge that goes along a width, whatever the text and the font. ## Limits - The distance is exact within **half the range** on each side of the edge of a letter; further, it only says "outside". A wide effect needs the **Wide** range. - An image holds 256 characters. For another alphabet, make another image and choose its characters. - A text image holds up to 256 characters. # How pipelines work URL: https://isf-studio.app/pipelines/concepts A pipeline is a way to write a shader by connecting things instead of typing them. ![A pipeline](/screenshots/pipeline-editor.png) ## Nodes and ports A **node** does one small thing: add two numbers, sample an image, mix two colours, hold a shader of your library. A node has **ports**: inputs on one side, outputs on the other. A line from an output to an input says "use this here". Ports have **types** (a float, a vector, a colour, an image…). Studio connects only what can be understood, and a few ports adopt the type of what you plug in. The colour of a port tells you its type. ## What a pipeline compiles to Whenever the graph changes, Studio compiles it into an **ISF shader**: header, inputs, `main()`, helper functions. That shader is what the preview plays, and what an ISF host would play. A pipeline that has a vertex graph also compiles a vertex shader. Switch the toggle at the bottom of the editor between **PIPELINE** and **CODE** to read it. ![The CODE view](/screenshots/pipeline-code.png) You do not edit the code of a pipeline there: the graph is the source. The toolbar has the minimap, the readable or optimized source, **Find** (`Cmd+F`) and **Copy**. If you want to take over by hand, copy the code into a new `.fs` and carry on as a shader. ## The `.istpipe` file One archive: the graph, the compiled shader (and vertex shader), and every image you used. It does not depend on the files of your library. That is why a pipeline travels well. ### Missing nodes A pipeline made with a node this version does not know (a node of a newer version, for instance) still opens: that node stays on the canvas as a **missing node**, dashed and red, with its ports and its cables. It computes nothing, so what it feeds gets a neutral value (zero) and the console says so. You can move it or delete it, but not wire it. Saving writes it back exactly as it was read, so nothing is lost: open the pipeline in a version that knows it, and it is whole again. ## Graphs inside graphs The main graph can contain **groups**, **loops** and **functions**, each a graph of its own with its own inputs and outputs, and a pipeline may also contain **other pipelines** and **shaders from your library**. See [Editing a graph](/pipelines/editing-graphs) and [Shaders and pipelines inside pipelines](/pipelines/composing). ## The pipeline as text To ask an AI assistant about a graph, or to send it to someone, the pipeline toolbar can show it as **text**: one line per node and per link. **Copy for AI** copies the text with instructions: what ISF Studio is, the format, your pipeline and your request. The text can be brought back with **File > Import > Pipeline from Clipboard**, on this machine or another. It is a Pro feature, trial included. See [Pipeline text](/reference/pipeline-text) and [Sharing](/library/sharing#a-pipeline-as-text). ![A pipeline as text](/screenshots/pipeline-text.png) # Editing a graph URL: https://isf-studio.app/pipelines/editing-graphs ## The canvas Drag the background to pan, use the wheel to zoom. The toolbar under the graph has buttons to fit the graph in the view, show a minimap and more. ## Adding nodes Right-click the canvas for the add menu: a search field on top, then the categories. Type three letters of what you want and it appears. You may also drag from the explorer (shaders, pipelines, images) or from the [Toolbox](/pipelines/snippets-and-toolbox) (snippets). ![The add menu](/screenshots/pipeline-addmenu.png){width=290} ### Imported images While editing a pipeline, an image from the opened folder keeps its real path, relative to the pipeline. The Imports inspector shows that file, and the Gallery counts it as used by the pipeline. Saving embeds a fresh copy of each referenced image in the `.istpipe` archive and writes `imported/…` paths in its graph and compiled shader. Studio also keeps the original path so reopening the pipeline restores the external reference. If an external image cannot be read, saving is refused with a message rather than silently embedding an outdated copy. Images carried only by an archive are shown from that archive; they are not attributed to a homonymous file in the folder. To use another image in its place, right-click the **Imported Image** node and choose **Replace Image…**, or right-click the image in the **Imports** inspector. Pick an image of the folder: the node keeps its name, so the shader reads the same variable, and one undo brings the old image back. From the inspector, every node of the graph you are looking at that holds that image is replaced; open the group first for the ones inside it. ## Finding a node **Cmd+F** (or the magnifier at the right of the bar above the graph) opens a search field at the top right of the canvas, like the one of the code editors, without the replacement. Type a part of a name: a list shows the nodes that match, each with where it is, as `Pipeline › Group › Loop`. - The search reads the **name** of the nodes only: the one you gave them, else the one they have by default; an **input** is found by its name (`speed`), not by its type. It does not look into the values of the ports. - It goes through the whole pipeline, the vertex graph and the contents of groups, loops and functions included. A node is listed once. - The same switches as the code editors: **Aa** for the case, **ab** for whole words, and `.*` for a regular expression. - Choose a node with a click, or with the arrow keys and `Enter`. The containers that lead to it are opened, the node is selected and the canvas centres on it, without zooming further than it was. The search then closes. It also closes with `Escape`, or with a click anywhere else: that cancels it. ## Working with nodes Right-click a node: ![The context menu of a node](/screenshots/pipeline-menu.png){width=360} - **Rename**, **Cut**, **Copy**, **Paste**, **Duplicate**, **Delete**. - **Create Group** (`Cmd+G`): turns the selected nodes into a group. - **Create Input**: exposes a port as an input of the whole pipeline. - **Proxy Input / Proxy Output**: a stand-in for a port, to avoid drawing a line across the entire canvas. Select several nodes with a rectangle, or hold `Shift`. Undo and redo (`Cmd+Z`, `Cmd+Shift+Z`) take back the rename, cut, paste, duplicate, group and delete actions. ## Connections Drag from a port to another. Types are checked as you go: a connection that cannot work is refused, and a port that has no type yet takes the type of the first thing you plug in, and gives it back when you unplug. A node whose output goes nowhere is drawn with a dashed orange outline: what it computes is used by nothing. Two kinds are allowed to be wired to nothing and are not outlined: an **Input** of an **If**, and a **Pass** that a **Read Pass** names (it is read by its target name, not by a wire). A Pass that nothing reads is outlined, as it does nothing. ## Notes on nodes A **Comment**, a **To-do** or a **Text** can be put *on* a node. Drag the diamond handle on the right of the note and let it go on the body of a node (while you drag, the node under the cursor shows the diamond it will get): the node gets a diamond of its own above its top left corner, and a dashed cable joins the note to it. Every string (the output of a note, the `text` input of Draw Text) has this pale diamond: it is the only handle of its shape and colour. The note stays where it is; drag it onto another node to move it, and any number of notes can be on one node (a note goes on a node that computes, or on a container: on a group the shader gets it above what the group holds, on a function above its declaration, on a loop or a branch above the code it makes; not on the nodes at the edge of a container, such as a loop input). What the note says is written in the shader, as `//` comments right above the line of that node. A **To-do** is written as `// TODO: …`, so that the tools that look for `TODO` in code find it (a to-do with no text is written as `// TODO`). Open the **Code** view of the pipeline to read it: the nodes that have a note always get a line of their own, so the comment has something to stand above. Undo and redo take a note on and off like any other change, and take back the text you typed in a note (a whole stay in the field at once) or the size you gave it. **Arrange the nodes** keeps the notes with their nodes: a note stays on the same side of the node it is on and moves with it. A note that is on no node moves like the node that was nearest to it. ## Groups, loops and functions - A **group** hides a part of the graph behind one node. Double-click to open it, and again to come back. - A **loop** repeats a graph (for, while, do-while), with its own inputs, outputs, and break and continue nodes. - A **function** is a graph you call from elsewhere, with parameters and a return value. A snippet can be called the same way. - A **macro** is a group that you keep under a name, to place it again in other pipelines, of any library. See [Macros](/pipelines/macros). ### Iterator controls **Iterator** (`for`) loops contain separate **Index**, **Condition** and **Increment** nodes. Index exposes the current integer `i`; Condition receives a boolean expression and Increment receives an integer expression. Iterators can also live inside groups. Their initial inputs and final outputs remain connected through the group's exposed ports. Select a loop **Input** or **Output** node to choose its type in the Inspector. The choice updates the matching port on the parent Iterator and supports undo/redo. Choose `any` to let connections determine the type. The default graph still supplies an `Index < 8` comparison and an increment of `1`, using external comparison and integer nodes. You can replace those connections with any compatible expressions, including calculations that use Index. The starting index remains on the parent Iterator's `i` input and defaults to `0`; it is evaluated before the loop starts. As before, an unconnected Condition defaults to true and an unconnected Increment to `1`. Loops keep their safety limit of 1,024 iterations, including when the increment is zero or the condition never becomes false. ## The vertex graph A pipeline can have a vertex graph next to the fragment one, for effects that need to move the geometry. Most pipelines do not have one. ## Inputs Inputs you create show up in the controls panel and in the ISF header of the compiled shader, so the same sliders work in Studio and in whatever plays the shader. Configure an existing input from the Inspector's Inputs section to edit its name, label, description and values. Changes update its node and can be undone and redone. Add or delete inputs and choose their type on the graph; inputs contributed by an embedded shader are edited in their source. # Node catalog URL: https://isf-studio.app/pipelines/node-catalog The add menu offers a large number of nodes: GLSL functions, operations (maths), conditions, structure, values, conversions and ISF itself. There is no need to know them all: they are meant to be found when needed, not learned in advance. Find them with the search field of the add menu, or browse by category: ![The categories of the add menu](/screenshots/pipeline-addmenu.png){width=290} | Category | What you find | | --- | --- | | **Arrays** | Make arrays, take them apart. | | **Branch** and **Conditions** | Choose between values, compare, switch. | | **Constants** and **Values** | Numbers, vectors, colours, and frequently used constants. | | **Conversions** | Turn one type into another. | | **Functions** | Define your own functions and call them. | | **GLSL** | The functions GLSL gives you, as nodes. | | **Group** and **Loop** | The structure: groups, and for/while/do-while loops. | | **Helpers** | Small utilities to keep a graph readable. | | **Inputs** | The inputs of the pipeline: float, colour, image, point, event and the others. | | **ISF Macros** | `IMG_THIS_NORM_PIXEL`, `TIME`, `RENDERSIZE` and the other things ISF gives a shader. | | **Matrices**, **Vectors** | Build and transform them. | | **Text** | Comments, to-dos and Text: notes kept next to the nodes they describe, each with a string output that can be wired. **Draw Text** draws the string wired to it with a [font image](/shaders/font-images). | | **Operations** | Maths. Add, multiply, mix, clamp, and related operations. | | **Passes** | Multi-pass rendering and persistent buffers. | | **Scenes** | Show one of several scenes, and go from one to another with a transition: **Scenes** and **Scenes Clock** (see [Scenes](#scenes)). | The shaders and pipelines of your library are nodes too: drag them in from the explorer. ## Switch A **Switch** gives the value of the case its selector picks, and the **default** when none matches. Wire a **Long** input to the selector and the switch takes its choices as cases. Only the picked case is worked out. What feeds a single case, and has work to do (a value read twice, a function call), is computed inside that case in the generated shader, not before the switch. What feeds more than one case, or feeds something outside the switch, is computed before it, as it always was. This holds for a switch in the graph or in a group, a macro included; in a function, a loop or an **If**, the switch works as before. Shaders and pipelines with several passes always render all their passes, whatever case is picked: a pass is a step of the frame, not of a case. ## Scenes **Scenes** shows one of several *scenes* (each is a colour: the result of a pipeline, or of any node) and can go from one to the other with a transition. Both nodes are in the **Scenes** menu. A scene is a colour (a **vec4**) unless you change **Type of the scenes** in the inspector: a **float**, a **vec2** or a **vec3** (all the scenes and the result of the node then have that type, so it picks and mixes numbers and vectors). The transition mixes them by the same amount; only a colour has an alpha to take in. Wire a **Long** input to the **Scene** port of a Scenes node: its values and labels become one input for each scene, named by its label. Wire the colour of each scene to its input. There are three ways to change scene, from the simplest. - **A cut.** Nothing else wired: the scene that the menu picks is the one shown. This is a Switch for colours. - **A transition that happens by itself.** Wire the **Long** to a **Scenes Clock** instead, give it the length of the transition in seconds, and wire its outputs to the Scenes node: **To** into **Scene**, **From** into **From**, **Progress** into **Progress**. (**To** and **From** the other way round show the new picture at once, then fade back to the old one.) Each time the menu changes, the clock remembers the scene that was shown and the Scenes node goes from it to the new one. The scenes keep the names of the menu. - **A transition you drive.** Wire **From** and **Progress** yourself (for example a Float input from 0 to 1, animated by keyframes in a video editor): nothing is remembered, and a frame always looks the same whatever was played before it. **Transition** is the kind of the change: a number, or a **Long** input with these labels. When it is not wired, the node uses the kind in its inspector. | Value | Transition | | --- | --- | | 0 | Cut | | 1 | Fade | | 2, 3, 4, 5 | Wipe right, left, up, down | | 6 | Iris, from the centre | | 7 | Dissolve | | 8 | Blinds | A scene often has a clock of its own, which should start again when the scene is shown. A Scenes Clock gives **Time** since the change and **Changed**, true for the one frame in which the menu changed: wire *Changed, and the scene is mine* to the **Reset** of a pipeline, or use the time to drive what appears in a scene. The example below does both. **Good to know:** - **Only the scene that is shown is worked out, and the one a transition comes from while it lasts**, as in a Switch: what feeds one scene only (and nothing else) is computed when that scene is needed. What feeds more than one scene, or something outside the node, is computed in every frame, and a pipeline with passes always renders all its passes, shown or not: keep the scenes you do not need out of the graph. Turn off **Work out only the scenes in use** in the inspector to work out every scene in every frame: a scene that was never worked out can take a moment the first time it is shown, which a short transition then jumps over. - **A transition mixes the values that the two scenes give at each point.** It cannot move a scene (push, zoom): a scene is a colour, not a picture. The colours are mixed with their alpha taken in, so a scene that is clear around a shape does not get a dark edge. - **The Scenes Clock keeps a memory** of one pixel. Like every pipeline that keeps what it drew, it needs the video to be played in order: a host that renders frames out of order, or that you scrub, starts again each time (see the [OpenFX plug-ins](/library/openfx-plugins)). For these, drive the transition yourself. - If the menu changes in the middle of a transition, the next one starts from the scene that was reached. ### Examples `95 Scenes Sequencer / Scenes Node` is the smallest one: a **Scene** menu with three scenes (a colour, a gradient, a circle), a **Transition** menu and a **Transition (seconds)** input, wired to a Scenes Clock and a Scenes node. Change the menu while it plays. `96 ISF Studio / 3D / ISF Studio Logo Scenes` is the logo in two scenes: the 2D logo and the mark in 3D. A **Scene** menu picks one, a **Transition** menu the kind, and **Transition (seconds)** the length. The 2D logo plays again each time it is shown (its Reset is *Changed, and the scene is the 2D one*), and the 3D mark starts its turn when it is shown. # Snippets and the Toolbox URL: https://isf-studio.app/pipelines/snippets-and-toolbox The **Toolbox** is the second activity in the bar on the left. It holds more than 400 snippets of GLSL, in nine families (a few, such as optical flow, are advanced): | Family | What is in it | | --- | --- | | **Shapes** | Signed distance functions in 2D and 3D, the operations that combine them, and what turns a distance into a picture. | | **Noise & patterns** | Noise of every kind, patterns and terrain. | | **Color** | Color conversions, the blend modes (by lighten, darken, contrast…) and compositing. | | **Image & filters** | Sampling, kernels, morphology, edges, anti-aliasing and post-processing. | | **Space & camera** | Transforms in 2D and 3D, coordinates and camera. | | **Lighting & 3D** | Lighting, atmosphere, raymarching, and the maps (normal, height, displacement). | | **Math** | Curves, vectors and the small functions that every shader needs. | | **Audio & analysis** | Reading sound, optical flow and analysis. | | **Text & Sprites** | Text rendering and sprite handling. | Each family opens into groups, and a pill says how many snippets there are under it. The name of a snippet and the folder it was kept in are both searched: typing `sdf` finds the shapes. ![The Toolbox](/screenshots/toolbox.png){width=236} ## Snippet or macro? The Toolbox keeps two kinds of reusable things, and they are not the same: | | **Snippet** | **Macro** | | --- | --- | --- | | **What it is** | One GLSL function, with its helpers: **code**. | A group of nodes of a pipeline: **nodes**. | | **In a pipeline** | A node, with the inputs and the output of its function. Its code is shown by **Show Code** and, for one you wrote, changed by **Edit Code…**. | A group that you open, read and change like any other, with its own inputs and outputs. | | **In a shader** | Yes: the function is put above `main()`. | No: a macro is made of nodes, which a shader does not have. | | **Made by** | Nearly 300 come with the app; you write yours (see below). | You: select nodes, **Create Macro**. | | **Kept in** | The **Snippets** and **My Snippets** sections. | The **Macros** section. | | **When you change it** | A copy already placed keeps its own code. | The copies **follow the macro**: saving it updates them (see [Macros](/pipelines/macros#a-macro-and-its-copies)). | | **Shared** | The code is in the pipeline that uses it: nothing else to send. | The pipeline carries its copy; to give someone your macros themselves, export a pack (`.istmacro`). | A rule of thumb: if you can say it as a **formula** (a noise, a distance, a color conversion), it is a snippet. If it is **a way of wiring** nodes together (a blur with its passes, a correction with its inputs), it is a macro. A macro can hold snippet nodes, so a snippet you wrote can travel inside a macro too. A whole shader or pipeline of your library, used as one node, is something else again: see [Composing](/pipelines/composing). ## Use one **Drag** a snippet from the list onto the shader or the pipeline you have open: while you drag, the editor shows a dashed frame, *Drop to add the snippet*. In a shader the snippet is added to the fragment code, as one edit you can undo; in a pipeline it becomes a node. You can also right-click a snippet and choose **Add to Shader** or **Add to Pipeline**. The hint at the top of the list says which one the open document takes. A snippet written for a vertex shader is greyed while you edit a fragment one, and the other way round. ## See one at work Right-click a snippet in the list, or its node in a pipeline, and choose **Open Example**. The example opens in a tab of its own: a small pipeline that uses the snippet, with notes (comments) beside the nodes that say what each stage is for and what to try. Some snippets that are used together share one example. An example that needs a sound or a moving picture brings one: the audio ones listen to a sample sound, and the ones that follow motion play a sample video, until you plug your own source. An example is a copy to play with: change it, run it, break it. It is not a file, and nothing you do to it changes the example itself. When you close a tab you have changed, ISF Studio asks whether to keep your version, in your library or in any folder (**Save As**), or to let it go. Opening the example again gives you the original. ## See the code of a node Right-click the node of a snippet in a pipeline and choose **Show Code**. The box is the one a double click on a snippet of the list opens. For a snippet of the library it shows its details too; for a node that has code of its own (the ones you [write](#write-your-own), or [a pipeline import](/reference/pipeline-text) makes), it shows that code, as it is in the pipeline: a snippet you wrote has **Edit Code…** instead. ## Write your own Right-click the canvas and choose **Functions > Snippet…** (it is in the search field too). A box opens with a function to start from: change it, then press **Save** (`Cmd+Enter`). The **last function** of the code is the snippet: its parameters are the inputs of the node, its value is the output called `result`, and an `out` parameter is one more output. The functions and constants above it are its helpers, and travel with it. ```glsl float hash12(vec2 p) { return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123); } vec4 finishColor(vec3 color, vec2 fragCoord, float grainAmount) { float noise = hash12(fragCoord + fract(TIME) * 61.7) - 0.5; color += noise * 0.05 * grainAmount; return vec4(clamp(color, 0.0, 1.0), 1.0); } ``` This one is a node with three inputs (`color`, `fragCoord`, `grainAmount`) and one output, and `hash12` is its helper. Right-click the node and choose **Edit Code…** to change it later. The inputs that are still in the code keep their wires; the ones it no longer has lose them. The box tells you when the code has no function, or when another snippet of the pipeline already has a function of the same name (the helpers too) with other code (a shader has one function of a name). Undo brings the old code back. The code is kept **in the pipeline**, so the pipeline works anywhere, with nothing else installed. ## My Snippets The **My Snippets** view of the toolbox lists the snippets you kept, the newest first. They belong to your computer, not to a pipeline or a library, and every window sees them. There are three ways to make one: - **From a shader.** Select a function (and the helpers above it, if it has some) in the code of a fragment shader, right-click the selection and choose **Make a Snippet…**. A box opens with the code and the name of the function; give it a description if you like, and the same details the snippets of ISF Studio have (their sources apart): a **Version**, a **Credit** and a **License**, all optional, then press **Keep**. The credit and the license show under the description in the list, and are written as `// Credit:` and `// License:` comments above the code when you add the snippet to a shader or a pipeline, as the snippets of ISF Studio do. The entry is greyed out while nothing is selected; if what is selected is not a function, the box says what is wrong and you can put it right there. - **From a pipeline.** Right-click a snippet you wrote and choose **Save to My Snippets…**. - **From scratch.** Write one in a pipeline, then save it as above. **Drag** a snippet of the list onto the code of a shader (the function goes above `main()`) or onto the canvas of a pipeline (a node with its own code, where you drop it), or right-click it and choose **Add to Shader** or **Add to Pipeline** (the node goes in the middle of the canvas). A helper the shader already has, as it is, is not pasted again; adding it to a shader that has a function of the same name with other code is refused with the reason: GLSL has one function of a name. **Edit…** (or a double click) changes it, **Delete** lets it go. Snippets you added to a shader or a pipeline are copies: changing or deleting the kept one does not change them. If a snippet cannot be kept (the code is not a function, the disk cannot be written, you have 500 already), the box stays open and says why. If the file that holds your snippets is damaged, the app puts it aside as `my-snippets.v1.json.broken`, next to it in the folder where ISF Studio keeps its data, and starts with an empty list. ## Find one Type in the search field, or open a category. A snippet shows its code and what it takes and returns. ## In a shader Drop a snippet into the code of a shader and it is inserted there. ## In a pipeline Drop it on the canvas: it becomes a node with a port for each parameter and a `result` port for what it returns. The **Usage** of the node, in the inspector, says how it is used: - **Call immediately** (the default): the node calls the function right there, with the values wired into it, and gives the result. This is the direct way. - **Define a function**: the node only declares the GLSL function, and gives an `fn` port. Wire it to a **Call Function** node, which calls it with its own arguments, wherever and as often as you need. This is the more declarative way: one definition, several calls. The parameters are supplied by the calls, so they cannot be wired on the defined node, and the returned value belongs to the call. Changing the usage removes the connections to the ports that the node no longer has. Inside a function, only **Call immediately** is possible, since GLSL has no function inside a function. ![The Toolbox open next to a pipeline](/screenshots/toolbox-pipeline.png) ## Shapes: signed distance functions ::note A big thank you to **Inigo Quilez**. A large part of the SDF snippets comes from his work: for years he has described, derived and shared these distance functions, with clear articles and live examples. To understand how they work, and to find many more, read his articles on [2D distance functions](https://iquilezles.org/articles/distfunctions2d/) and [3D distance functions](https://iquilezles.org/articles/distfunctions/), and his other writing at [iquilezles.org](https://iquilezles.org). :: The **Shapes** family holds signed distance functions: for a point, they give the distance to a shape, **negative inside** and **positive outside**. The main groups are: - **2D**: shapes in the plane (circle, boxes, triangles, stars, arcs, heart, ellipse, and more). They take the point `p` of the pixel, centred on the origin, and the size of the shape. - **3D**: solids (sphere, box, torus, cones, cylinders, capsules, and more). They take a point in space, for raymarching. - **Operations**: combine, round, hollow, blend or displace distances (union, subtraction, intersection and their smooth versions, onion, round, morph, displace, extrude). - **Rendering**: turn a distance into something visible: **Fill Mask** and **Stroke Mask**, with anti-aliased edges. Move and scale a shape by changing the point you give it, not the shape itself: subtract a position from `p` to move it, divide `p` to scale it (and multiply the distance back, or use **Scale Distance Correction**). For a 3D shape from a 2D one, give the 2D distance to **Shapes > Operations > Extrude**, with `z` and `halfDepth`, and raymarch the result. The normals and lighting snippets then shade it. Two other snippets go well with them: **Math** has **Cubic Bezier Point** and **Quadratic Bezier Point**, which give the position on a curve at the parameter `t` (normally between 0 and 1), and **Color > Compositing > Depth Over**, which puts the surface with the greater depth in front and gives the nearest depth to the next layer. A transparent sample does not hide what is behind it. ## Maps: normal, height and displacement The **Maps** group of **Lighting & 3D** holds what a texture artist makes of a surface: a **height map** (how high each point is), the **normal map** that says which way it faces, a **displacement** that moves a picture, and the masks that come from them. They work in **tangent space**: +Z comes out of the surface, +X goes right and +Y goes up, the OpenGL convention (green up) of Blender, Unity and glTF. **Flip Normal Green** turns a map to the DirectX one (Unreal, 3ds Max). | Group | Snippets | | --- | --- | | **Height** | **Height From Image** (the luminance as a height, with contrast and bias), **Height Gradient** (the slope, by Sobel), **Height Ambient Occlusion** (a hollow is darker) and **Curvature From Height** (crests and cavities, signed). | | **Normal** | **Normal From Height Map** (from the red channel of a height texture), **Tangent Normal From Heights** (from four heights, when the height is code and not a picture), **Normal To Color** and **Color To Normal** (between -1 to 1 and 0 to 1), **Flip Normal Green**, **Blend Normals (RNM)** (the detail of one map on another, reoriented along the base) and **Normal Strength**. | | **Displacement** | **Displace UV** (a height moves the coordinates), **Normal Offset UV** (a cheap refraction), **Parallax Offset** (a flat picture with depth) and **Parallax Occlusion UV** (a ray marched through the height field, up to 64 layers). | | **Mask** | **Slope Mask** (steep parts from the normal: rock on slopes, snow on flats). | | **Depth** | **Linearize Depth** (a depth buffer value as a distance) and **Depth To Unit** (a distance as a 0 to 1 depth map). | **Strength** in the normal snippets is how many pixels tall a height of 1 is: at 1 the relief is gentle, at 32 it is deep, and at 63 on a 64-pixel ramp it is a slope of 45 degrees. ### A normal map from a height, as a file A height is drawn in a first pass, kept in a **float** target, and a second pass turns it into a normal. The preview shows it as colors (a normal has negative numbers, which the screen draws as black), and the [snapshot](/shaders/preview#floating-point-pictures) as an **OpenEXR 32-bit float** with **Values** set to **As drawn** keeps the normal as it is, from -1 to 1. ```glsl /*{ "DESCRIPTION": "A normal map of a height", "ISFVSN": "2.0", "CATEGORIES": ["Generator"], "INPUTS": [ { "NAME": "strength", "TYPE": "float", "DEFAULT": 24.0, "MIN": 0.0, "MAX": 64.0 } ], "PASSES": [ { "TARGET": "height", "FLOAT": true }, { } ] }*/ // Toolbox: Lighting & 3D > Maps > Height > Height Gradient, Lighting & 3D > Maps > Normal > Normal From Height Map // (drop them above main, or onto the canvas of a pipeline). void main() { if (PASSINDEX == 0) { // Any height will do: here, a field of bumps. For a picture, use Height From Image. vec2 p = isf_FragNormCoord * 6.0; float h = 0.5 + 0.5 * sin(p.x * 3.14159) * sin(p.y * 3.14159); gl_FragColor = vec4(vec3(h), 1.0); } else { gl_FragColor = vec4(normalFromHeightMap(height, isf_FragNormCoord, RENDERSIZE, strength), 1.0); } } ``` The same two passes make a **displacement** or a **height** file: write the height in the last pass, and save it as a 32-bit float so that no step shows when the engine reads it. # Shaders and pipelines inside pipelines URL: https://isf-studio.app/pipelines/composing Shaders and pipelines of the library can be reused as parts of a graph. To reuse **a part of a graph**, a group of nodes, see [Macros](/pipelines/macros). ## Shaders as nodes Drag a `.fs` from the explorer onto the canvas. It becomes a node whose inputs are ports, and whose output is its picture. Its vertex shader, if any, comes with it. ## Pipelines as nodes Drag a `.istpipe` onto another pipeline: it becomes a node as well. ISF Studio refuses a pipeline that would contain itself. The embedded graph keeps its loops and shading. Its compiled copy is refreshed from the source pipeline when the composition compiles, including when reopening a composition saved by an older build. Double-click the body of a pipeline node, or choose **Open Source Pipeline** from its context menu, to open its source document. The source must still exist in the opened folder. Double-clicking the title still renames the node. The composition refreshes the source's inputs, types and defaults when it recompiles, including when you return to its tab: they show at once, and the composition does not need to be saved first. This also reads unsaved edits from an open source pipeline. It does not continuously refresh an inactive composition. ## In a function, an If or a loop A shader, a pipeline or a macro can sit inside a **Function**, an **If** or a loop, like any other node. Its passes, its imported images and its inputs still belong to the whole pipeline: a multi-pass pipeline renders all its passes every frame, and the container only decides when its result is read. ## Staying up to date A node remembers the shader it came from. When that shader changes, the node is updated the next time the pipeline compiles. If the shader is gone, or comes from somewhere else, the node keeps its own copy and keeps working. A shader you move or rename in the explorer is not followed by the nodes that use it. They keep their copy, which is safe, and you can drag the shader in again. ## Images An image dropped on the canvas is **copied into the `.istpipe`**. The pipeline will not break if the original file does. Images imported by an embedded pipeline also appear as imports in the composition's inspector and gallery. When the composition does not hold an archive copy, its preview loads the image from the relative path declared by the embedded shader. Keep those images available in the opened folder. ## Sharing A pipeline that contains shaders contains their code too: it is one file, and you can send it as such. See [Sharing](/library/sharing). # Macros URL: https://isf-studio.app/pipelines/macros A **macro** is a part of a pipeline that you keep under a name, to use again in other pipelines: a blur you like, a colour correction, a noise you always build the same way. Where a shader or a pipeline of your library is a node by itself (see [Composing](/pipelines/composing)), a macro is **a group of nodes**: once placed, it is a group of the pipeline, with its own inputs and outputs, that you can open and read. A macro is made of **nodes**. For a piece of **code** (one GLSL function, such as a noise or a distance), a [snippet](/pipelines/snippets-and-toolbox#snippet-or-macro) is the right tool, and it can also go into a shader. ## Make a macro 1. Select the nodes that make the macro, on the canvas. 2. Right-click one of them and choose **Create Macro**, or press `Cmd+M` (`Ctrl+M` on Windows and Linux). 3. Give it a name and press **Create Macro**. The nodes become a group, and that group is the first use of the macro. A group that you have already named yourself becomes a macro under that name, with no question asked. A macro keeps the images its nodes use: it does not depend on a file of your library. ### A macro with a function A **Function** node can be part of a macro, with its parameters, its inputs and its return: they are kept as they are, and every copy has its own function. Two things to know: - The **parameters of a function stay inside it**: they are not ports of the macro. A macro has the ports of its group: to give the macro an input or an output, wire it to a group input or output, as in any group. - The macro shows the **parameters of its function** on its left side, before its own inputs, as a function node does: they are there to be read, not wired (the call gives them). - A function is used through its **`fn`** output. If the call (**Call Function**) is in the macro too, nothing else is needed. If the call is **outside**, wire the `fn` of the function to a group output of the macro (type `fn`): the call placed after it takes the parameters of the function. ## Where macros are Macros are not in your library, and not in the explorer. They are kept by ISF Studio, for you: **the same ones in every window and every library**. A macro made in one window is in the others at once. Open the **Toolbox** (the second activity of the bar on the left): its **Macros** section lists them, above the snippets. The search field of the Toolbox finds them by name, or by the name of the group they are in. ### Arrange them in groups Macros live in a tree of **groups**, like folders: - Right-click the empty part of the list, or a group, and choose **New Group**. - Drag a macro, or a group, onto another group to move it. Drop it on the empty part of the list to bring it back to the top. - Right-click a macro or a group to **Rename** it, or **Delete…** it. A deleted macro goes to the trash of your computer. Moving or renaming a macro does not break the pipelines that use it: they find it again. ## Place a macro in a pipeline - Right-click a macro in the Toolbox and choose **Add to Pipeline**; or - right-click the canvas, and choose the macro in the **Macros** submenu of the add menu, which comes last. The macro is placed as a group, in the middle of the view or where you right-clicked. The first one takes the name of the macro, the next ones are numbered. Placing a macro is one step of the history: it can be undone. Macros are not offered in the vertex graph. ## A macro and its copies A macro placed in a pipeline is a **copy**: the pipeline holds the nodes of the macro as they were when you placed it, so the pipeline works, and can be shared, whatever happens to the macro afterwards (see [Sharing](/library/sharing)). It also remembers which macro it comes from, and tells if the macro has changed since: | State | What it means | | --- | --- | | **Linked** | The macro is as it was when the copy was made. | | **Outdated** | The macro was changed since: the copy takes it in by itself, in the pipeline in front (see below). | | **Missing** | The macro is not there any more: deleted, or this computer does not have it. The copy keeps working as a group. | Right-click a copy in a pipeline: - **Edit Macro** opens the macro itself in a tab, like a pipeline. Every pipeline that uses it is told that it changed. It is not available when the macro is missing. - **Update from Macro** takes the macro as it is now into the copy: its ports and its nodes. It is only available when the macro is outdated, which is rare, since the copies follow the macro by themselves. A connection is kept when the new macro has a port of the same name and the same type, and dropped when it has not. It is one step of the history. - **Make Unique** cuts the copy from its macro: it becomes a group like any other, and later changes of the macro no longer reach it. The copies **follow the macro**: when a macro is saved, every copy in the pipeline in front takes it in, and a pipeline that was behind does it when you open it. A copy that sits inside a group, or inside another macro, follows too: when a macro changes (new inputs, say), the copies of the macros that hold it take the change in, with no need to open the group or to open and save the outer macro first. **Update from Macro** is available on a macro that holds a macro that changed. Each update is one step of the history, so it can be undone, and **Make Unique** is what keeps a copy as it is. ## Change a macro **Double-click** a macro in the Toolbox, or choose **Edit Macro**: a notice says that this opens the macro itself, then it opens in a tab, and you edit it as any pipeline. Save it, and the pipelines that use it take the change in (see above). **Double-click a copy** in a pipeline, and ISF Studio asks what you mean, since editing it here is not the same thing as editing the macro: - **Edit Macro** changes the macro for every pipeline that uses it. - **Make Unique** cuts this copy from the macro, and opens it, to change this one only. The question can be switched off with **Do not show again**. ## Share macros Macros are kept by ISF Studio, not in your library, so they are shared as files: - A **macro** on its own is a `.istpipe` file. - Several macros, with the groups they are in, are a **macro pack**: a `.istmacro` file. ### Export Right-click in the Toolbox, in the **Macros** list: - **Export Macro…** on a macro saves it as a `.istpipe`. - **Export Group…** on a group saves it, and what is inside it, as a pack. - **Export All Macros…** on the empty part of the list saves every macro as a pack. It is also a backup of your macros. The file keeps the images a macro uses, so it works on any computer. ### Import Any of these: - **File > Import > Macros…**, then choose a `.istmacro` or a `.istpipe` file. - **Double-click** a `.istmacro` file: in the explorer, where packs are listed like any file of your library, or in the file manager of your computer. A dialog says which macros come in, and asks what to do about the ones that are already there. - Drag a file onto the **Macros** list of the Toolbox. - In the explorer, right-click a `.istpipe` that is a macro (one you exported) and choose **Add to Macros**. A pack goes into a group named after it, so that what comes from two packs does not mix. A macro on its own goes to the top. The groups of the pack, the empty ones too, come with it. A `.istpipe` that is not a macro (a pipeline made of one group is a macro, any other is not) is refused, and ISF Studio says so. ### When a macro is already there Each macro has an identity of its own, kept in its file. ISF Studio compares what you import with the macros you have: | What it finds | What happens | | --- | --- | | Nothing like it | The macro is added. | | The same macro, as it is | It is left out: nothing changes. | | The same macro in another version | You choose **Replace**, **Keep both** or **Leave out**. Replace is what an update is. The copies in your pipelines then show as outdated, and you update them when you want (see [A macro and its copies](#a-macro-and-its-copies)). | | Another macro with the same name | You choose the same three. Keep both gives the new one a number: `Blur 2`. | Nothing is replaced without your word when a choice is asked, and what you replace goes where the old macro was, even if you moved it. Macro packs can also be put online by the project's [Add-ons](/add-ons): the page lists them with the other add-ons. ## In the editions Making, arranging, placing and **importing** macros is part of what is free, and has no limit of its own in any edition. **Exporting** macros, as a file or a pack, needs ISF Studio Pro, like the export of shaders and libraries (see [Pricing](/licensing/pricing)). # Resources URL: https://isf-studio.app/media/resources The third activity, **Resources**, holds what you can feed to an input: your cameras and microphones first, then your MIDI devices, the OSC server and the pointer, and then the sample media that come with Studio. The first view is open and the others are folded; open one with its chevron. ![The Resources activity](/screenshots/resources.png){width=236} ## Sample media Studio brings a few files to play with, in the **Sample Media** view, under your own cameras and microphones. The view is folded until you open it, and it holds four groups, each with the number of files it holds: | Group | What it holds | | --- | --- | | **Test Charts** | Pictures made to show what a filter does: SMPTE Color Bars (what an image input plays until you give it another source), PLUGE (to set the brightness of a screen), Gray Ramp (banding and steps), Color Checker (24 patches), Hue Spectrum, Geometry Grid (circles and safe areas), Checkerboard and Zone Plate (from coarse to the finest detail the pixels hold), and the Color, Frequency and Optical Stress Tests. | | **Sample Images** | Parrot and Cyberpunk, two photographs to try a filter on. They are also what a transition goes from and to (its `startImage` and `endImage`) until you give it other pictures. | | **Sample Audio** | Beat (a loop at 120 bpm that builds up), Dark Beat (a dub techno groove at 96 bpm: a short low kick that comes broken, a thud, swinging hats, metal hit in a room, a chord that is only a pulse and its echo, and the dust of a record; its lows, mids and highs each move on their own), Dark Pad (slow chords that are not quite consonant, in the middle of the spectrum, wobbling as a tape does), Dark Sweep (a narrow, shivering band of noise that crosses the mids and stays in the highs), Pad (slow chords), and sounds that make an audio input move in a way that is easy to read: Sweep, Tones, Ticks, Noise, Pan and Levels. In a **Drones** subgroup, twelve slow, continuous sounds, from the lows to the highs: Drone, Low, Dark, Rumble, Hollow, Choir, Wide, Pulse, Metal, Industrial, Glass and Air. Each one covers another part of the spectrum, so a shader that listens to the highs has something to read. In an audio input's menu they are in a **Drones** submenu. | | **Sample Video** | Big Buck Bunny (© Blender Foundation, CC BY 3.0). | The sounds fold in two subgroups, **Basics** (Beat, Sweep, Pad, the three dark ones and the test sounds) and **Drones**. In the menu of an input they are submenus too: the pictures in **Test Charts** and **Sample Images**, the sounds in **Basics** and **Drones**, apart from the folders of your library. Click a file to open it in a tab, as a picture, a sound or a video of your library (nothing is written: they are not files of the folder). Drag one onto an input of the [input controls](/shaders/input-controls) that can take it, and it is given as if you had picked it in the input's menu: a picture or a video on an image input, a sound on an audio input. The input lights up while the file is over it. The sounds are synthesised for ISF Studio and free to use (CC0). Use any of them as the source of an `image`, `audio` or `audioFFT` input, in the [input controls](/shaders/input-controls). ## Cameras and microphones Studio lists the cameras and microphones of your computer. Use a camera as the source of an image input to see your shader work on live video. The system asks for permission the first time. ## MIDI The **MIDI** view lists the MIDI devices of your computer: controllers, keyboards, pads, and the software ones too (the IAC bus of macOS, a virtual cable). Studio reads them with the system's own MIDI, so a device is there as soon as the system sees it. It works as the cameras do: - A device that is plugged in is listed by itself, and the number on the view says how many are there. - The last message it sent shows under its name (`CC 74 · ch 1 · 0.79`, `Note C4 on · ch 1 · 1.00`), so you can see it answer. - The ports a controller exposes for the control of a DAW (**HUI**, **Mackie Control**) are left out: they carry the protocol of the DAW, not what you play. The *Launch Control XL* lists a *HUI* port besides its own, for instance. - A device you unplug stays in the list **in red**, and comes back to normal when you plug it in again. The trash icon on a red device forgets it. Studio looks for devices once a second, so a device you plug in shows within a moment. A device another application holds open is listed, and listened to when it is free. To drive an input with a device, right-click the input and choose **MIDI · Learn…**: see [MIDI](/media/midi). ## OSC The **OSC** view is the server that receives OSC from another application: TouchOSC, Max, Ableton, a lighting desk. It is **off** until you turn it on, since listening to the network asks the system to allow incoming connections. Then it says where to send (`192.168.0.12:9000`, the address of your computer and the port), who sends, and the addresses that came, with the last value of each. To drive an input with an address, right-click the input and choose **OSC · Learn…**: see [OSC](/media/osc). ## Pointer The **Pointer** view lists your mouse, pen or finger as a source, like a camera. Its pad shows what it gives while you move, press or draw on it: the position, the pressure, the tilt of a pen and its twist. [Bind](/shaders/input-controls#bind-an-input) a `float`, a `long` or a `point2D` input to it with a right click. ::note The **pressure** is real only with a pen, or a screen that tells how hard you press. A mouse says nothing of it: Studio gives 1 while its button is down. The trackpad force of a Mac is not given to the page. :: ## Using a resource In the [input controls](/shaders/input-controls), an `image` input offers a choice: a sample picture or video, an image of your library, or a camera; an `audio` input offers a sample sound, a sound of your library, or a microphone. The choice is for playing with: it is not written in the shader. ::note What you play with in Studio is for trying things out. An application that plays your shader decides for itself what it sends to the image inputs. :: # Export a video URL: https://isf-studio.app/media/video-export Any shader or pipeline can become a video: **File, Export Video…**, or the red dot in the toolbar of the preview. The file is an **MP4** (H.264, with AAC sound when there is some), which most players and editors can open, or, with **ISF Studio Pro**, a **ProRes** video in a `.mov`, for editing. ::warning **A ProRes from Studio is a 10-bit file of an 8-bit picture.** Studio draws the picture in 8 bits per channel, as the preview shows it, so the ProRes has the format and the quick editing of a ProRes, but neither more tones than the preview, nor a high dynamic range, nor a transparency. A smooth gradient can show bands that a 10-bit picture would not. The 4444 profiles are 4:4:4, which spares the color of fine edges, nothing more. :: ::note Exporting a video is open to every edition up to 1280 × 720 and 10 seconds, as MP4. Any other size or length, and ProRes, need **ISF Studio Pro**, trial included. See [Pricing](/licensing/pricing). :: ## The dialog | Setting | What it is | | --- | --- | | Format | **MP4 (H.264)**, or one of the six **ProRes** (Pro): 422 Proxy, 422 LT, 422, 422 HQ, 4444 and 4444 XQ. | | Size | When rendering, the size of the preview, a usual size (1280 × 720, 1920 × 1080, 2560 × 1440, 4K, square, portrait) or your own, from 16 to 8192 px on a side. Sizes are even numbers: the formats ask for it. A live recording has the size of the preview. | | Frame rate | 23.976, 24, 25, 29.97, 30, 48, 50, 59.94, 60, 120 or 240 fps. Always constant, never variable. | | Length | Written as `HH:mm:ss`, up to 24 hours. A shader has no end: you say how long to render. A live recording says how long it lasts **at most**: you stop it when you want. | | Direction | **Forward**, **Reverse** (from the end of the shader back to its start) or **Ping-pong**, also called a boomerang (forward to the middle of the video, then back). Only for a render: see [Direction](#direction). | | Warm-up | Only for a render forward of a shader that keeps its state: frames the shader runs first and leaves out of the video. See [Warm-up](#warm-up). | | Loop | **Check loop** draws a few small frames and tells whether the end of the video joins its start. Only for a render forward: see [Loop check](#loop-check). | | Quality | For an MP4: high, medium or low. A ProRes has no choice of quality: each profile has its own rate. The dialog says "up to N MB" before you start, and warns when the disk is too small. | | How | **Render** (frame by frame, the default) or **Record live**: see below. | | Sound | **Render**: one box for each sound of the shader, tick the ones to put in the video. **Record live**: a **Sound under the video** menu, to pick a microphone or a sound file. It starts as the sound the shader is listening to. | | Save as | Next to the document by default (`name 2.mp4` if the name is taken), or **Choose…**. | The settings most renders leave alone (**Direction**, **Warm-up**, **Loop**) are folded in the dialog: each one is a line that says what it is set to, and opens when you click it. ## Render: frame by frame A render draws each frame for its own moment: frame 300 of a 30 fps video is what the shader shows at the tenth second, however long the computer took to draw it. A heavy shader makes a longer render, never a jerky video, and the same shader with the same settings gives the same video every time. It is usually faster than the video lasts. While it renders, Studio stays usable: the frames are drawn a few at a time so the interface does not freeze, even at 4K. - **Images** and **videos** that feed the inputs are used as they are. A video plays from its start, at the pace of the video. Every image the shader reads is loaded before the first frame, so the first frames are not drawn without it. - **Sounds** are analysed for each frame, so a spectrum follows the music exactly. The sounds you ticked are mixed into the video. - There is **no alpha** in the file, ProRes 4444 included: a shader is drawn as the preview shows it without a background, so a transparency comes out opaque. A render **cannot replay what only happens once**. A shader that listens to a **camera** or a **microphone** is not rendered: the dialog switches to **Record live** by itself. Inputs [bound](/shaders/input-controls#bind-an-input) to the mouse, to a MIDI control or to an OSC address do not force it: a render takes the values they have **at that moment** and holds them for the whole video. To film them move, choose **Record live**. ## Direction A render can run the shader the way it runs, backwards, or forward and back: - **Forward** is the shader as it runs. - **Reverse** draws the last frame first, and the first frame last. - **Ping-pong** goes forward until the middle of the video, then comes back. The length you choose is the length of the video: a ping-pong of ten seconds shows five seconds of the shader, forward, then back. The way back stops one frame before the start, so when the video plays again nothing is shown twice: it loops without a jump. A shader that keeps what it drew from one frame to the next (a **persistent** pass: a feedback, a trail, an accumulation) can only be rendered forward: each of its frames depends on all the ones before, so it cannot be drawn backwards. **Reverse** and **Ping-pong** are greyed out for it, and the dialog says why. Render it forward and turn the video round in an editor if you need to. A sound the shader listens to is analysed once before the render, so a spectrum follows the music exactly in any direction. **The sound in the video.** When the direction is not forward, a box under **Sound** says which way the sound goes. Ticked, the sound goes with the picture: backwards in a reverse, forward then back in a ping-pong, without a click at the turn. Not ticked (the default), the sound plays forward from the start of the video whatever the picture does. ## Warm-up A shader that keeps what it drew from one frame to the next (a **persistent** pass: a feedback, a trail, an accumulation, a smoothing of the sound) starts from empty buffers: its first frames are black, or without the trail or the smoothing that the following ones have. For such a shader, the dialog shows **Warm-up (frames)**. The shader runs that many frames before the video starts and **leaves them out**. The video starts that long *into* the shader, already running, and the sound starts there too. At 30 fps, 90 frames are three seconds. Try one to three seconds for a feedback or an accumulation; a smoothing of a few tenths of a second needs a few frames only. - The frames of the warm-up are drawn, so a render takes that much longer. - For a loop, make the length of the video the length of the loop: if the shader repeats over that length, the video repeats too, wherever it starts. A feedback that is not periodic cannot be made to join its end to its start by this alone. - It is not offered in a **Reverse** or a **Ping-pong**, nor in a live recording, which shows the preview as it plays. ## Length that follows the loop When something in the document comes back to where it began after a while, the dialog offers lengths that are whole turns of it, under **Length**: a line says what it found (`Loop 10 s · Sound music 30 s`) and the buttons are 1×, 2×, 3× and 4× the length at which everything has come back at once (the least common multiple, in frames at your frame rate). A click puts one in the field; nothing is set otherwise, and you can type any length. A length that is not a whole number of turns is flagged, because the end would not join the start. It reads three things: - **A `float` input marked as a loop length**: tick **Length of a loop, in seconds** in the input's dialog (or write `"LOOP": true` in its header). Its value now is the length. - **The snippets that make a loop** (Loop Phase, Loop Crossfade, Ping-Pong): the number wired to their `duration`, an input (its value now) or a constant. A length that is computed from other nodes cannot be read. - **Sounds and videos set to loop**: their duration. If the loops never line up within the longest video the edition allows, or one of them is not a whole number of frames at the frame rate (10 s at 29.97 fps is 299.7 frames), the line says so and gives the longest one. ## Loop check For a video that will play again and again, **Check loop** tells whether the end joins the start. It looks at **one loop**: the length the dialog found for the loop (see above), else the video. It draws a few small frames and compares them: - **The jump** is the change from the last frame to the first, which is what the eye sees where the video starts again. It is told in *normal steps*: the change from one frame to the next. About one step is a loop nobody sees. - **One loop later** is how far the shader is from showing its first frame again after the last one. 0 is the same picture. The answer is one of four: nothing moves, it loops, it almost loops (the join can be seen if one looks for it), or it does not loop. Under it, the check says what in the shader decides it: a persistent pass (a state that has to be forgotten, see [Warm-up](#warm-up)), `FRAMEINDEX`, random numbers drawn from `TIME`, a sound or a video that has to loop over the same length. It cannot tell what a shader does with `TIME`; that is what the drawn frames are for. A shader that keeps its state, or listens to a sound, has to be drawn from its first frame. When that would take more than a few seconds the check stops and says so, and tells only what the shader holds: set the length to one loop to check it. **Stop** ends a check. **Blend the end into the start** is for a shader that cannot loop by itself (a feedback that never settles, a camera that travels, a sound that does not join). The last N frames of the video, **and their sound**, melt into the N frames that came right before the first one, so the last flows into it: no jump of the picture, and no click where the sound starts again (the two sounds are mixed at equal power, sample by sample). The video keeps its length. Those N frames are drawn after the warm-up, so a shader that keeps its state has settled when they are drawn: the render draws the warm-up, then N frames, then the video. **Smoothness** goes from a straight blend (0) to a soft curve (1). Each of the N frames is a picture kept until the end: in memory while they fit, in a scratch file of the app (removed when the render ends) for a very large video. The most depend on the size and on the room left on the disk: 240 at 1080p, about 190 at 4K, 40 at 8K. **Playing the loop.** The file is exact: the sound starts with the first picture and ends with the last one, to the sample (the delay an AAC encoder puts before a sound is measured on your computer and cut off, and what it adds after is dropped). Studio's own player, **Loop** on, plays it with no gap. Most other players restart the file when it ends, which leaves a gap of some milliseconds (about 13 ms in the browser's `