Skip to content
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

KML clampToGround disappears on mobile #7273

Closed
OmarShehata opened this issue Nov 19, 2018 · 27 comments · Fixed by #9064
Closed

KML clampToGround disappears on mobile #7273

OmarShehata opened this issue Nov 19, 2018 · 27 comments · Fixed by #9064

Comments

@OmarShehata
Copy link
Contributor

Here's a Sandcastle that loads a KML file clamped to ground.

On desktop, everything looks good. On mobile (so far tested on Android Huawei Mate 10 Lite and Huawei P20, as well as an iPad) no KML appears. If clampToGround is set to false it appears.

Not sure where to really begin debugging this. The console shows no errors. Original forum thread

@mramato
Copy link
Contributor

mramato commented Nov 19, 2018

Are ground polylines/polygons on terrain supported on those devices? My assumption is that they aren't and we have a missing check somewhere that's trying to use them anyway

@OmarShehata
Copy link
Contributor Author

Ok, this is interesting. I just tried https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Clamp%20to%20Terrain.html on the ipad and all the drop down options work except:

  • Draw polygon
  • Draw textured polygon
  • Draw corridor

Both Cesium.Entity.supportsMaterialsforEntitiesOnTerrain and Cesium.Entity.supportsPolylinesOnTerrain return true.

@WilCodeBoer
Copy link

WilCodeBoer commented Nov 20, 2018

Original forum poster here.

The devices we tested on also had both Cesium.Entity.supportsMaterialsforEntitiesOnTerrain and Cesium.Entity.supportsPolylinesOnTerrain return true.

@OmarShehata
Copy link
Contributor Author

Thanks for the info @WilCodeBoer . Are you also getting the same results I am on #7273 (comment) ?

I think @likangning93 mentioned somewhere that it was likely because materials on ground primitives are not actually supported, even though it reports that they are, and that using the fallback method should make this work. So either creating a better way to detect when it's supported or creating an option to force the fallback would fix this.

@likangning93
Copy link
Contributor

Related: #6739

@WilCodeBoer
Copy link

@OmarShehata I've tested your sandcastle example and I am getting the same results as you are with one exception

Rectangle also doesn't work on my Huawei Mate 10 Lite and my colleague's Huawei P20.

@Spec1alFx
Copy link

