美文网首页three.js
three.js笔记 之 WebGL兼容性检测

three.js笔记 之 WebGL兼容性检测

作者: 伶念 | 来源:发表于2021-02-25 14:53 被阅读0次

    https://github.com/mrdoob/three.js/blob/master/examples/jsm/WebGL.js引入到你的文件,并在尝试开始渲染之前先运行该文件。

    if (WEBGL.isWebGLAvailable()) {
        // Initiate function or other initializations here
        animate();
    } else {
        const warning = WEBGL.getWebGLErrorMessage();
        document.getElementById('container').appendChild(warning);
    }
    

    相关文章

      网友评论

        本文标题:three.js笔记 之 WebGL兼容性检测

        本文链接:https://www.haomeiwen.com/subject/iseyfltx.html