Constructor
new ShaderLoader(parentPath)
Constructor for ShaderLoader class
Parameters:
Name | Type | Description |
---|---|---|
parentPath |
- Source:
Classes
Methods
addFloatUniform(gl, program, name, value)
Adds integer uniform
Parameters:
Name | Type | Description |
---|---|---|
gl |
||
program |
||
name |
||
value |
float value |
- Source:
addIntegerUniform(gl, program, name, value) → {WebGLShader}
Compiles the shader source
Parameters:
Name | Type | Description |
---|---|---|
gl |
||
program |
||
name |
||
value |
integer value |
- Source:
Returns:
- Type
- WebGLShader
addTextureUniform(gl, program, name, texture, index)
Adds texture uniform
Parameters:
Name | Type | Description |
---|---|---|
gl |
||
program |
||
name |
||
texture |
||
index |
texture index |
- Source:
addVec2Uniform(gl, program, name, value)
Adds vec2 uniform
Parameters:
Name | Type | Description |
---|---|---|
gl |
||
program |
||
name |
||
value |
vec2 value |
- Source:
(async) getShaderSource(url) → {Promise.<(string|void|any)>}
Fetches the shader source from the given url
Parameters:
Name | Type | Description |
---|---|---|
url |
- Source:
Returns:
- Type
- Promise.<(string|void|any)>