Hi!
I just have opened a issue on polyline clamped to ground because there are some rendering glitches when camera is too near / far (#7377);
I tried some demo and with the one linked by Omar I encountered his same problem;
so I tried with three different devices, I don't know if it useful but I paste here the results.

Please consider my new issue as related with this one because corridors are the easy fallback of clamped to ground polylines.

Results:

Galaxy Note 9
Point with label: OK
Billboard: OK
Corridor: not displayed at all
Polygon: not displayed at all:
Textured polygon: not displayed at all
Rectangle: not displayed at all
Model: OK
Sample line: OK
Polyline: OK with glitches I described

iPhone 6 / iOS 12
Point with label: OK
Billboard: OK
Corridor: not displayed at all
Polygon: not displayed at all:
Textured polygon: not displayed at all
Rectangle: not displayed at all
Model: OK
Sample line: OK
Polyline: OK with glitches I described

Galaxy Note 3
Point with label: OK
Billboard: OK
Corridor: OK (LOL)
Polygon: OK
Textured polygon: error message "not supported"
Rectangle: OK
Model: OK
Sample line: OK
Polyline: not displayed at all

@likangning93
Copy link
Contributor

likangning93 commented Dec 5, 2018

@Spec1alFx thanks for checking on so many devices! Adding to the list, it looks like the Google Pixel (Adreno 530) can handle the above cases as well as desktop. I'd expect similar results on the iPad 4 (A6X/PowerVR SGX554MP4) based on similar tests in #6735, but the gen 1 iPad Pro (A9X) has similar problems with glitches and polygons on terrain not working.

What this problem boils down to is that some devices don't support WebGL extensions as well as desktop, which is kind of hard for us to detect automatically since the devices only report "support" for the extensions instead of how well they support the extensions. The Note 3 must be reporting that the extensions aren't supported at all, which is why it is still able to render corridors - it's falling back to an earlier code path that doesn't depend on the extensions. We're discussing workarounds.

@WilCodeBoer
Copy link

Hi there, it's been a while since this was posted. I'm still having the same issues though. I was wondering if there were any updates for this problem or if there are any quick solutions.

@hpinkos
Copy link
Contributor

hpinkos commented Jan 8, 2019

@WilCodeBoer no sorry, no update yet. We think the problem is related to precision support on some newer mobile devices, but we have to do some more research into alternate techniques for drawing the geometry. The only workaround I can think of would be to disable clampToGround, but I know that's not helpful if you need terrain enabled on the globe.

I'm not quite sure when we'll be able to get to this, but becoming more of a priority because it impacts several features and many of our users. Thanks!

@WilCodeBoer
Copy link

@hpinkos No problem, it's good to see that there's time being invested into the problem, the simple prospect of a better future is good enough for now! For now we are thinking of ways ourselfs to get aroun dit but those would definatly not be a fix to this.

We're also thinking about not adding terrain and simple hover the features a few inches above the ground since most of our projects at the moment are in the netherlands where terrain height isn't that much of an issue.

Thanks alot for the update

@damenking
Copy link

Hello, I am having what I believe is the same issue on the latest version (1.58) while viewing on mobile. Was wondering if there was any update or workaround to this issue. Thanks!

@Maarondesigns
Copy link

I’m glad this issue is getting looked into. I am attaching some screenshots where this happens on iPhone and iPad with poly lines. When you zoom in the poly line breaks up into a bunch of parallel line segments and they move along the path as you zoom in or out and they rotate to be more or less vertical relative to the screen. Weird. 0_o
55F5C5BB-E62A-4EBB-B915-9869CFBCE66D
6019252F-05D4-4900-859D-926B3037124E

@Spec1alFx
Copy link

I’m glad this issue is getting looked into.

Sorry for the straightforwardness, but after 15 months I've given up that they'll solve this bug.

@lilleyse
Copy link
Contributor

@likangning93 would #8311 fix this?

@likangning93
Copy link
Contributor

I don't think so, the main problem is the precision of the depth texture itself.
#8311 should make falling back to corridors more feasible though.

@likangning93
Copy link
Contributor

There's a little more information here too: https://groups.google.com/forum/#!topic/webgl-dev-list/O34GBqZBfmk

@Spec1alFx
Copy link

Spec1alFx commented Feb 20, 2020

I have a test set up here: https://likangning93.github.io/webgl-examples/tests/depthPrecisionDepthTrue/

I tested it with a Note 9 and a iPhone 6, trying both precision mediump and highp:

Note 9 & mediump: red lines (equally spaced)
Note 9 & highp: no red lines
iPhone 6 & mediump: no red lines
iPhone 6 & highp: red lines ("random" spaced)

I'm not sure it could be relevant but I found that:

https://stackoverflow.com/questions/50256568/why-differs-gl-fragcoord-z-from-pos-z-pos-w-1-0-0-5

@lilleyse
Copy link
Contributor

lilleyse commented Jul 28, 2020

The original sandcastle code gets a 404 when loading the KML, but I think this is the same issue as #6735 judging by the screenshot @Maarondesigns posted.

@WilCodeBoer @Spec1alFx @damenking @Maarondesigns if you have a chance, could you test the branch in #9064?

@OmarShehata
Copy link
Contributor Author

@lilleyse I think you meant to link to #9064

@lilleyse
Copy link
Contributor

@OmarShehata oh yes, thanks for pointing that out, I fixed the link

@Spec1alFx
Copy link

@lilleyse I'll be happy to test the branch but I need some help. I cloned the repo and then npm install / npm run build but I have the following error:

            ...taskOptions
            ^^^

SyntaxError: Unexpected token ...
at createScript (vm.js:56:10)
[...]

Can we have a live demo? Thank you

@Spec1alFx
Copy link

@lilleyse thank you! I don't have much time now so for now I just tried two demos. I will try all clamp to ground demos.
Current results:

Galaxy Note 9
Textured polygon: displayed, but when I zoom in it partially disappear and then partially reappear
Polyline: OK with no glitches! Nice

iPhone 6 / iOS 12
Exactly the same behaviour of the Galaxy Note 9

@lilleyse
Copy link
Contributor

Thanks @Spec1alFx, I see the same results.

The polygon disappearing issue is being tracked in #8953

@cesium-concierge
Copy link

cesium-concierge commented Aug 5, 2020

Congratulations on closing the issue! I found these Cesium forum links in the comments above:

https://groups.google.com/d/msg/cesium-dev/oHWKqmeWx9o/dpmDl-BIBAAJ

If this issue affects any of these threads, please post a comment like the following:

The issue at #7273 has just been closed and may resolve your issue. Look for the change in the next stable release of Cesium or get it now in the master branch on GitHub https://github.com/AnalyticalGraphicsInc/cesium.

Omar's Edit: thread in the new forum: https://community.cesium.com/t/clamping-kml-to-ground-on-android-doesnt-work-the-same-as-desktop/7695/6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants