Class: ShadowCasterShader

ShadowCasterShader(vertexShaderPath, fragmentShaderPath) → {ShadowCasterShader}

Defines a single light shader that casts a shadow

Found in Chapter 8, page 497 of the textbook

Example: 8.7 Shadow Shaders

Constructor

new ShadowCasterShader(vertexShaderPath, fragmentShaderPath) → {ShadowCasterShader}

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

Extends

Methods

activate(pixelColor, trsMatrix, cameraMatrix)

Override to activate this ShadowCasterShader with a single ShaderLightAt
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 single Light for this ShadowCasterShader
Parameters:
Name Type Description
c Camera the Camera being used
l Light the shadow casting Light
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: