Methods
createShader(gl, type, source) → {object}
Helper function that compiles a shader.
Parameters:
Name | Type | Description |
---|---|---|
gl |
object | WebGL context extracted from the canvas. |
type |
enum | Can be gl.VERTEX_SHADER or gl.FRAGMENT_SHADER. |
source |
string | GLSL text to compile. |
Returns:
Compiled shader.
- Type
- object