Constructor
new Uniform(name, value, type)
- Source:
Properties:
Name | Type | Description |
---|---|---|
name |
String | The name of this uniform. Also the variable name in the shader. |
value |
Number | The value of this uniform. |
type |
String | The type of this uniform. Available types: int, int_vec2, int_vec3, int_vec4, int_array, float, float_vec2, float_vec3, float_vec4, float_array, float_mat2, float_mat3, float_mat4. |
stale |
Boolean | A boolean indicating whether or not this uniform is stale and needs to be updated. |
Creates an instance of Uniform.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | The name of this uniform. Also the variable name in the shader. |
value |
Number | The value of this uniform. |
type |
String | The type of this uniform. Available types: int, int_vec2, int_vec3, int_vec4, int_array, float, float_vec2, float_vec3, float_vec4, float_array, float_mat2, float_mat3, float_mat4. |
Methods
(static) Set(gl, program, uniform)
- Source:
Pushes the uniform to the GPU.
Parameters:
Name | Type | Description |
---|---|---|
gl |
WebGLRenderingContext | A WebGL rendering context. |
program |
WebGLUniformLocation | |
uniform |
Lore.Uniform |
setValue(value)
- Source:
Set the value of this uniform.
Parameters:
Name | Type | Description |
---|---|---|
value |
Number | A number which is valid for the specified type. |