没有纹理绑定到单元 0 [英] No texture bound to the unit 0
问题描述
我目前正面临一个我似乎无法弄清楚的错误.
I am currently facing an error that I cannot seem to figure out.
在 chrome 中我收到:
In chrome I am receiving:
GL ERROR :GL_INVALID_VALUE : glTexImage2D: invalid internal_format GL_FALSE
RENDER WARNING: there is no texture bound to the unit 0
这导致我的 3D 对象只有黑色纹理,而不是我等待渲染的图像.
Which is resulting in my 3D object having just a black texture rather than the image I have waiting to be rendered.
推荐答案
internal_format
是 gl.texImage2D
的第三个参数.错误消息表示您正在传递 0
或 undefined
或 null
.所有这些都变成 0
,与 GL_FALSE
相同.
internal_format
is the 3rd argument to gl.texImage2D
. The error mesages says you are passing either 0
or undefined
or null
. All of those become 0
which is the same as GL_FALSE
.
您需要传递有效的内部格式,例如 gl.RGBA
、gl.RGB
等...
You need to pass a valid internal format like gl.RGBA
, gl.RGB
, etc...
第二个错误是因为第一个.
The second error is because of the first.
这篇关于没有纹理绑定到单元 0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!