As I dive into learning three.js, one of my goals is to incorporate a 16x9 photo into my scene.
Below is the snippet of code where I add an Array of images
to my scene:
const material = new MeshBasicMaterial({
map: loader.load(images[i]),
transparent: true,
opacity: 1,
});
const plane = new Mesh(new PlaneGeometry(imageWidth, 45), material);
plane.overdraw = true;
plane.position.x = i * (imageWidth + imageOffset);
plane.position.y = 0;
this.introImages.push({
obj: plane,
round: 1,
});
this.introImagesGroup.add(this.introImages[i].obj);
A console warning has surfaced:
THREE.WebGLRenderer: image is not power of two (1600x900). Resized to 1024x512
The literature suggests that texture dimensions should be the power of two for optimization purposes. This leads me to question if my current approach to adding images to the scene in three.js is the most optimal, or if there are alternative methods for incorporating non-power of two images?