Skip to content

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.

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.

ReturnsSignatureSummary
InputStreamopen(ShaderStage stage)Opens the source file of one stage from the classpath.
ShaderSourceread(ShaderStage stage)Reads the source of one stage into a ShaderSource.
IShadercreate(BlendState blend)Creates the shader through the render bridge of BridgeHandler.RENDER, with this blending.
ValueSummary
BITMAPDraws the cells of a bitmap font.
BLURBlurs a texture along one axis, for BlurNodeEffect and its shader pass.
BORDEROutlines the opaque pixels of a texture, outside or inside their edge, for BorderNodeEffect and its shader pass.
CIRCLEDraws an antialiased disc filled with a color or a gradient, and cuts a texture to a disc for CircleNodeEffect.
DEFAULTDraws vertices with their color and the texture of the render state; the render bridge uses it when no shader is bound.
FONTDraws MSDF text.
GRADIENTFills a shape with a linear gradient.
LINEDraws the wide and the smooth lines, through its line variant.
ROUNDEDCuts a texture, a color or a gradient to a rounded rectangle, filled or outlined, for the rounded shapes and RoundedNodeEffect.
SHADOWDraws the blurred shadow of a rounded rectangle, for ShadowNodeEffect.

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.

IShader create(BlendState blend)

Creates the shader through the render bridge of BridgeHandler.RENDER, with this blending.

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.


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