ThreeJS: Get useful shader build log

Fab*_*rer 2 shader three.js

When my ThreeJS custom shaders contains errors, I get the very cryptic INVALID_OPERATION message in the JS console during the rendering stage:

WebGL: INVALID_OPERATION: useProgram: program not valid
Run Code Online (Sandbox Code Playgroud)

Is there a way to get a more useful log, such as the one returned by getShaderInfoLog()?

(To test this quickly, one can add errors in the shaders of this app.)

Mug*_*n87 5

出于性能原因,three.js R104在编译着色器程序时不再执行错误检查和报告。但是,多个用户抱怨此更改,因此最近已将其还原。在下一个发行版中R105,一切将与以前一样(请参阅迁移指南)。

但是,您可以R104通过设置renderer.debug.checkShaderErrors为手动打开以前的行为true