Class: SimpleShader

SimpleShader(vertexShaderPath, fragmentShaderPath) → {SimpleShader}

Shader for rendering simple, single-color shapes

Found in Chapter 3, page 44 of the textbook

Example: 3.1 Renderable Objects

Constructor

new SimpleShader(vertexShaderPath, fragmentShaderPath) → {SimpleShader}

Parameters:
Name Type Description
vertexShaderPath string path to the vertex shader file
fragmentShaderPath string path to the fragment shader file
Source:
Returns:
a new SimpleShader instance
Type
SimpleShader

Methods

activate(pixelColor, trsMatrix, cameraMatrix)

Activate this shader for rendering
Parameters:
Name Type Description
pixelColor vec4 [R,G,B,A] color array for the pixels
trsMatrix mat4 translation, rotation, and scaling matrix for the object being rendered
cameraMatrix mat4 translation, rotation, and scaling matrix for the Camera
Source:

cleanUp()

Detaches and removes the shader from webGL
Source: