Class: ShadowCasterShader

ShadowCasterShader

new ShadowCasterShader(vertexShaderPath, fragmentShaderPath) → {ShadowCasterShader}

Default Constructor

Subclass from SpriteShader

a little similar to LightShader, except, only defines

one light: the one that casts the shadow

Parameters:
Name Type Description
vertexShaderPath string filepath of the Vertex Shader.
fragmentShaderPath string filepath of the Fragment Shader.
Source:
Returns:
An intsnace of ShadowCasterShader.
Type
ShadowCasterShader

Methods

activateShader(pixelColor, aCamera) → {void}

Activate the shader for rendering.
Parameters:
Name Type Description
pixelColor Array.<float> [R, G, B, A] Sets the shader pixel color.
aCamera Camera Camera to draw to
Source:
Returns:
Type
void

setLight(l) → {void}

Set the Shader Light Source
Parameters:
Name Type Description
l Light Light source of Shader
Source:
Returns:
Type
void