dartium에서 웹 앱을 실행할 때 [.WebGLRenderingContext]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering or is not 'texture complete'
오류가 발생합니다. 코드를 완전히 다시 작성하는 등 이틀 동안이 문제를 해결하기 위해 노력했지만 문제를 격리 할 수는 없습니다.다트 : web_gl : 렌더링 경고 : 텍스처 단위 0에 바인딩 된 텍스처는 렌더링 할 수 없습니다.
그러나 문제는이 코드 조각에 있다고 생각합니다.
void main() {
...
var texture = gl.createTexture();
var image = new ImageElement();
image.onLoad.listen((e) {
gl.bindTexture(webGL.TEXTURE_2D, texture);
gl.texImage2DImage(webGL.TEXTURE_2D, 0, webGL.RGBA, webGL.RGBA,
webGL.UNSIGNED_BYTE, image);
gl.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_MAG_FILTER, webGL.NEAREST);
gl.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_MIN_FILTER, webGL.NEAREST);
gl.bindTexture(webGL.TEXTURE_2D, null);
});
image.src = "tex.png";
...
}
tex.png는 32 × 32
문제가 무엇인지에 대한 어떤 아이디어인가?
gl.generateMipmap (gl.TEXTURE_2D); 도와 드릴까요? – Fox32
@ Fox32 그렇지 않습니다. 그리고 밉맵 매개 변수를 설정할 때만 필요하지 않습니까? – lightandlight