RelaX Posted August 24, 2015 Share Posted August 24, 2015 Hi,I have the following Problem, BABYLON.Engine.isSupported() delivers true on the default Android Browser. but it doesn't support WebGL. I would like to give an error message, but I can't find a solution for it, any ideas? brgds Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 24, 2015 Share Posted August 24, 2015 interesting if you look at the code, you will see that this has to be a bug in Android Browser:https://github.com/BabylonJS/Babylon.js/blob/master/src/babylon.engine.ts#L2355 RelaX 1 Quote Link to comment Share on other sites More sharing options...
RelaX Posted August 25, 2015 Author Share Posted August 25, 2015 Yeah I know, but what would be a better way to test it? Compiling a Shader surrounded by a try catch block? Okay nvm, surrounding everything with a try catch block isn't working, hm Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 25, 2015 Share Posted August 25, 2015 Rats ! can you try to go deeper like trying to call gl.enable(gl.DEPTH_TEST); ? Quote Link to comment Share on other sites More sharing options...
RelaX Posted August 27, 2015 Author Share Posted August 27, 2015 Hm, still not working, whats wrong with this stupid Android Browser...var isSupported = function () { try { var tempcanvas = document.createElement('canvas'); var gl = tempcanvas.getContext('webgl') || tempcanvas.getContext('experimental-webgl'); gl.enable(gl.DEPTH_TEST); return BABYLON.Engine.isSupported(); } catch (e) { return false; }};After I copy pasted a ShaderCompiler I tried something different. Seems like the Android Browser has a very very experimental-webgl context.This example workshttp://learningwebgl.com/lessons/lesson04/index.htmland this doesn'thttp://learningwebgl.com/lessons/lesson05/index.html The only difference is the Texture.var isSupported = function () { var nua = navigator.userAgent.toLowerCase(); var is_android = ((nua.indexOf('mozilla/5.0') > -1 && nua.indexOf('android ') > -1 && nua.indexOf('applewebkit') > -1) && !(nua.indexOf('chrome') > -1)); return !(is_android || !BABYLON.Engine.isSupported());};Seems to work fine. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 27, 2015 Share Posted August 27, 2015 OMG nice try ! Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted September 6, 2015 Share Posted September 6, 2015 Hmm ? Something here sound strange to my ears... Android default browser actually supports WebGL pretty well (even better than FF mobile or Chrome mobile, better FPS). FYI : except for one stupid fracking piece of code : camera.attachControl(canvas, true); with false everything is ok, but with true, there are inner awfull conflicts, finger swiping on screen results in scene AND html page trying to go both up and down at same time, resulting in a happy jiggle dance (no problem in FF or Chrome mobile, expected behavior happens : swiping finger up rotates camera down AND scrolls page down at same time). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.