Shadows are disabled on the translucent globe
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
From https://github.com/CesiumGS/cesium/pull/8726#issuecomment-618777065
I didn't have enough time to figure out why shadows weren't working on the translucent globe, but I suspect it has something to do with the translucent globe commands not impacting the near/far of the shadow map camera correctly.
Rather than digging any deeper I disabled shadows on the translucent globe. This looks alright but ideally we should get to the root of the problem.
This is where shadows get disabled. The `&& !translucent` can be removed to see what it looks like. with shadows on.
https://github.com/CesiumGS/cesium/blob/638c6ebffe86a17637acc8dc5c223f404131f993/Source/Scene/GlobeSurfaceTileProvider.js#L1985-L1988
[Sandcastle](http://localhost:8080/Apps/Sandcastle/index.html#c=bVPbjtowEP0VK30JEuskLNfArrql6kNVqVVB7UukyrFnwcKxke2Adlf77x3H7IUWhNB45sztnOHALDlIOIIlN0TDkSzBybahvzpfWiW8ey+N9kxqsFXSJ0+VJsRtmTBHVxJvW+gHjwdrEfPDmoMUYMuXUtwC8/DbWCXWEZL2MOG5N690pQ84QOxxJ8MMcRgK2ksvwVEmRNo11KyBklRJrEoQjbOEwBbkZutLMshp3jkaI0CVcUxCWitDGqUZfles2Sv4zDzLOpTLli+9T9YfNOlG1afiz93v3jicxujyPUVLZj1aTF/Te2uan0yg7dKrgl4Xs/G0T3I6nk2nk2GfzIa0GA6KvJiO80k+KYa9t/3jvo/GNGuTvjJxFuTK8B3lrbVIy1o2cK7V11ZhZ1wK0sFwNBkNBrQYDSezQSyyYlpw5ryCQObabDYKPrXeG43yrqKMQdZTs5OwfXLfah6WJinfAt+B6EVKz3E4yik8P9PUcdDwpmf3nMfQRpk6hDof7V5dWmdRb5FF1WKMP+AZsFqBQHA4s/lFDJKv/RfG4U7ttwyhOR1dRtaM786BOQKTfrJw/kHBbTwYQj7KZm+sx9NRKR6NBzwaZNdldYuLesqdC4tG8AdvjKpxLRrFu6o7bl/OL3yEdFjgoSR1EPI18zkai+x994WQByLFzYV/HuGKOYeR+1aplXyEKrldZIj/L1UZPEa9+X4Ai30DbFvcfotOSukiw+flzNMy/1T+Cw)

Contributor guide
Research direction
Start in Source/Scene/GlobeSurfaceTileProvider.js at the shadow-disable condition around lines 1985-1988. Reproduce the translucent-globe shadow behavior with the linked Sandcastle example, then trace how translucent globe commands affect the shadow map camera's near and far values. Done means shadows work correctly on the translucent globe without the current workaround.
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
- 45/100