Skip to content

ShaderVariable

final class ShaderVariable
Package: dev.joid.lib.bridge.render.shader.source · Module: core · Source: ShaderVariable.java

A variable that a shader source declares, an input, an output, a uniform or a sampler, as the translator reads and writes it again.

ShaderSource creates one per in, out and uniform declaration, and GlslShaderTranslator creates its own for the uniforms that JOID adds. The translator declares them again in the syntax of the dialect, and UniformBlock lays out the uniforms from them.

ReturnsSignatureSummary
ShaderVariableof(String type, String name, String array, boolean flat) factoryCreates a variable from its GLSL type, its name, its array suffix (such as [4] or [COUNT], empty for a single value) and whether it is flat.

ReturnsSignatureSummary
StringgetDeclaration()Returns the type, the name and the array suffix, as written in a declaration without qualifier nor semicolon, such as float weights[3].
StringgetType()Returns the GLSL type, such as vec4 or sampler2D.
StringgetName()Returns the name used in the source.
StringgetArray()Returns the array suffix without spaces, such as [3]; empty for a variable that is not an array.
booleanisFlat()If true, the varying is declared flat and is not interpolated.

ShaderVariable of(String type, String name, String array, boolean flat) factory

Creates a variable from its GLSL type, its name, its array suffix (such as [4] or [COUNT], empty for a single value) and whether it is flat.

String getDeclaration()

Returns the type, the name and the array suffix, as written in a declaration without qualifier nor semicolon, such as float weights[3].

String getType()

Returns the GLSL type, such as vec4 or sampler2D.

String getName()

Returns the name used in the source.

String getArray()

Returns the array suffix without spaces, such as [3]; empty for a variable that is not an array.

boolean isFlat()

If true, the varying is declared flat and is not interpolated.


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