I found this 2 years ago - I don’t know why . but it works as expected (I cannot explain why it has THREE.MeshBasicMaterial but no mesh as in sphere geometry)
texture = new THREE.TextureLoader().load(previewdir + pano1);
texture.mapping = THREE.EquirectangularReflectionMapping;
material = new THREE.MeshBasicMaterial({
map: texture
});
tw = 0;
scene.background = texture;
loader = new THREE.TextureLoader().load(megadir + pano1, texture => {
texture.mapping = THREE.EquirectangularReflectionMapping;
scene.background = texture;
scene.background.needsUpdate = true;
});
anyway - what I want to achieve is:
after 10 seconds - when Pano1 Texture is rotating on the screen i want to load a replacement texture
Pano2 Texture like this
loader2 = new THREE.TextureLoader().load(megadir + pano2, texture => {
texture2.mapping = THREE.EquirectangularReflectionMapping;
});
and after 2 Minutes the Pano2 Texture shall replace Pano1 Texture
scene.background = texture2;
scene.background.needsUpdate = true;
But the only thing I get is a black screen which is obviously rotating - its not a crash
Because if I switch back after 4 Minutes as planned to Pano1 texture it still works BUT not as expected Instead of Hires Pano1 The Lowres Preview Texture of Pano1 is displayed - don’t know why this is not overwritten in the variable texture
I worked with easier software 20 years ago - I could assign 4 textures to a terrain by only setting 4 pointers - I wonder why everything is so complicated with THREE -