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 to 1.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 - Year
    y - Month
    z - Day
    w - Time of day, in seconds.
  • vec4 iMouse
    xy - Current mouse position (when Shader.Mouse input matches).
    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 at x = 0 or y = 0, a small delta (0.0001) is added to z or w, in order to keep the checks above correct.
  • sampler2D iChannel#

    Channel# sampler.

  • float[] iChannelTime

    Channel time, in seconds (for .gif, or TextureSequence bindings).

  • float[] iChannelDuration

    Channel duration, in seconds (for .gif, or TextureSequence 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.