Video OpenGL Shader

OpenGL shader player,compatible with single pass interactive shader format, shadertoy, glsl sandbox shaders with generally few adaptations.

shader example

In Usine, the openGL shader is made of a vertex, a fragment containing eventually interactive shader format definitions, and a header containing various definitions and compatibility settings.

shader editor

It's outside the purpose of the manual to teach you how to create a shader but you can start with examples of the library. There are 3 kind of examples:

  • draw: simples shaders which are drawing images with optional mouse interaction.

  • isf: Interactive Shader Format shaders with extra inputs on the modules according to the ISF definitions. isf-example

  • fx: shaders which are transforming an input image and contain a video input inlet. fx-example

The header contains the following compatibility definitions. It can be changed by editing the file /Resources/Templates/Shaders inside the application folder.

/////////////////////////////////////////////////////////////////////////////////
// compatibility with Sandbox
uniform float     time;                 // shader playback time (in seconds)
uniform vec4      date;                 // current date vec4(Y,M,D,S)
uniform vec2      resolution;           // viewport resolution (in pixels)
uniform vec2      mouse;                // mouse pixel coords. xy: current 
uniform float     mousedown;            // is 1.0 if mouse is down 0.0 otherwize
uniform int       frame;                // shader playback frame
uniform float     timedelta;            // render time (in seconds) 

//////////////////////////////////////////////////////////////////////////////////
// compatibility with shadertoy 
#define iMouse vec4(mouse.x*resolution.x,mouse.y*resolution.y,mousedown,mousedown) 
#define iTime time 
#define iTimeDelta timedelta
#define iResolution vec3(resolution.x,resolution.y,0.0) 
#define iChannel0 backbuffer
#define iFrame frame
#define iDate date

//////////////////////////////////////////////////////////////////////////////////
// compatibility with ISF 
#define RENDERSIZE resolution  
#define FRAMEINDEX frame
#define TIME       time 
#define TIMEDELTA  timedelta             
#define isf_FragNormCoord (gl_FragCoord.xy/resolution.xy) 

//////////////////////////////////////////////////////////////////////////////////
// Usine inputs
uniform sampler2D backbuffer;           // background texture
uniform vec2      surfaceSize;          // surface resolution (in pixels) = resolution

Settings

on

Activates or deactivates the module.

process time

Total time used for the calculation of the module.

video out

Video output flow(s).

speed

Overall speed of the shader.

  • 1 = normal speed
  • 0.5 = half speed
  • 0 = stopped
  • 10 = 10 times faster

restart

Restarts the shader (sets the time uniform to 0).

render width

Width in pixels of the shader video output.

render height

Height in pixels of the shader video output.

open shader editor

Opens the shader editor window.

file name

File name of the shader fragment to open.

Common Settings

info

show manual

Opens the web browser to display information or help about the selected object, if it exists.

For more details about information/help creation, see create-help-file.

description

Description of the module for internal help purposes only. The description is not displayed in the interface.

ID's

visible only in god mode, see setup-panel-tab-expert.

unique ID

Current private ID for this control used to identify the object.

preset ID

Current private preset ID for this control used for presets.

recreate ID

If you experience difficulties in Polyphonic mode, try to recreate new id(s) with this button.

repair ID s

Each Patch shared on the local network uses its own ID (identification number). If you experience issues of Patches that don't send information to the good target, this button will rebuild all these id's.

Object Remote Address

absolute

Absolute remote address. see objects-address.

local

Local to the current patch remote address. see objects-address.

user addr

User defined remote address. see objects-address.

See also

version 7.0.250121

Edit All Pages