EffectChain
A filter that applies stages in order. Consecutive warp, color, source and blend stages are fused into a single pass that reads the input once, filter stages run as passes of their own. A blend stage with the input of the chain as its layer reads the input in whatever pass it is fused into. A source stage replaces the image, the stages before it have no effect. A sample stage reads the image as it is after the stages before it, it starts a pass that reads the input with the sampler. The result is that of applying the stages one after another, without resampling between fused stages.
Changing the properties of the presets and filters of the stages takes effect on the next apply, assigning stages builds the passes again; shaders are shared by chains with the same kinds and classes of stages. Every apply sets the values of fxContextLibrary: time, frame and the size of the image, also for PresetFilter stages.
val chain = effectChain {
warp(Ripple())
color(Grade())
filter(HashBlur())
color(Vignette())
}
chain.apply(image, result)Properties
the number of the frame, for presets that read fx_frame(), see fxContextLibrary
the stages, in the order in which they are applied
the time in seconds, for presets that read fx_time(), see fxContextLibrary