Three.js Image is not power of two warning

一个人想着一个人 提交于 2019-12-12 20:44:51

问题


I have a problem with this warning I'm getting from three.js. The warning is: THREE.WebGLRenderer: image is not power of two (600x480). Resized to 512x512 I have tried adding THREE.LinearFilter, but it does nothing.

var texture = new THREE.TextureLoader().load(data[i]['image']);
texture.minFilter = THREE.LinearFilter;
            var paintingGeometry = new THREE.BoxGeometry(1, 1, 1);
            var paintingMaterial = new THREE.MeshPhongMaterial({
                map: texture
            });
            var painting = new THREE.Mesh(paintingGeometry, paintingMaterial);

What are your suggestions? Thanks.


回答1:


There isn't a problem here - all textures need power of two images. If you're having issues with how the texture is scaled and applied to your geometry you should check out the docs for THREE.Texture, specifically the wrap and repeat properties.



来源:https://stackoverflow.com/questions/47330626/three-js-image-is-not-power-of-two-warning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!