A directional light source that casts cascaded shadows, mimicking the Sun's
shadow behavior at any distance. Virtual suns use Cascaded Shadow Maps (CSM)
to provide high-quality shadows regardless of object distance from the camera.
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Object with the following properties:
|
Example:
// Create a virtual sun pointing northeast and downward
const virtualSun = scene.virtualSuns.add({
direction: new Cesium.Cartesian3(1, 1, -1),
color: Cesium.Color.WHITE,
intensity: 2.0,
castShadows: true
});
// Update direction dynamically
virtualSun.direction = new Cesium.Cartesian3(0, 1, -0.5);
Members
Whether the virtual sun casts shadows.
The color of the light.
The darkness of the shadows (0.0 = no shadow, 1.0 = full black).
direction : Cartesian3
The direction the light is traveling in world coordinates (normalized).
Whether the virtual sun is enabled.
The intensity of the light.
The maximum distance for shadows. Larger distances reduce shadow quality.
The number of shadow cascades. Read-only after creation.
readonly shadowMap : ShadowMap
The shadow map used by this virtual sun. Read-only.
The shadow map texture size in pixels.
Whether to use soft shadows (PCF filtering).
Methods
Destroys the resources held by this object.
Returns:
Returns true if this object was destroyed; otherwise, false.