javascript Threejs 纹理

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29421702/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 10:31:10  来源:igfitidea点击:

Threejs Texture

javascriptthree.js

提问by Stefano Maglione

When I execute my render of some geometry I can see in my console this warning:

当我执行某些几何图形的渲染时,我可以在控制台中看到此警告:

THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.

I can't understand the reason and the background of my canvas is completely black.

我无法理解原因,我的画布的背景是全黑的。

回答by gaitat

The size of your texture is not powers of two (ie. 16x16, 32x32, 64x64 ...).

纹理的大小不是 2 的幂(即 16x16、32x32、64x64 ...)。

Set yourTexture.minFilter = THREE.LinearFilterto get rid of the error message.

设置yourTexture.minFilter = THREE.LinearFilter以消除错误消息。