今天在调整渲染系统中的一个MRT机制,结果不小心改错了逻辑,运行报错信息:[.WebGL-00000000051B4190]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.
折腾了半天,结果是因为逻辑问题,没有给framebufferTexture2D()中用到的绑定到多目标的纹理对象的两个属性gl.TEXTURE_MIN_FILTER和gl.TEXTURE_MAG_FILTER设置正确的参数,设置好了就没事了,例如:
gl.texParameteri(texTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
gl.texParameteri(texTarget, gl.TEXTURE_MAG_FILTER, gl.LINEAR);