Enabling an extension on a Three.js shader

前端 未结 2 2024
孤街浪徒
孤街浪徒 2021-02-20 03:21

How can I enable an extension on a Three.js shader?

My code so far:

getting extension:

var domElement = document.createElement( \'canvas\' );
var         


        
2条回答
  •  一整个雨季
    2021-02-20 03:57

    Found the error. You have to use the renderer's dom element:

    var gl = renderer.domElement.getContext('webgl') ||
                renderer.domElement.getContext('experimental-webgl');
    gl.getExtension('OES_standard_derivatives');
    

提交回复
热议问题