openlayers / openlayers

OpenLayers
https://openlayers.org
BSD 2-Clause "Simplified" License
11.34k stars 3.02k forks source link

NumpyTile example not working on Android (chrome) #13529

Open fabry24 opened 2 years ago

fabry24 commented 2 years ago

Describe the bug Android version: 10 Chrome version: 100.0.4896.58 Device: Samsung Galaxy A6

In this example https://openlayers.org/en/latest/examples/numpytile.html is unexpected behaviour. WebGL tile layer does not show in map and in console are warnings (img).

We think that it is caused by using Float32Array data type, because another examples with data tiles and webgl are correct. We found out that extension _OES_texturefloat is not supported on device. We reproduced this bug on multiple devices. img

mike-000 commented 2 years ago

It depends on the WebGL capabilities of the device, not the version of Android or Chrome. It works for me on old Samsung Galaxy Tab 2 (Android 4.2 and Chrome 71) and LG G Pad (Android 4.4 and Chrome 81), as well as modern Nokia X20 (Android 12 and Chrome 100). You can check the capabilities with chrome using chrome://gpu

fabry24 commented 2 years ago

It seems in GeotiffSource it is already solved ((https://openlayers.org/en/latest/examples/cog-math-multisource.html). Should it be possible to solve this problem also for WebGL with DataTileSource?

mike-000 commented 2 years ago

The GeoTIFF examples (except for those which specify normalize: false such as https://openlayers.org/en/latest/examples/cog-style.html and https://openlayers.org/en/latest/examples/cog-stretch.html) have 8 bit bands so do not need Float32 support.

mike-000 commented 2 years ago

It should be possible to fallback to half float if Float32 is not supported. This https://deploy-preview-13534--ol-site.netlify.app/examples/numpytile.html works for me if I force half float on devices which also support Float32 but I do not have anything to test on which does not support Float32. Does it work on your Galaxy A6?

fabry24 commented 2 years ago

Thank for your possible solution, but it doesn't work on my device. It is still the same warning.

mike-000 commented 2 years ago

I have checked similar devices (such as Galaxy A8) using BrowserStack and LambdaTest and in all cases where there was no support for OES_texture_float there was also no support for OES_texture_half_float, so there appears to be no workaround

image