How does it look like if you do this:
var options = {
generateMipmaps: true,
minFilter: THREE.LinearMipmapLinearFilter,
magFilter: THREE.LinearFilter
};
scene.background = new THREE.WebGLCubeRenderTarget( 1024, options ).fromEquirectangularTexture( renderer, textureBG );
In this way you can use Scene.background
and don’t need to create a custom shader.