0

I'm developing an app for android with ionic 3. I have a part using babylon.js and another part (not related with each other) using three.js I tested the app in a few devices. Those with Android 5.1.1 can't show the three.js stuff. It says "webGL not supported" or something like that. Also if i try document.createElement("canvas").getContext("webgl") i get null. SO it makes sense so far.

Babylon.js, on the other hand, can show its 3d stuff with no problem. If I try document.createElement("canvas").getContext("webgl") I also get null. BUT: if I try engine.webGLversion I get 2.

On Android 6 or 7, everything works just fine. THREE.js says it is using the webgl engine, and so does Babylon. I know Chrome's webview doesn't allow you to use webgl on Android 5.1.1 or below (???). Anyways, WebGL works fine on Android 6 and 7. Also document.createElement("canvas").getContext("webgl") returns ok.

Then I installed Crosswalk on my app (adding the black list ignore thing) and THREE.js stopped complaining and document.createElement("canvas").getContext("webgl") returns a webGL context alright.

I still don't know if:

  1. babylon has a canvas renderer, and falls back to it when can't find webgl.
  2. babylon has some magic powers and CAN use webGL when Three.js CAN'T

Anyone has gone through the same? thanks

Milo
  • 3,365
  • 9
  • 30
  • 44

1 Answers1

0

I can at least reply to question 1: we chose to only support WebGL contexts in Babylon.js, as the cost of simulating hardware-accelerated rendering using pure canvas is prohibitive.

rob3c
  • 1,936
  • 1
  • 21
  • 20
David Catuhe
  • 1,747
  • 1
  • 10
  • 9