-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
needsHillshadePrepare Cannot read properties of undefined #1186
Comments
I think i saw it too, probably related to the fact that it is being checked inside a worker which is more strict. |
@acalcutt I've added a typeof guard check, can you see if latest code still has this issue? |
I updated the example, cleared my browser cache, and tried it again but I still managed to get that error a few times. seems like when I was zooming in and out when browsing around. here's a more detailed error from the chrome console.
|
I'll re-check the code I wrote, I might have not written the right check. |
Thanks for looking into it. |
Ok, I think I'm on to something.
This doesn't seem to be the case in the following invocation:
If I needed to guess, I would guess that the _coordsDescendingInv is not initialized or not in sync with the source cache.@prozessor13 I'm not sure I know how to fix this though. But I was able to reproduce the issue relatively easily by trying to zoom in fast (using the scroll button) into a mountain that has terrain on. Let me know if there's anything else I can help with as I'm not sure how to fix this code... :-( |
Hmm. I think it is a fight between the terrain-sourcecache and the hillshading-sourcecache based on the same source. For terrain there is a different usecase onto the source then in rendering hillshading.
you see this fight in very poor-qualitiy hillshadings in 3d, and i think terrain parallel unload tiles while hillshading wants to access it. But i think, these differences are mandatory, and i spent a lot of work into this to improve performacne! In short, it is not a good idea to use the same source for hillshading & terrain. I did not think about this earlier, because i always loaded pre-rendered hillshading tiles, and so i did not noticed this problem in my tests. To use two different sources is in my opinion no (technical) problem, because they would not load the same tiles twice, but i agree it looks some kind of ugly to use two sources for the same thing. So there a two solutions:
|
I tested adding a second source just for hillshade and it does seem like it helped. I haven't been able to make that issue occur in this test page https://stackblitz.com/edit/web-platform-xyojdp I also notice the hillshade looks a lot better with its own source (it comes out much darker and smoothed when it shared the same source as terrain) |
I'm fine with saying this needs separate source for now. I'm going to close this. |
I think we should address this, but there's a valid "workaround" so this is not a blocker I believe. |
I am testing a terrain demotiles example page here with the latest terrain3d branch code.
https://stackblitz.com/edit/web-platform-x1xjty?file=index.html
I keep seeing this error pop once once and a while
Most of the time it is when I am browsing around quickly looking at terrain... maybe I am not giving it time to load completely before I move to another location. I don't have a good way to reliably reproduce the issue other than click and dragging around with the mouse.
The text was updated successfully, but these errors were encountered: