Threejs 纹理 [英] Threejs Texture

查看:37
本文介绍了Threejs 纹理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

推荐答案

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

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

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

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

这篇关于Threejs 纹理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