{"action":"created","issue":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/3856","repository_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium","labels_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/3856/labels{/name}","comments_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/3856/comments","events_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/3856/events","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/pull/3856","id":148738323,"number":3856,"title":"Shadows","user":{"login":"lilleyse","id":915398,"avatar_url":"https://avatars.githubusercontent.com/u/915398?v=3","gravatar_id":"","url":"https://api.github.com/users/lilleyse","html_url":"https://github.com/lilleyse","followers_url":"https://api.github.com/users/lilleyse/followers","following_url":"https://api.github.com/users/lilleyse/following{/other_user}","gists_url":"https://api.github.com/users/lilleyse/gists{/gist_id}","starred_url":"https://api.github.com/users/lilleyse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lilleyse/subscriptions","organizations_url":"https://api.github.com/users/lilleyse/orgs","repos_url":"https://api.github.com/users/lilleyse/repos","events_url":"https://api.github.com/users/lilleyse/events{/privacy}","received_events_url":"https://api.github.com/users/lilleyse/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":55,"created_at":"2016-04-15T18:45:42Z","updated_at":"2016-04-18T20:46:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls/3856","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/pull/3856","diff_url":"https://github.com/AnalyticalGraphicsInc/cesium/pull/3856.diff","patch_url":"https://github.com/AnalyticalGraphicsInc/cesium/pull/3856.patch"},"body":"For #2594 \r\n\r\nThis PR adds support for different types of shadows including cascaded directional shadows, spot light shadows, and point light shadows. It also adds the concept of derived commands which are used for OIT, shadows, and later 3D Tiles.\r\n\r\nBy default the scene contains a shadow map whose light source is the sun. It is disabled by default, but can be enabled with `scene.shadowMap.enabled = true`. \r\n\r\nShadow default settings:\r\n\r\n| Type  | Casts Shadows | Receives Shadows |\r\n| --- | --- | --- |\r\n| Globe  | False | True |\r\n| Primitives  | False | False |\r\n| Models  | True | True |\r\n\r\nAny of these can change by setting `castShadows` or `receiveShadows`.\r\n\r\nTo-do:\r\n* [ ] Unit tests\r\n* [ ] Fix `Globe.update` which causes flickery terrain tiles currently\r\n* [ ] Figure out the best approach approach for shadows when the light source is below the horizon. Currently if the globe casts shadows, the surface will be completely shadowed and dark. Maybe day-night shading should be on if shadows are on.\r\n* [ ] Possible support for `GroundPrimitive` if needed.\r\n* [ ] Integration with higher level constructs like `Viewer`.\r\n* [ ] 2D and Columbus view support.\r\n* [ ] Screenshots for twitter\r\n\r\nTesting TODO\r\n* [x] Review [ShadowMap.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/shadows/Source/Scene/ShadowMap.js)\r\n* [x] Step through in debugger\r\n* [x] FPS with shadows on/off to get a ballpark\r\n* [ ] Retest aircraft and satellite CZMLs\r\n* [ ] Terrain"},"comment":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/comments/211568893","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/pull/3856#issuecomment-211568893","issue_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/3856","id":211568893,"user":{"login":"lilleyse","id":915398,"avatar_url":"https://avatars.githubusercontent.com/u/915398?v=3","gravatar_id":"","url":"https://api.github.com/users/lilleyse","html_url":"https://github.com/lilleyse","followers_url":"https://api.github.com/users/lilleyse/followers","following_url":"https://api.github.com/users/lilleyse/following{/other_user}","gists_url":"https://api.github.com/users/lilleyse/gists{/gist_id}","starred_url":"https://api.github.com/users/lilleyse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lilleyse/subscriptions","organizations_url":"https://api.github.com/users/lilleyse/orgs","repos_url":"https://api.github.com/users/lilleyse/repos","events_url":"https://api.github.com/users/lilleyse/events{/privacy}","received_events_url":"https://api.github.com/users/lilleyse/received_events","type":"User","site_admin":false},"created_at":"2016-04-18T20:46:53Z","updated_at":"2016-04-18T20:46:53Z","body":"> How did you come up with 50 and 300? Do these need to be tunable? In practice, would anyone want to change them?\r\n\r\nI started at a view where I thought the aliasing was acceptable, and just printed out the values. Then I just tweaked them after trying different views and models. Too small and the third and fourth cascade would suffer, too large and the shadows would look too blocky up close. At the very least I could turn `maximumDistances` into a private member variable."}}