Built-in Uniforms
The following uniforms are available for all the passes, and are compatible with Shadertoy’s conventions:
vec3 iResolution
Viewport resolution (
z
is pixel aspect ratio, currently always set to1.0
).
int iFrame
Current frame index.
float iTime
Current time, in seconds.
float iTimeDelta
Time passed between the render start of the previous, and the current frame, in seconds.
float iFrameRate
Number of frames rendered per second.
vec4 iDate
x
- Yeary
- Monthz
- Dayw
- Time of day, in seconds.
vec4 iMouse
abs(zw)
- Pressed mouse position.z > 0.0
- Is mouse currently down (true for multiple frames).w > 0.0
- Is mouse down started at the current frame (“pressed” event, true for a single frame).Note that when mouse is down / pressed atx = 0
ory = 0
, a small delta (0.0001
) is added toz
orw
, in order to keep the checks above correct.
sampler2D iChannel#
Channel# sampler.
float[] iChannelTime
Channel time, in seconds (for
.gif
, orTextureSequence
bindings).
float[] iChannelDuration
Channel duration, in seconds (for
.gif
, orTextureSequence
bindings).
vec3[] iChannelResolution
Channel resolution.
- Viewer Uniforms
The following uniforms are mostly needed for the Viewer Pass, but are also available for all the passes.
sampler2D iViewerChannel
Selected pass framebuffer sampler.
vec3 iViewerChannelResolution
Selected pass framebuffer resolution.
float iViewerScale
Viewer transformation scale.
vec2 iViewerOffset
Viewer transformation offset.