Kiwi.Shaders.ShaderPair Class
Base class for shader pairs which encapsulate a GLSL vertex and fragment shader
Constructor
Item Index
Properties
Methods
applyUniform
(
public
-
gl
-
name
Applies a single uniforms to the uploaded program
Parameters:
-
gl
WebGLRenderingCotext -
name
String
applyUniforms
(
public
-
gl
Applies all uniforms to the uploaded program
Parameters:
-
gl
WebGLRenderingCotext
attach
(
WebGLProgram
public
-
gl
-
vertShader
-
fragShader
Attaches the shaders to the program and links them
Parameters:
-
gl
WebGLRenderingContext -
vertShader
WebGLShader -
fragShader
WebGLShader
Returns:
WebGLProgram:
compile
(
WebGLShader
public
-
gl
-
src
-
shaderType
Compiles the shaders
Parameters:
-
gl
WebGLRenderingContext -
src
String -
shaderType
Number
Returns:
WebGLShader:
init
(
public
-
gl
Initialise the shader pair.
Parameters:
-
gl
WebGLRenderingCotext
initUniforms
(
public
-
gl
Initialises all uniforms
Parameters:
-
gl
WebGLRenderingCotext
setParam
(
public
-
uniformName
-
value
Sets a single uniform value and marks it as dirty.
Parameters:
-
uniformName
String -
value
Properties
attributes
Array
public
Attribute descriptors
fragShader
WebGLShader
public
Fragment shader
loaded
Boolean
public
Returns whether the shader pair has been loaded and compiled.
RENDERER_ID
String
public
static
shaderProgram
WebGLProgram
public
The WebGl shader program
texture2DFrag
Array
public
Shader frag source (for override)
texture2DVert
Array
public
Shader vert source (for override)
uniforms
Array
public
Uniform descriptors
vertShader
WebGLShader
public
Vertex shader