I have a scene that is made up of a grid of 10 x 2 unique jpeg textures. Each texture is large at 1000 x 1000px as the image is an intricate hand-drawn artwork that recreates a real-world 10m x 2m piece.
When I first started on the scene, I thought to load the image as one large texture. This seemed to work on desktop and it kept the file relatively small (4-5 MB) but was overly compressed and resized on mobile.
The second idea I had was to divide the image into the 10 x 2 grid which got around the compression and resizing on mobile but now have the problem of 20 HTTP requests being made for images that are circa 500kb each (or 10 MB in total) and is very slow to load.
eg.
const materials = [ new THREE.MeshBasicMaterial({map: textureLoader.load(tile_01)}), new THREE.MeshBasicMaterial({map: textureLoader.load(tile_02)}) ...
Is there a way I can import the entire image and split it/position it in Three without the mobile version resizing it and leaving it pixelated? I have read a bit about THREE.Sprite
, texture.repeat
, texture.offset
, and using THREE.Group
and positioning the sprite in the group however I feel I need a steer in the right direction.
Thanks!