Skip to content

UniformType

enum UniformType
Package: dev.joid.lib.bridge.render.shader.uniform · Module: core · Source: UniformType.java

The GLSL types that a uniform can have, with the component and column counts that set its std140 size and the values that it accepts.

UniformMember uses the type to lay the member out and to check each value: the integer types take int values, bool and int also take boolean values, and the float types take floats or integers. Samplers are not in this list: they become UniformSampler objects.

ReturnsSignatureSummary
UniformTypeof(String identifier) factoryReturns the type with this GLSL name.

ReturnsSignatureSummary
booleanisMatrix()If true, the type is a square matrix, laid out as columns of 16 bytes.
intgetCount()Returns the number of 32-bit values in one element: the components times the columns, 16 for a mat4.
StringgetIdentifier()Returns the GLSL name of the type, such as vec3.
intgetComponents()Returns the number of components of a scalar or a vector, or the number of rows of a matrix.
intgetColumns()Returns the number of columns of a matrix, or 0 for a scalar or a vector.
booleanisInteger()If true, the type stores integers (int, uint, bool and their vectors) and refuses floats.
ValueSummary
INTint, a signed integer.
UINTuint, an unsigned integer, which needs GLSL 1.30.
BOOLbool, stored as the integer 0 or 1.
FLOATfloat.
VEC2vec2, two floats.
VEC3vec3, three floats, aligned on 16 bytes.
VEC4vec4, four floats.
IVEC2ivec2, two signed integers.
IVEC3ivec3, three signed integers.
IVEC4ivec4, four signed integers.
UVEC2uvec2, two unsigned integers.
UVEC3uvec3, three unsigned integers.
UVEC4uvec4, four unsigned integers.
BVEC2bvec2, two booleans stored as integers.
BVEC3bvec3, three booleans stored as integers.
BVEC4bvec4, four booleans stored as integers.
MAT2mat2, a 2×2 float matrix, written column by column.
MAT3mat3, a 3×3 float matrix, written column by column.
MAT4mat4, a 4×4 float matrix, written column by column.

UniformType of(String identifier) factory

Throws:

  • IllegalArgumentException: The uniform type … is not supported, use int, uint, bool, float, vec2 to vec4, ivec2 to ivec4, uvec2 to uvec4, bvec2 to bvec4 or mat2 to mat4

Returns the type with this GLSL name. Throws IllegalArgumentException for a type outside this list, such as a struct.

boolean isMatrix()

If true, the type is a square matrix, laid out as columns of 16 bytes.

int getCount()

Returns the number of 32-bit values in one element: the components times the columns, 16 for a mat4.

String getIdentifier()

Returns the GLSL name of the type, such as vec3.

int getComponents()

Returns the number of components of a scalar or a vector, or the number of rows of a matrix.

int getColumns()

Returns the number of columns of a matrix, or 0 for a scalar or a vector.

boolean isInteger()

If true, the type stores integers (int, uint, bool and their vectors) and refuses floats.

INT

int, a signed integer.

UINT

uint, an unsigned integer, which needs GLSL 1.30.

BOOL

bool, stored as the integer 0 or 1.

FLOAT

float.

VEC2

vec2, two floats.

VEC3

vec3, three floats, aligned on 16 bytes.

VEC4

vec4, four floats.

IVEC2

ivec2, two signed integers.

IVEC3

ivec3, three signed integers.

IVEC4

ivec4, four signed integers.

UVEC2

uvec2, two unsigned integers.

UVEC3

uvec3, three unsigned integers.

UVEC4

uvec4, four unsigned integers.

BVEC2

bvec2, two booleans stored as integers.

BVEC3

bvec3, three booleans stored as integers.

BVEC4

bvec4, four booleans stored as integers.

MAT2

mat2, a 2×2 float matrix, written column by column.

MAT3

mat3, a 3×3 float matrix, written column by column.

MAT4

mat4, a 4×4 float matrix, written column by column.


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