fxContextLibrary
The context of the image an effect makes, for presets that change over time or depend on the size of the image:
float fx_time(): the time in secondsint fx_frame(): the number of the framevec2 fx_resolution(): the size of the image in pixelsvec2 fx_texel(): the size of a pixel in texture coordinates
A preset that reads them lists this library in the libraries of its GLSL function or parameter:
override val dynamicParameter = glslFunction<Vector2>("vec2 uv", "return uv + 0.01 * sin(fx_time()) * fx_texel();",
listOf(fxContextLibrary))Content copied to clipboard
Whoever runs the shader sets the values with setFxContext, which EffectChain and the PresetFilters do on every apply. The shader code then also includes FX_CONTEXT_USE, so that the values can be set whether or not a preset reads them.