Hello,
I created a system with three.js for 360-degree panoramic photo tours. My images are compressed and range from 5 to 20 MB. The loading time is quite long, and once the loading is finished, there is still some time needed to display the result (loading time = display time). So, to display a 10 MB image, it takes 5 seconds.
here a part of my code:
camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 1100 );
camera.target = new THREE.Vector3( 0, 0, 0 );
scene = new THREE.Scene();
var geometry = new THREE.SphereGeometry( 50, 70, 70 );
geometry.scale( - 1, 1, 1 );
console.log("BEFORE");
var textureLoader = new THREE.TextureLoader();
var onProgress = function (xhr) {
if (xhr.lengthComputable) {
var percentComplete = (xhr.loaded / xhr.total) * 100;
console.log(percentComplete + '% loaded');
}
};
var material = new THREE.MeshBasicMaterial({
map: textureLoader.load(
'Image',
(txt)=>{
txt.minFilter = THREE.LinearFilter;
txt.generateMipmaps = false;
},
onProgress
),
});
what is the best practice for optimisation.
Is using a sphere the best option for speed?
and for a transition beetween two pano, i used 2 sphere for have a animation .
it is good ?
thx