Class: IllumShader

IllumShader(vertexShaderPath, fragmentShaderPath) → {IllumShader}

Shader that supports lighting and Phong-illumination

Found in Chapter 8, page 450 of the textbook

Examples: 8.4 Normal Maps and Illumination Shader, 8.5 Materials and Specularity

Constructor

new IllumShader(vertexShaderPath, fragmentShaderPath) → {IllumShader}

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

Extends

Methods

activate(pixelColor, trsMatrix, cameraMatrix)

Activate this IllumShader 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
Overrides:
Source:

cleanUp()

Delete the texture coordinate buffer and clean up the resources
Inherited From:
Source:

setCameraAndLights(c, l)

Set the Camera and list of Lights for this LightShader, the length of argument l can not be greater than GLSL light array size
Parameters:
Name Type Description
c Camera the Camera this LightShader illuminates
l Array.<Lights> List of Light objects for this LightShader
Inherited From:
Source:

setMaterialAndCameraPos(m, p)

Set the Camera position and Material for this IllumShader to use
Parameters:
Name Type Description
m Material the Material for this IllumShader
p vec3 world coordinate [X,Y,Z] Camera position
Source:

setTextureCoordinate(texCoord)

Sets the texture coordinates in UV space for a sprite
Parameters:
Name Type Description
texCoord Array.<float> UV texture coordinate array
Inherited From:
Source: