t3d. LightShadow

Serves as a base class for the other shadow classes.

Constructor

(abstract) new LightShadow()

Members

autoUpdate :Boolean

Enables automatic updates of the light's shadow. If you do not require dynamic lighting / shadows, you may set this to false.
Type:
  • Boolean
Default Value
  • true

bias :Number

Shadow map bias, how much to add or subtract from the normalized depth when deciding whether a surface is in shadow. Very tiny adjustments here (in the order of 0.0001) may help reduce artefacts in shadows.
Type:
  • Number
Default Value
  • 0

camera :t3d.Camera

The light's view of the world. This is used to generate a depth map of the scene; objects behind other objects from the light's perspective will be in shadow.

cameraFar :Number

Shadow camera far.
Type:
  • Number
Default Value
  • 500

cameraNear :Number

Shadow camera near.
Type:
  • Number
Default Value
  • 1

mapSize :t3d.Vector2

A t3d.Vector2 defining the width and height of the shadow map. Higher values give better quality shadows at the cost of computation time. Values must be powers of 2.
Default Value
  • t3d.Vector2(512, 512)

matrix :t3d.Matrix4

Model to shadow camera space, to compute location and depth in shadow map. Stored in a t3d.Matrix4. This is computed internally during rendering.

needsUpdate :Boolean

When set to true, shadow maps will be updated in the next ShadowMapPass.render call. If you have set .autoUpdate to false, you will need to set this property to true and then make a ShadowMapPass.render call to update the light's shadow.
Type:
  • Boolean
Default Value
  • false

normalBias :Number

Defines how much the position used to query the shadow map is offset along the object normal. Increasing this value can be used to reduce shadow acne especially in large scenes where light shines onto geometry at a shallow angle. The cost is that shadows may appear distorted.
Type:
  • Number
Default Value
  • 0

radius :Number

Setting this to values greater than 1 will blur the edges of the shadow. High values will cause unwanted banding effects in the shadows - a greater mapSize will allow for a higher value to be used here before these effects become visible. Note that this has no effect if the @t3d.Object3D#shadowType is set to PCF or PCSS.
Type:
  • Number
Default Value
  • 1