BeZe
November 6, 2015, 7:58pm
#1
Hey guys,
We were trying to figure out why on WebGL capable android devices (os 5+) we couldn’t get cocos to run in WebGL rendering mode, and came across this in CCBoot.js
var shieldOs = [sys.OS_ANDROID];
that later fails WebGL detection in
if(userRenderMode === 2 || (userRenderMode === 0 && supportWebGL && shieldOs.indexOf(sys.os) === -1 && shieldBrowser.indexOf(sys.browserType) === -1))
Is there any reason for a shield like this? How can we make our web based game use WebGL advantages? Any flag to set anywhere?
for other users looking for a similar answer, I confirm that defining shieldOs as empty array allows webGL works in android browser. references:
We deactivated webgl on Android by osSupportWebGL white list, because some of the browsers on Android support WebGL in an experimental way. You can activate it manually by adding sys.OS_ANDROID in the white list.
I have a android phone run on android5.0, and I run html5test, it support webgl on html5test. But when I run my code. it still use canvas render. my cocos2d-html version is cocos2d-js-v3.8