These are parameters that KodeLife treats specially and that usually either use values from KodeLife's internals or require special handling by the application each frame update.
The clock parameter provides a flexible timing mechanism with lots of configurability for driving animations.
The current date as year, month, day, current time in seconds
The current time as hour, minute, seconds, milliseconds
A noise texture generator
Sequence number of the current frame being rendered
Delta time between current and previous frame, in milliseconds
Project's master output frame resolution in pixels
A two dimensional texture sampler for the most recently rendered master output frame.
A two dimensional texture sampler for the most recently rendered frame (either color or depth attachment) of a render pass.
The selection Render Pass
allows to select any of the other render passes present in the project directly, or the Previous
one, meaning the render pass directly preceding the current one in the project. If the selected render pass is the current one, the most recently rendered frame will be used.
A two dimensional texture sampler for the most recently rendered frame of KodeLife's text editor
A render pass' model matrix as specified in the Kontrol Panel's render pass Transform section.
A normal matrix calculated from a render pass' model matrix as specified in the Kontrol Panel's render pass Transform section.
A render pass' view matrix as specified in the Kontrol Panel's render pass Transform section.
A render pass' projection matrix as specified in the Kontrol Panel's render pass Transform section.
A model-view-projection matrix calculated from a render pass' model, view and projection matrices as specified in the Kontrol Panel's render pass Transform section.
The currently configured sample-rate of KodeLife's audio subsystem
A vector of three floating point values representing the power of three configurable bands of the currently playing/incoming audio signal
A two-dimensional texture image containing all values of a spectrum analysis performed on the currently playing/incoming audio signal
A simple mouse state representation
A two dimensional texture image containing all standard MIDI message values most recently received on a selected or all channels combined.
All possible MIDI messages for one channel are layed out in the texture in the same order as listed here: https://www.midi.org/specifications-old/item/table-1-summary-of-midi-message
Thinking of the texture as a linear array, the messages are written to the array as follows:
NOTE OFF | texture[0 * 127 + note] = velocity |
NOTE ON | texture[1 * 127 + note] = velocity |
POLYPRESSURE | texture[2 * 127 + note] = pressure |
CONTROLCHANGE | texture[3 * 127 + controller number] = controller value |
PROGRAMCHANGE | texture[4 * 127] = program number |
CHANNELPRESSURE | texture[4 * 127 + 1] = pressure value |
PITCHBEND | texture[4 * 127 + 2] = value |
Note: If a NOTE OFF message of any velocity is received, the corresponding NOTE ON entry at index note will be set to zero and vice versa.
To retrieve it's easiest to use "texelFetch" and integer coordinates:
ivec2 midiCoord(int offset)
{
int x = offset % 32;
int y = offset / 32;
return ivec2(x,y);
}
Thus reading the value of a controller:
int ccNumber = 0;
texelFetch(midiTexture, midiCoord(3 * 127 + ccNumber), 0);
Or using the regular texture sampling function:
texture(midiTexture, vec2((1./32.) * midiCoord(3 * 127 + ccNumber)));
A two dimensional texture image containing all current values for one of maximum four connected standard game controllers.
Recognized game pads are mapped to a standard Xbox 360-like controller layout: A directional pad, two analog sticks, four buttons on the right (often called A, B, X, Y), shoulder buttons (two of which might be axes) and three buttons in the middle (Start, Back and usually some kind of logo-button).
If your game controller is not recognized, it is possible to update the database of mappings by placing a file following SDL2's game controller db format in KodeLife's configuration and log file directory.
KodeLife will look for a file called "gamecontrollerdb.txt" on startup and load and apply that configuration if found.
See Preferences | General for a Show logs shortcut to reveal the location of this directory.
Thinking of the texture as a linear array, the inputs are written to the array as follows:
Index | Value |
---|---|
0 | Gamepad connected |
1 | STICK_LEFT_X |
2 | STICK_LEFT_Y |
3 | STICK_RIGHT_X |
4 | STICK_RIGHT_Y |
5 | TRIGGER_LEFT |
6 | TRIGGER_RIGHT |
7 | BUTTON_UP |
8 | BUTTON_DOWN |
9 | BUTTON_LEFT |
10 | BUTTON_RIGHT |
11 | BUTTON_A |
12 | BUTTON_B |
13 | BUTTON_X |
14 | BUTTON_Y |
15 | BUTTON_STICK_LEFT |
16 | BUTTON_STICK_RIGHT |
17 | BUMPER_LEFT |
18 | BUMPER_RIGHT |
19 | BUTTON_START |
20 | BUTTON_SELECT |
21 | BUTTON_HOME |
We use cookies to deliver website content. By continuing without changing your preferences, you agree to our use of cookies.