Performance of geometries on iOS

There seems to be some performance issues related to drawing shapes on iOS. As an example, the Sandcastle Geometries and Appearances example loads the globe quickly but then loads each shape slowly. The globe is then very unresponsive after loading.

I’m not sure what the difference is but the examples listed under “Geometries” (e.g., Box, Circles and Ellipses, etc.) all seem to behave ok. Perhaps they just have fewer shapes?

I’m not sure if this is performance limitation of the device (I’m using an iPad), or if it is expected to work better. Can anyone with an iOS device confirm the behavior? I will keep investigating to see if I can pinpoint the issue.

Note that other Sandcastle demos seem to work fine.

OK, as a follow up, as tested on an iPad:

  • Basic globe displays fine

  • Add a few shapes displays fine

  • But add more than a few shapes and everything becomes very unresponsive

I tested this on an iPad, using both Safari and Chrome.

The same demos seem to work fine on Android devices.

Again, the Sandcastle Geometries and Appearances demo running on the cesium website is a good example that crawls on iOS.

Can anyone confirm the behavior? I’m not sure what I could be doing wrong, and I assume the cesium website is running the latest version, but I wanted to confirm that I’m not the only one seeing this.

What version of the iPad are you using and what is the exact version of iOS? I have an iPad2, which is ancient and haven’t noticed this problem before (though I haven’t tried it in ages since I’ve moved on to a Nexus 9, I can try it out tonight though).

The main problem is that Safari is a garbage browser and Apple does not take WebGL seriously (their WebGL implementation can’t even get halfway through the WebGL conformance tests without crashing the entire browser). Unfortunately we are stuck with it on iOS since they disallow other browsers. When you run Chrome on iOS it’s really just running the Safari engine with Google services on top. This is true everywhere in iOS, it’s impossible to use anything other than Safari.

I am using an iPad 4th gen, which I guess is a bit older than I thought - late 2012. Was running iOS 8.2 – just realized there is an update so I’ll install 8.3 and see if that helps.

I fully appreciate that Safari is a garbage browser… I’ve had other issues with it in the past.

Thanks for all your help, Matt! You’ve been very helpful on this forum.

Running iOS 8.3 on the 4th gen iPad gives the same results for me. If I can round up a newer iPad, I can give it a try, but if you were using an older iPad 2, then I suspect that’s not the issue.

Thanks for checking into it. When you get a chance, I’d be very interested in knowing whether you get the same behavior or not.

Along the same lines, is there any more documentation on specific device support?

I’m trying to determine what devices will fully support running Cesium. I’ve been digging trying lots of different devices in an attempt to track down those that will work. I know the official FAQ says that Cesium will work on any device/browser that supports WebGL, but I’ve found that not to be the case. Most of the devices I’ve tested report support for WebGL 1, but then fail to load Cesium, with different errors.

iPad 4th gen - works, but very slow when loading more than a few entities

iPhone 5S - seems to work ok!

Samsung Galaxy Tab & Note - both are a few years old - will not load

Samsung Galaxy S4 - Loads, but crashes with shader error when trying to display certain entities (not sure exactly what part is causing the failure)

Microsoft Surface (ARM) - IE11 - fails to load

Microsoft Surface (Intel) - IE11 - works

I can appreciate that some of these devices may be too old to have support, but I guess my issue is that they all claim to support WebGL 1. Are there more specific requirements for Cesium support? For my purposes, I could buy devices that I know will work, but I don’t want to buy something only to find out that it doesn’t work.

Thanks.

As an additional follow up:

It appears that my iPad from 2012 was just too slow to display the Sandcastle Geometries demo. The latest gen iPad Air 2 and the latest gen iPhone 6 seemed to be ok (iPhone 5S seemed ok too).

I walked into Best Buy and tried opening the Cesium Hello World demo on all the tablets there and had poor results on many of them. Reading forum posts makes it sound like Android support should be solid, but I didn’t find that to be the case. I used Chrome and checked to make sure that it was a reasonably up-to-date version. I got renderer errors on initialization in many cases.

My observations:

  • I could not get it to work on any latest gen Samsung devices. On one device, I forget which, it loaded but was very choppy.

  • The Nexus 9 (HTC) worked very well (the only Android device in the store that worked well)

  • All latest gen iOS devices worked very well.

  • All Windows tablets failed.

