检测使用 three.js 时的 WebGL 和浏览器兼容性(Detecting WebGL and browser compatibility with three.js)(转)
2016-05-24 09:44
555 查看
太阳火神的美丽人生 (http://blog.csdn.net/opengl_es)
本文遵循“署名-非商业用途-保持一致”创作公用协议
转载请保留此句:太阳火神的美丽人生 - 本博客专注于 敏捷开发及移动和物联设备研究:iOS、Android、Html5、Arduino、pcDuino,否则,出自本博客的文章拒绝转载或再转载,谢谢合作。
ubershmekel edited this page on 30 Nov 2011 · 2
revisions
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:
http://stackoverflow.com/questions/8312546/support-of-canvas-and-webgl-three-js-on-moble-devices https://github.com/mrdoob/three.js/issues/257
转自:http://blog.csdn.net/opengl_es/article/details/38350625
本文遵循“署名-非商业用途-保持一致”创作公用协议
转载请保留此句:太阳火神的美丽人生 - 本博客专注于 敏捷开发及移动和物联设备研究:iOS、Android、Html5、Arduino、pcDuino,否则,出自本博客的文章拒绝转载或再转载,谢谢合作。
检测使用 three.js 时的 WebGL 和浏览器兼容性
(Detecting WebGL and browser compatibility with three.js)
ubershmekel edited this page on 30 Nov 2011 · 2revisions
遇到的问题
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转自:http://blog.csdn.net/opengl_es/article/details/38350625
相关文章推荐
- HTML5中在客户端验证文件上传的大小
- html5 web数据存储
- 页面元素查找之Selectors API
- 使用ajax实现用户登录验证(升级版)
- Canvas 在高清屏下绘制图片变模糊的解决方法
- 关于前端的思考与感悟
- 新时代编辑神器:Atom
- rem : web app适配的秘密武器
- 原生js结合html5制作小飞龙的简易跳球
- HTML5游戏引擎LTweenLite实现的超帅动画效果(附demo源码下载)
- 三个不常见的 HTML5 实用新特性简介
- 低版本IE正常运行HTML5+CSS3网站的3种解决方案
- js+HTML5实现canvas多种颜色渐变效果的方法
- javascript+HTML5的Canvas实现Lab单车动画效果
- javascript+html5实现绘制圆环的方法
- javascript html5实现表单验证
- HTML5实现微信拍摄上传照片功能
- JavaScript+html5 canvas制作的百花齐放效果完整实例
- jQuery+HTML5加入购物车代码分享