Scene.background?

Is there a way to get the cube image array from the scene.backgroud?

Have you tried scene.background.image?

Thanks a lot for your help, will be very useful.

I am trying this…

**I made an app with an equirectangular image as environment using it as texture in a sphere that works as scenario, I was trying to use the image as scene background but it seems that only accept cube texture. I tried EquirectangularToCubemap to convert my image to cube image but It doesn’t work. this file returns camera.renderTarget.texture, I tried to apply it to scene background and didn’t work,

someone knows how to do this? ( convert equirectangular images to cube image to be used as scene background )

Thanks in advance…

No need to use an external project. There is THREE.CubemapGenerator. Try it with .fromEquirectangular() and see how it goes. The method returns a render target (not a camera). Apply it to the background like so:

scene.background = renderTarget;
2 Likes

Hi, sorry for bother you again, I have been trying to make it work but still having problems.

I tried something like; var tx=new THREE.CubemapGenerator() and give me an error …

How can I apply this on this example? https://jsfiddle.net/jauregui/cbnmwgp4/4/
I’m trying to put the equirectangular to the scene background to the scene background…

Try it like so:

https://jsfiddle.net/agxcko5s/

After including the external example file into your app, execute the following code as soon as your equirectangular image has been loaded.

var generator = new THREE.CubemapGenerator( renderer );
var renderTarget = generator.fromEquirectangular( texture, { resolution: 256 } ); // the resolution depends on your image
scene.background = renderTarget;

Just great, thanks…