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.
Description
Section titled “Description”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.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
void | bind(ShaderPassContext context) abstract | Binds your shader and sets its uniforms from context: the texel size, the area and its region on screen. |
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. |
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. |
Method details
Section titled “Method details”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.
unbind
Section titled “unbind”void unbind() abstract
Unbinds the shader bound in bind; JOID calls it even when the draw throws.
expansion
Section titled “expansion”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
