Constructor
Extends
Members
number
UID
Unique identifier
- Inherited From:
Methods
getAttributes() → {Array.<ProgramElement>}
Get attributes
An array of attribute
Array.<ProgramElement>
getSources() → {Array.<string>}
Get program's sources
Index 0: Vertex shader, Index 1: Fragment shader
Array.<string>
getUID() → {number}
Get unique ID
- Inherited From:
An unsigned integer
number
getUniform(name) → (nullable) {ProgramElement}
Get uniform
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of the uniform |
A program Element or null if uniform doesn't exist
isReady() → {boolean}
Say if program is ready to be use
Source array must have two elements: the fragment and the vertex shaders
True if program is ready, otherwise false
boolean
loadFromData(vertexSource, fragmentSource)
Load program from data
Parameters:
Name | Type | Description |
---|---|---|
vertexSource |
string | Vertex shader code |
fragmentSource |
string | Fragment shader code |
async loadFromFiles(vertexFile, fragmentFile)
Load program from shader files
Parameters:
Name | Type | Description |
---|---|---|
vertexFile |
string | Path to the vertex shader file |
fragmentFile |
string | Path to the fragment shader file |