CesiumGS / CesiumGS/cesium

Shadows do not consider terrain that is outside of the rendered scene

Open
#9,641 1 comment 0 reactions 0 assignees View on GitHub
category - graphics type - enhancement
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):

![shadow](https://user-images.githubusercontent.com/39531367/123559253-bab8e600-d74f-11eb-9e5e-6eea170727da.jpeg)

Source of shadow is not in the scene:

![shadow_2](https://user-images.githubusercontent.com/39531367/123559258-c1dff400-d74f-11eb-8589-0ffd68134a6f.jpeg)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.