new Program(gl, vertSrc, fragSrc, params)
constructor
compile shaders and link them to gl context
- Source:
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
gl |
WebGLRenderingContext
|
|||||||
vertSrc |
string
|
|||||||
fragSrc |
string
|
|||||||
params |
Object
|
|
Members
Methods
getAttrib(name)
get the value of the attribute of program(it will be remove)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
name of attributes |
getUniforms(name)
get the value of uniform of program(it will be removed)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
name of uniforms |
initProgram(vertSrc, fragSrc, params)
crate the program and compile shader
- Source:
Parameters:
Name | Type | Description |
---|---|---|
vertSrc |
string
|
vertex hader |
fragSrc |
string
|
fragment shader src |
params |
Object
|
optinal paramters |
setUniformTexture(texture, uniformName)
set texture as uniform
- Source:
Parameters:
Name | Type | Description |
---|---|---|
texture |
Texture
|
|
uniformName |
String
|