ViroShaderUniform

ViroShaderUniform is a type that defines the data structure for passing dynamic variables from JavaScript/TypeScript into your custom shader code.

PropertyTypeDescriptionRequired
namestringThe variable name as it appears in your GLSL code.required
typefloat | vec2 | vec3 | vec4 | mat4 | sampler2DThe GLSL data type. Supported types include:

- float, vec2, vec3, vec4 (numbers or arrays of numbers).
- mat4 (4x4 matrix).
- sampler2D (image textures).
required
valueanyThe actual value being passed (e.g., a number, an array, or a reference to a texture).required