Skip to content

IShaderPass

interface IShaderPass
Known subtypes: BlurShaderPass, BorderShaderPass, CircleShaderPass, RoundedShaderPass
Package: dev.joid.lib.shader.pipeline · Module: core · Source: IShaderPass.java

One step of a ShaderPipeline, which binds a shader that reads the previous result as a texture.

Implement it for a shader effect of your own, or return it from the shader passes of a node effect. JOID calls bind, draws the previous result as a textured quad over the area, then calls unbind, on the render thread.

ReturnsSignatureSummary
voidbind(ShaderPassContext context) abstractBinds your shader and sets its uniforms from context: the texel size, the area and its region on screen.
voidunbind() abstractUnbinds the shader bound in bind; JOID calls it even when the draw throws.
floatexpansion() defaultReturns how far, in design pixels, the pass draws outside the area, such as the radius of a blur; the area grows by the largest expansion of the passes.
doublereach(double scale) defaultReturns how far, in screen pixels at the screen scale scale, the pass reads outside the visible part of the area, so that the pipeline renders that margin too.

void bind(ShaderPassContext context) abstract

Binds your shader and sets its uniforms from context: the texel size, the area and its region on screen. When the shader cannot draw, bind nothing: the quad is then drawn without a shader.

void unbind() abstract

Unbinds the shader bound in bind; JOID calls it even when the draw throws.

float expansion() default

Returns how far, in design pixels, the pass draws outside the area, such as the radius of a blur; the area grows by the largest expansion of the passes. 0F by default.

double reach(double scale) default

Returns how far, in screen pixels at the screen scale scale, the pass reads outside the visible part of the area, so that the pipeline renders that margin too. By default the expansion times scale, plus one pixel.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page