new Program(name, material)
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string | Shader program name identificator. | |||||||||||||||
material |
object |
Object stores uniforms, attributes and program codes:
|
Members
-
_attributesObject
-
Attributes.
-
_textureIDnumber
-
Texture counter.
-
_uniformsObject
-
Uniforms.
-
fragmentShaderstring
-
Fragment shader.
-
glObject
-
Webgl context.
-
namestring
-
Shader progarm name.
-
vertexShaderstring
-
Vertex shader.
Methods
-
staticmodule:og/webgl/Program~Program.bindBuffer(program, variable)
-
Bind program buffer.
Name Type Description program
Program Used program. variable
Object Variable represents buffer data. -
apply()
-
Apply current variables.
-
createProgram(gl)
-
Creates program.
Name Type Description gl
Object WebGl context. -
delete()
-
Delete program.
-
disableAttribArrays()
-
Disable current program vertexAttribArrays.
-
drawArrays(mode, numItems)
-
Calls drawArrays function.
Name Type Description mode
number Draw mode(GL_TRIANGLES, GL_LINESTRING etc.). numItems
number Curent binded buffer drawing items count. -
drawIndexBuffer(mode, buffer)
-
Calls drawElements index buffer function.
Name Type Description mode
number Draw mode(GL_TRIANGLES, GL_LINESTRING etc.). buffer
Object Index buffer. -
enableAttribArrays()
-
Enable current program vertexAttribArrays.
-
set(material)
-
Sets program variables.
Name Type Description material
Object Variables and values object. -
use()
-
Sets the current program frame.