API Docs for: 0.2.0
Show:

Shaders Class

Module: LE

The Shaders class is used internally to tell the WebGLRender which shader is currently selected. It also stores a list of all the shaders being used.

Constructor

Shaders

()

Methods

createShader

(
  • gl
  • isTextureShader
  • vertexShader
  • fragmentShader
)
private

Creates a shader program from a vertex shader and a fragment shader

Parameters:

  • gl Object
  • isTextureShader Boolean
  • vertexShader String
  • fragmentShader String

enableRegularShaderAttribs

(
  • gl
  • shaderProgram
)
private

Enables a shader programs internal attributes. This allows WebGL to parse values to the shader program

Parameters:

  • gl Object
  • shaderProgram Object

enableTextureShaderAttribs

(
  • gl
  • shaderProgram
)
private

Enables a texture shader programs internal attributes. This allows WebGL to parse values to the shader program

Parameters:

  • gl Object
  • shaderProgram Object

getShaderFromHTML

(
  • gl
  • id
)
private

Loads a shader from an HTML script tag

Parameters:

  • gl Object
  • id String

getShaderFromVar

(
  • gl
  • shaderSrc
  • type
)
private

Loads a shader from a JavaScript variable

Parameters:

  • gl Object
  • shaderSrc String
  • type String

setCurrentShader

(
  • gl
  • shaderProgram
)
private

Sets the selected property to the shader. Also tells WebGL to use this shader

Parameters:

  • gl Object
  • shaderProgram Object

Properties

list

Array private

selected

Object private