-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't turn on shadows during viewer construction with Cesium OSM Buildings? #9137
Comments
FYI, this only happens at certain times of the day (I just tried to reproduce and it didn't work). Basically you need shadows to actually be cast in the scene. I edited the original link to have the demo always crash. |
This looks like a clear cut "something isn't initialized yet" bug which cascades into NaNs. |
I've tracked this to be a bug in this condition https://github.com/CesiumGS/cesium/blob/master/Source/Scene/View.js#L322. Rewritting this condition to something like the below code fixes the crash:
I would say the above fix is just a hack and I'm inclined to think the condition is not correct as it is, or at least it is difficult to understand what it does. However I don't feel very comfortable changing this code without more knowledge about what is the intention. Maybe it could be rewritten in a friendlier and more understandable way if the current code is correct.
cc: @lilleyse |
This is more for @lilleyse . I was the last one to modify this file, and may have even introduced a bug in the process (do we know when this bug started happening?), but I'm not familiar enough with the shadow mapping system to know if there are any downsides to your fix |
Thanks for investigating this @jtorresfabra. That helped me narrow down the bug fairly quickly. I opened #9172. |
Here's a Sandcastle with Cesium OSM Buildings. Click the button to toggle shadows, works fine.
If you enable shadows in the viewer constructor, you get:
The text was updated successfully, but these errors were encountered: