GlUniformType

View source

Identifies the GLSL type reported for an active uniform.

Compare the type returned by WebGLRenderingContext#getActiveUniform with a member when inspecting uniform metadata. The entries cover vector, boolean, matrix, sampler, and non-square matrix types.

Examples

import { GlUniformType } from '@wimaengine/render-webgl'

const uniform = gl.getActiveUniform(program, 0)
if (uniform?.type === GlUniformType.Matrix4) {
  console.log('upload a 4x4 matrix')
}

Variants


Vec2

View source

Two-component floating-point vector (0x8B50, FLOAT_VEC2).

Vec3

View source

Three-component floating-point vector (0x8B51, FLOAT_VEC3).

Vec4

View source

Four-component floating-point vector (0x8B52, FLOAT_VEC4).

Ivec2

View source

Two-component signed-integer vector (0x8B53, INT_VEC2).

Ivec3

View source

Three-component signed-integer vector (0x8B54, INT_VEC3).

Ivec4

View source

Four-component signed-integer vector (0x8B55, INT_VEC4).

Bvec2

View source

Two-component boolean vector (0x8B57, BOOL_VEC2).

Bvec3

View source

Three-component boolean vector (0x8B58, BOOL_VEC3).

Bvec4

View source

Four-component boolean vector (0x8B59, BOOL_VEC4).

Matrix2

View source

Two-by-two floating-point matrix (0x8B5A, FLOAT_MAT2).

Matrix3

View source

Three-by-three floating-point matrix (0x8B5B, FLOAT_MAT3).

Matrix4

View source

Four-by-four floating-point matrix (0x8B5C, FLOAT_MAT4).

Sampler

View source

Two-dimensional sampler uniform (0x8B5E, SAMPLER_2D).

SamplerCube

View source

Cube-map sampler uniform (0x8B60, SAMPLER_CUBE).

Matrix2x3

View source

Two-column by three-row floating-point matrix (0x8B65, FLOAT_MAT2x3).

Matrix2x4

View source

Two-column by four-row floating-point matrix (0x8B66, FLOAT_MAT2x4).

Matrix3x2

View source

Three-column by two-row floating-point matrix (0x8B67, FLOAT_MAT3x2).

Matrix3x4

View source

Three-column by four-row floating-point matrix (0x8B68, FLOAT_MAT3x4).

Matrix4x2

View source

Four-column by two-row floating-point matrix (0x8B69, FLOAT_MAT4x2).

Matrix4x3

View source

Four-column by three-row floating-point matrix (0x8B6A, FLOAT_MAT4x3).