Enabling an extension on a Three.js shader

前端 未结 2 2054
孤街浪徒
孤街浪徒 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');
    
    0 讨论(0)
  • 2021-02-20 04:04

    You should also be able to do this:

    renderer.context.getExtension('OES_standard_derivatives');
    
    0 讨论(0)
提交回复
热议问题