new ShadowMap()
Use Viewer # shadowMap to obtain shadow maps from the sun in the scene. Please do not build directly. Normal offset bias will slightly push the shadow forward, but for applications that require ultra precise shadows, offset bias can be disabled.
| Name | Type | Default | Description |
|---|---|---|---|
options.lightCamera |
Camera |
A camera representing a light source. |
|
options.enabled |
Boolean | true |
optional
Whether to enable shadow mapping. |
options.isPointLight |
Boolean | false |
optional
Is the light source a point light source. Point light source shadows do not use cascading. |
options.pointLightRadius |
Boolean | 100.0 |
optional
The radius of the point light source. |
options.cascadesEnabled |
Boolean | true |
optional
Use multiple shadow maps to cover different parts of the cone of view. |
options.numberOfCascades |
Number | 4 |
optional
The number of cascades used for shadow mapping. The supported values are 1 and 4. |
options.maximumDistance |
Number | 1000.0 |
optional
The maximum distance used to generate cascading shadows. The smaller the value, the better the shadow quality. |
options.size |
Number | 2048 |
optional
The width and height (in pixels) of each shadow map. |
options.softShadows |
Boolean | false |
optional
Do you want to enable percentage reduction filtering to produce softer shadows. |
options.darkness |
Number | 0.3 |
optional
The shadow of darkness. |
options.normalOffset |
Boolean | true |
optional
Is there a normal deviation in the shadow. |
Throws:
-
Only supports one or four cascades.
- Type
- DeveloperError
Members
-
darknessNumber
-
Determine the brightness of the shadow.
- Default Value: 0.3
enabledBoolean
Determine whether to display shadow maps.
- Default Value: true
maximumDistanceNumber
Determine the maximum distance for shadow mapping. Only applicable to stacked shadows. The greater the distance, the worse the shadow quality.
- Default Value: 1000.0
normalOffsetBoolean
Determine whether to use normal bias for shadows.
- Default Value: true
sizeNumber
The width and height (in pixels) of each shadow map.
- Default Value: 2048
softShadowsBoolean
Determine whether to enable soft shadows. Using PCF filtering requires reading more textures, which may affect performance.
- Default Value: false