Shadows do not consider terrain that is outside of the rendered scene
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
This bug occurs when terrain shadows are enabled. As one zooms closer to a shaded region, the region becomes un-shaded since the terrain which shaded the area is no longer in the current scene. Put simply - a shaded region becomes un-shaded when the source of the shadow is no longer in the current scene.
Source of shadow is in the scene (see right side):

Source of shadow is not in the scene:

I have tried [solutions related to enforcing shadows](https://groups.google.com/g/cesium-dev/c/D1aOT3kVPpM) and they do not seem to fix this bug. I recognize that this issue was discussed in an early shadows roadmap [#2594](https://github.com/CesiumGS/cesium/issues/2594). Finally, [here](https://community.cesium.com/t/shadows-not-considering-terrain-outside-rendered-scene/14157) the community discussion that brought this issue to my attention.
Sandcastle example: https://sandcastle.cesium.com/?src=Shadows.html
Browser: Chrome
Operating System: Windows
Let me know if there are any questions or concerns!
Contributor guide
Research direction
Start with the linked Shadows.html Sandcastle example and reproduce the issue by zooming toward a shaded region while terrain shadows are enabled. Compare behavior when the shadow source remains in or leaves the rendered scene. Done means the shaded region remains correctly shadowed after its source terrain is outside the current scene.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100