API Docs for: 1.4.0
Show:

Kiwi.Shaders.ShaderPair Class

Module: Shaders
Parent Module: Kiwi

Base class for shader pairs which encapsulate a GLSL vertex and fragment shader

Constructor

Methods

applyUniform

(
  • gl
  • name
)
public

Applies a single uniforms to the uploaded program

Parameters:

  • gl WebGLRenderingCotext
  • name String

applyUniforms

(
  • gl
)
public

Applies all uniforms to the uploaded program

Parameters:

  • gl WebGLRenderingCotext

attach

(
  • gl
  • vertShader
  • fragShader
)
WebGLProgram public

Attaches the shaders to the program and links them

Parameters:

  • gl WebGLRenderingContext
  • vertShader WebGLShader
  • fragShader WebGLShader

Returns:

WebGLProgram:

compile

(
  • gl
  • src
  • shaderType
)
WebGLShader public

Compiles the shaders

Parameters:

  • gl WebGLRenderingContext
  • src String
  • shaderType Number

Returns:

WebGLShader:

init

(
  • gl
)
public

Initialise the shader pair.

Parameters:

  • gl WebGLRenderingCotext

initUniforms

(
  • gl
)
public

Initialises all uniforms

Parameters:

  • gl WebGLRenderingCotext

setParam

(
  • uniformName
  • value
)
public

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