CoreShader
enum CoreShader
Package: dev.joid.lib.bridge.render.shader.source · Module: core · Source: CoreShader.java
The JOID GLSL shaders of the core, which draw text, shapes, lines and the built-in effects on every backend.
Description
Section titled “Description”Each constant names a folder of /assets/shaders/ in the core jar, with a .vsh vertex stage and a .fsh fragment stage written in JOID GLSL.
A backend translates and compiles all of them: compilesCoreShaders of the render contract suite checks it.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
InputStream | open(ShaderStage stage) | Opens the source file of one stage from the classpath. |
ShaderSource | read(ShaderStage stage) | Reads the source of one stage into a ShaderSource. |
IShader | create(BlendState blend) | Creates the shader through the render bridge of BridgeHandler.RENDER, with this blending. |
Values
Section titled “Values”| Value | Summary |
|---|---|
BITMAP | Draws the cells of a bitmap font. |
BLUR | Blurs a texture along one axis, for BlurNodeEffect and its shader pass. |
BORDER | Outlines the opaque pixels of a texture, outside or inside their edge, for BorderNodeEffect and its shader pass. |
CIRCLE | Draws an antialiased disc filled with a color or a gradient, and cuts a texture to a disc for CircleNodeEffect. |
DEFAULT | Draws vertices with their color and the texture of the render state; the render bridge uses it when no shader is bound. |
FONT | Draws MSDF text. |
GRADIENT | Fills a shape with a linear gradient. |
LINE | Draws the wide and the smooth lines, through its line variant. |
ROUNDED | Cuts a texture, a color or a gradient to a rounded rectangle, filled or outlined, for the rounded shapes and RoundedNodeEffect. |
SHADOW | Draws the blurred shadow of a rounded rectangle, for ShadowNodeEffect. |
Method details
Section titled “Method details”InputStream open(ShaderStage stage)
Throws:
IllegalStateException: The core shader … is missing from the classpath, check that the JOID jar is complete
Opens the source file of one stage from the classpath.
Throws IllegalStateException when the file is missing, which means an incomplete JOID jar.
ShaderSource read(ShaderStage stage)
Reads the source of one stage into a ShaderSource.
create
Section titled “create”IShader create(BlendState blend)
Creates the shader through the render bridge of BridgeHandler.RENDER, with this blending.
Value details
Section titled “Value details”BITMAP
Section titled “BITMAP”BITMAP
Draws the cells of a bitmap font.
BLUR
Blurs a texture along one axis, for BlurNodeEffect and its shader pass.
BORDER
Section titled “BORDER”BORDER
Outlines the opaque pixels of a texture, outside or inside their edge, for BorderNodeEffect and its shader pass.
CIRCLE
Section titled “CIRCLE”CIRCLE
Draws an antialiased disc filled with a color or a gradient, and cuts a texture to a disc for CircleNodeEffect.
DEFAULT
Section titled “DEFAULT”DEFAULT
Draws vertices with their color and the texture of the render state; the render bridge uses it when no shader is bound.
FONT
Draws MSDF text.
GRADIENT
Section titled “GRADIENT”GRADIENT
Fills a shape with a linear gradient.
LINE
Draws the wide and the smooth lines, through its line variant.
ROUNDED
Section titled “ROUNDED”ROUNDED
Cuts a texture, a color or a gradient to a rounded rectangle, filled or outlined, for the rounded shapes and RoundedNodeEffect.
SHADOW
Section titled “SHADOW”SHADOW
Draws the blurred shadow of a rounded rectangle, for ShadowNodeEffect.
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
