# ShadowMap

#### new Cesium.ShadowMap(options)
Scene/ShadowMap.js 78

Use `Viewer#shadowMap` to get the scene's shadow map. Do not construct this directly.

The normalOffset bias pushes the shadows forward slightly, and may be disabled for applications that require ultra precise shadows.

Name | Type | Description
--- | --- | ---

`options`

Object

An object containing the following properties:

Name | Type | Default | Description
--- | --- | --- | ---
`lightCamera` | Camera |  | A camera representing the light source.
`enabled` | Boolean | `true` | optional Whether the shadow map is enabled.
`isPointLight` | Boolean | `false` | optional Whether the light source is a point light. Point light shadows do not use cascades.
`pointLightRadius` | Boolean | `100.0` | optional Radius of the point light.
`cascadesEnabled` | Boolean | `true` | optional Use multiple shadow maps to cover different partitions of the view frustum.
`numberOfCascades` | Number | `4` | optional The number of cascades to use for the shadow map. Supported values are one and four.
`maximumDistance` | Number | `5000.0` | optional The maximum distance used for generating cascaded shadows. Lower values improve shadow quality.
`size` | Number | `2048` | optional The width and height, in pixels, of each shadow map.
`softShadows` | Boolean | `false` | optional Whether percentage-closer-filtering is enabled for producing softer shadows.
`darkness` | Number | `0.3` | optional The shadow darkness.
`normalOffset` | Boolean | `true` | optional Whether a normal bias is applied to shadows.
`fadingEnabled` | Boolean | `true` | optional Whether shadows start to fade out once the light gets closer to the horizon.

##### Throws:

- DeveloperError : Only one or four cascades are supported.

##### Demo:

- Cesium Sandcastle Shadows Demo

### Members

#### darkness : Number
Scene/ShadowMap.js 118

Determines the darkness of the shadows.

Default Value: `0.3`

#### enabled : Boolean
Scene/ShadowMap.js 359

Determines if the shadow map will be shown.

Default Value: `true`

#### fadingEnabled : Boolean
Scene/ShadowMap.js 127

Determines whether shadows start to fade out once the light gets closer to the horizon.

Default Value: `true`

#### maximumDistance : Number
Scene/ShadowMap.js 135

Determines the maximum distance of the shadow map. Only applicable for cascaded shadows. Larger distances may result in lower quality shadows.

Default Value: `5000.0`

#### normalOffset : Boolean
Scene/ShadowMap.js 376

Determines if a normal bias will be applied to shadows.

Default Value: `true`

#### size : Number
Scene/ShadowMap.js 413

The width and height, in pixels, of each shadow map.

Default Value: `2048`

#### softShadows : Boolean
Scene/ShadowMap.js 396

Determines if soft shadows are enabled. Uses pcf filtering which requires more texture reads and may hurt performance.

Default Value: `false`