问题
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