首页 > Web开发 > 详细

Threejs 官网 - 检测使用 three.js 时的 WebGL 和浏览器兼容性(Detecting WebGL and browser compatibility with three.js)

时间:2014-08-02 21:00:04      阅读:571      评论:0      收藏:0      [点我收藏+]

检测使用 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  · 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








Threejs 官网 - 检测使用 three.js 时的 WebGL 和浏览器兼容性(Detecting WebGL and browser compatibility with three.js),布布扣,bubuko.com

Threejs 官网 - 检测使用 three.js 时的 WebGL 和浏览器兼容性(Detecting WebGL and browser compatibility with three.js)

原文:http://blog.csdn.net/opengl_es/article/details/38350625

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!