How can I enable an extension on a Three.js shader?
My code so far:
getting extension:
var domElement = document.createElement( \'canvas\' );
var
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');
You should also be able to do this:
renderer.context.getExtension('OES_standard_derivatives');