I think rendering performance can be increased with WebGL when render particles or batched sprites or something…
Does it make sense? then, when Cocos2d-JS could be supported on WebGL on mobile browser?
Thanks
I think rendering performance can be increased with WebGL when render particles or batched sprites or something…
Does it make sense? then, when Cocos2d-JS could be supported on WebGL on mobile browser?
Thanks
I’m happy that you asked !
In fact, Cocos2d-JS already support iOS8 WebGL, but it need to be enabled manually, I will post the how to do later.
Let’s just show you some test screen shot first
Sprite Test x3000 - 60fps (12fps on canvas):
Sprite Action Test x600 - 60fps (30fps on canvas):
And the most impressive one, Particle Test x1800 - 60fps (was unable to run on canvas):
Great!
How about on android device?
Maybe mobile chrome also supports WebGL, too.
And… do you have any idea about below topic?
I want to know how to manually enable WebGL on iOS8 (Does it works on android if browser supports WebGL?)
Have a nice day!
Please refer to the modification of CCBoot.js in these two commits:
https://github.com/pandamicro/cocos2d-html5/commit/5688a94d065321467884c997cc8d783d2f5eb558
https://github.com/pandamicro/cocos2d-html5/commit/1c8d61968f4bba780adb8cb4a63dac92413d700f
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.