I suspect the Samsung devices are all using a particular GPU (Adreno?) and the Nexus I believe is using a different one (Kepler?) that has better support?

I’m curious what tablets others have found success with. Or that have had failures with.

It might also be worth reaching out to the jQuery foundation as I know their jQuery Mobile lead has a really amazing mobile testing lab.

Mike, I thought I followed up on this but apparently not, sorry for the delay.

My iPad 2 has the same issue and it’s definitely limited by the GPU. You can see this in the Geometry example because if you rotate the earth so the geometry is offscreen everything speeds up. There’s nothing we can do about this in Cesium, it’s a clear cut hardware limitation. That being said, newer iPads will work much much better because of improved GPU support. You can also work around it on older devices (or improve performance on newer devices) by decreasing the resolution Cesium renders at (see the resolutionScale property on Viewer).

As for mobile devices, we don’t have any kind of guide and maintaining one would be a full time job because of the diversity of the Android landscape. Here are some general thoughts and recommendations.

  1. An Intel based Surface will have the best compatibility all around for Cesium, since it’s really no different than a Windows-based desktop. In fact this should be true for any Windows/Intel based tablet.

  2. While the bad thing about iOS is that Safari is terrible, the good thing about it is that the number of devices you have to test is fairly small and in fact we find that the only difference from device to device is performance, so you only really need to test on one device (the oldest device you plan on supporting your app on).

  3. Android devices are unfortunately a crap shoot. The Google Nexus line would be my recommendation because they are consistent and running Google’s official android distribution. While I haven’t run them in a while, Cesium usually passes all unit tests on them (both Chrome and Firefox). You are correct that what GPU the devices have are a large impact; each separate vendor may have different bugs/driver issues that cause Cesium to not work properly. An S4 with Android 4.4 is a good example of something that should work by doesn’t.

One major point I want to make here is that Cesium is an engine, so the exact requirements for an App built with Cesium are going to vary greatly from app to app. It depends on a number of factors, for example:

  1. What features of Cesium the app is using.

  2. The nature and size of the data set being visualized.

  3. The feature/requirements of the non-Cesium parts of the app (if the app is taking up all of the processing time per-frame, Cesium will suffer even with a light load).

So ultimately, each app needs it’s own testing on the devices it wants to support. How individual Sandcastle examples perform may be a good indicator as to how Cesium in general performance on that device, but does not indicate whether a specific app will or will not perform well.

I expect the mobile landscape to continue to improve on its own; and we are always happy to accepts PRs that address issues on specific mobile platforms.

Hope that helps,

Matt

Matt,

Thanks for your reply. Sounds like my testing gives an accurate depiction of the current mobile environment.

It might be worth making a note on the official Cesium FAQ that a basic Cesium app (Hello World) may not load on all mobile devices that appear to support WebGL, due to device limitations. I’m not so much thinking about my initial problem that overwhelmed an older device with too much data, but about the various new Android devices that can’t load Cesium at all.

The current statement with respect to OS support seems inaccurate, even if the limitation is out of the control of this project:

“Cesium runs on any platform with a WebGL capable browser, including Windows, Linux, OS X, Android, iOS, and Windows Phone.”

Thanks as always for your help.

I ran into a slightly off topic but definitely related issue: Intergrated Intel graphics chips.

Turns out that some versions of the windows device driver support OpenGL, others don't. It is quite frustrating to tell a person who is using a windows PC that they need to buy a video card to view a website. I understand that is the nature of the beast with WebGL, however there has to be some sort of gracefull fallback.

Based on my observations and the ones I've read above I hope that Patrick and company can help me out with a function to detect an OpenGL or WebGL fail, and instead of showing error codes in a popup I can either create my own modal saying "sorry your device is wack" and/or redirect the user to a Leaflet or Open Layers map. Is this possible?

if (WebGL === failtrain) window.open("/mobile-version-map/")

As always I love you guys and your project. Keep up the great work (and thank you for the KML support!)

Jim Lee
ClimateViewer 3D

Hi Jim,

Consider using TerriaJS. It automatically switches to 2D with Leaflet if Cesium can’t run on the system or if it is too slow.

Kevin