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
Threejs Texture
提问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.LinearFilter
to get rid of the error message.
设置yourTexture.minFilter = THREE.LinearFilter
以消除错误消息。