NyrexVJ
Contents

Getting started

Playing visuals

Music and motion

Your own content

Output and recording

Live control and shows

Reference and help

Manual / Your own content

Your own shaders

Chapter 16 of 38 · 4 min read

#Making a shader clip

Any fragment shader can become a clip. Put a .glsl, .frag or .fs file into the shaders folder, or drag the file onto the window. It shows up in the Library as Shader: file name, under the filter Shaders. It works like every other clip: Speed, Scale, colours, effects, audio, LFOs and macros all apply.

NyrexVJ looks at the folder once a second. A saved change reloads the shader while it plays, so you can edit the file in any text editor. If the shader does not compile, the Clip window shows the message with the line number of your file and the last working version keeps running. Library, Create example shader writes a small shader to start from.

#Two styles

A file with a void main() is a NyrexVJ style shader, a file with a mainImage function and no void main() is a Shadertoy style shader. NyrexVJ finds out by itself. In the NyrexVJ style these names are ready to use: vUv, uRes, uTime, uBeat, uBpm, uColorA, uColorB, uAudio with bass, mid, high and level, uKick, and the helpers spec(x) and wave(x) for the spectrum and the waveform. In the Shadertoy style iResolution, iTime and iChannel0 for the audio are available.

The full list of names, helpers and limits is in the document docs/SHADERS.md of the project.

#Transparency and several passes

A line #pragma nyrexvj alpha makes the clip transparent. Sections called buffer a to buffer d, image and channel turn the file into a multipass shader with feedback, like Shadertoy. Images and videos from the Library can be used as inputs. A file without such a line behaves exactly as it always did.

#ISF files

ISF files, the format of VDMX and others with a header between /*{ and }*/, are read from the same folder. A file with an inputImage input becomes an effect named ISF: file name. Any other ISF file becomes a clip. The inputs of the file show as controls in the Clip window, or as the four controls of the effect. What an ISF file cannot do, like vertex shaders, transitions and audio inputs, is listed in the Clip window.

#Controls for your shader

A shader can declare its own sliders and switches with #pragma nyrexvj param. They appear in the Clip window under Shader controls. A right click resets a control to the default of the file, and Reset controls resets all of them.

#The shader editor

Creator, Shader editor opens a window with a text editor on the left, a live preview on the right and a list of problems below the text. In the Clip window of a shader file, Edit in shader editor opens that file. New starts from one of four templates, Open lists the files of the shaders folder, and the buttons Save, Save as, Reload from disk, Undo, Redo and Compile now do what they say. Live preview switches the preview and the compiling off.

The editor does not have a search, several open files, autocompletion or a debugger. Text over 256 KiB is refused.

Found a mistake or something missing? Tell us on GitHub. The same manual is built into the program, so you have it without internet. Open it with F1 or from the Help menu, then User manual.