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.
Description
Section titled “Description”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.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
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. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
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. |
Creation details
Section titled “Creation details”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.
Method details
Section titled “Method details”getDeclaration
Section titled “getDeclaration”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].
getType
Section titled “getType”String getType()
Returns the GLSL type, such as vec4 or sampler2D.
getName
Section titled “getName”String getName()
Returns the name used in the source.
getArray
Section titled “getArray”String getArray()
Returns the array suffix without spaces, such as [3]; empty for a variable that is not an array.
isFlat
Section titled “isFlat”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
