ShadowLight

Description

class ShadowLight extends Light

Members

abstract : undefined

void : undefined

position : Vector3

direction : Vector3

shadowMinZ : number

shadowMaxZ : number

customProjectionMatrixBuilder : (viewMatrix: Matrix, renderList: Array<AbstractMesh>, result: Matrix) => void

Parameters

Name Type Description
viewMatrix Matrix
renderList Array<AbstractMesh>
result Matrix

transformedPosition : Vector3

transformedDirection : Vector3

Methods

computeTransformedInformation() boolean

Computes the light transformed position/direction in case the light is parented. Returns true if parented, else false.

getDepthScale() number

Return the depth scale used for the shadow map.

getShadowDirection(faceIndex) Vector3

Returns the light direction (Vector3) for any passed face index.

Parameters

Name Type Description
optional faceIndex number

getAbsolutePosition() Vector3

Returns the DirectionalLight absolute position in the World.

setDirectionToTarget(target) Vector3

Sets the DirectionalLight direction toward the passed target (Vector3).

Returns the updated DirectionalLight direction (Vector3).

Parameters

Name Type Description
target Vector3

getRotation() Vector3

Returns the light rotation (Vector3).

needCube() boolean

Boolean : false by default.

needProjectionMatrixCompute() boolean

Specifies wether or not the projection matrix should be recomputed this frame.

forceProjectionMatrixCompute() void

Forces the shadow generator to recompute the projection matrix even if position and direction did not changed.

getDepthMinZ(activeCamera) number

Gets the minZ used for shadow according to both the scene and the light.

Parameters

Name Type Description
activeCamera Camera

getDepthMaxZ(activeCamera) number

Gets the maxZ used for shadow according to both the scene and the light.

Parameters

Name Type Description
activeCamera Camera

setShadowProjectionMatrix(matrix, viewMatrix, renderList) IShadowLight

Sets the projection matrix according to the type of light and custom projection matrix definition.

Returns the light.

Parameters

Name Type Description
matrix Matrix
viewMatrix Matrix
renderList Array<AbstractMesh>