THREEJS official website-detects WEBGL and browser compatibility when using Three.js (detecting WebGL and browser compatibility with Three.js)

Source: Internet
Author: User

Detects WebGL and browser compatibility when using Three.js (detecting WebGL and browser compatibility with Three.js)

The beautiful Life of the Sun Vulcan (http://blog.csdn.net/opengl_es)

This article follows "Attribution-non-commercial use-consistent" authoring public agreement

Reprint Please keep this sentence: Sun Vulcan's Beautiful Life-this blog focuses on Agile development and mobile and IoT device research: IOS, Android, HTML5, Arduino, Pcduino , Otherwise, the article from this blog refused to reprint or re-reproduced, thank you for your cooperation.



Detecting WebGL and browser compatibility when using Three.js
(Detecting WebGL and browser compatibility with Three.js) Ubershmekel edited this pageOn Nov· 2 Revisions


Problems encountered
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 support Ed.


A solution
A Solution

in order to detect WEBGL compatibility and gracefully inform the user 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);} 
Related Resources
Resources

Http://stackoverflow.com/questions/8312546/support-of-canvas-and-webgl-three-js-on-moble-devices https:// github.com/mrdoob/three.js/issues/257








Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.