標籤:android style blog http color java 使用 os
檢測使用 three.js 時的 WebGL 和瀏覽器安全色性(Detecting WebGL and browser compatibility with three.js)
太陽火神的美麗人生 (http://blog.csdn.net/opengl_es)
本文遵循“署名-非商業用途-保持一致”創作公用協議
轉載請保留此句:太陽火神的美麗人生 - 本部落格專註於 敏捷開發及移動和物聯裝置研究:iOS、Android、Html5、Arduino、pcDuino,否則,出自本部落格的文章拒絕轉載或再轉載,謝謝合作。
檢測使用 three.js 時的 WebGL 和瀏覽器安全色性
(Detecting WebGL and browser compatibility with three.js)ubershmekel edited this page on 30 Nov 2011 · 2 revisions
遇到的問題
The problem
Not all browsers support WebGL, in fact only chrome and firefox work with three.js WebGLRenderer currently. iOS works with the canvas renderer and although IE9 supports canvas, it doesn‘t support workers so currently isn‘t supported.
一種解決方案
A solution
In order to detect webgl compatibility and gracefully inform the user you can addhttps://github.com/mrdoob/three.js/blob/master/examples/js/Detector.js to your javascript and use this example to avoid even attempting to render anything:
if (Detector.webgl) { init(); animate();} else { var warning = Detector.getWebGLErrorMessage(); document.getElementById(‘container‘).appendChild(warning);}
相關資源
Resources
http://stackoverflow.com/questions/8312546/support-of-canvas-and-webgl-three-js-on-moble-devices https://github.com/mrdoob/three.js/issues/257