Constructor
new Shader(spec, callback)
Instantiates a Shader object.
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
spec |
Object
|
The shader specification object.
|
||||||||||||||||||
callback |
function
|
The callback function to execute once the shader has been successfully compiled and linked. |
Methods
setUniform(name, value) → {Shader}
Buffer a uniform value by name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
The uniform name in the shader source. |
value |
*
|
The uniform value to buffer. |
setUniforms(uniforms) → {Shader}
Buffer a map of uniform values.
Parameters:
Name | Type | Description |
---|---|---|
uniforms |
Object
|
The map of uniforms keyed by name. |