Class: ShaderController

og.webgl.ShaderController

new og.webgl.ShaderController(handler, shaderProgram)

This is shader program controller that used by hadler object to access the shader program capabilities, like switching program during the rendering. Get access to the program from ...handler.shaderPrograms. etc.
Name Type Description
handler og.webgl.Handler Handler.
shaderProgram og.shaderProgram.ShaderProgram Shader program.

Methods

Activates current shader program.
Deactivate shader program. This is not necessary while activae function used.
Calls Gl drawArray function.
Name Type Description
mode number Gl draw mode.
numItems number draw items count.
Returns:
Type Description
og.webgl.ShaderController Returns current shader controller instance.
Draw index buffer with this program.
Name Type Description
mode number Gl draw mode
buffer
Returns:
Type Description
og.webgl.ShaderController Returns current shader controller instance.
Returns controller's shader program.
Returns:
Type Description
og.shaderProgram.ShaderProgram
Lazy create program call.

isActive(){boolean}

Returns program activity.
Returns:
Type Description
boolean
Remove program from handler
Sets program uniforms and attributes values and return controller instance.
Name Type Description
params Object Object with variable name and value like { value: 12, someArray:[1,2,3], uSampler: texture,... }
Returns:
Type Description
og.webgl.ShaderController