Lowering the resolution in retina displays for (much) faster rendering


I was trying to run webglearth and ol3cesium demos on my Android 5.1 device (LG G4). While ol3 takes into account the retina display, and just renders each pixel much larger (effectively lowring the resolution), cesiumjs uses every pixel in the native resolution. This leads to extremely small and unreadable text on raster maps, as well as slow rendering on the device.

Is there a way to make cesiumjs enlarge the effective pixels like ol3 does, so we get a lower-resolution , full screen map, with readable text and (much) faster rendering time?


For browsers that support nearest neighbor scaling (Chrome/Firefox) we actually made a change in 1.18 to make Cesium respect devicePixelRatio by default, so if you use the latest version of Cesium, it should run a lot faster on Android and work exactly as you describe. If that isn’t what you’re seeing, let me know.

We also expose the viewer.resolutionScale property, which can be used to further increase/decrease the resolution that Cesium uses when drawing to the canvas.

Thanks, Mattheu!

This works well on Chrome on Android as well on MacBook, and as you said not yet on Safari.

For some reason it doesn’t work on ol3-cesium.

(BTW, the compiled 1.18 file is marked 1.17 by error).

Mattheu, do you think this can be implemented also for Safari on IOS? What will happen if I try setting viewer.resolutionScale there?

Hello, it is not handled yet (patch welcome) in OL3-Cesium.

See the discussions in https://github.com/openlayers/ol3-cesium/pull/290.