//****************************
// Skybox for Background (360°)
//****************************
function loadBackground360(TextureName) {
const loaderBG = new THREE.TextureLoader();
const textureBG = loaderBG.load('textures/' + TextureName + '.jpg');
textureBG.anisotropy = renderer.capabilities.getMaxAnisotropy()
textureBG.magFilter = THREE.LinearFilter;
textureBG.minFilter = THREE.LinearFilter;
const shaderBG = THREE.ShaderLib.equirect;
const materialBG = new THREE.ShaderMaterial({
fragmentShader: shaderBG.fragmentShader,
vertexShader: shaderBG.vertexShader,
uniforms: shaderBG.uniforms,
depthWrite: false,
side: THREE.BackSide
});
materialBG.uniforms.tEquirect.value = textureBG;
var planeBG = new THREE.BoxBufferGeometry(2000, 600, 2000);
var bgMesh = new THREE.Mesh(planeBG, materialBG);
scene.add(bgMesh);
}
I have a scene where you can select the background image, but regardless of the size I use for the texture image and BoxBufferGeometry, the texture is still of poor quality. Is there a trick to increase the quality or the level of compression?