scene.background CubeTextureLoader with OrthographicCamera doesn’t render

Description of the problem

When using an orthographic camera, the scene background (if it’s a cube texture) won’t render.
Here’s a test: http://jsfiddle.net/e50fz47r/
If you uncomment the perspective camera you’ll see that it renders just fine.

Three.js version
  • Dev
  • r99
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

MacBook Air (13-inch, Mid 2012)
Intel HD Graphics 4000 1536 MB

Author: Fantashit

3 thoughts on “scene.background CubeTextureLoader with OrthographicCamera doesn’t render

  1. I do not think it makes sense to use an orthographic camera with a skybox, since the projection varies as a function of the skybox’s size.

    A perspective camera does not have that problem (as long as the camera is centered in the skybox, something we ensure).

  2. This workaround seems to be alright for my purposes:

    init(){
      camera = new THREE.OrthographicCamera( -w/2, w/2, -h/2, h/2, 1, 1000 )
      // near cuts off the rest of the scene
      spaceCam = new THREE.PerspectiveCamera( 30, w / h, 1000, 10000 )
    }
    render(){
      spaceCam.position.copy(camera.position)
      spaceCam.lookAt(vOrigin)
      renderer.autoClear = true
      renderer.render( scene, spaceCam )
      renderer.autoClear = false
      renderer.render( scene, camera )
    }
  3. Closing. It’s better to continue the discussion at the forum. We can reopen the issue if there is a more concrete feature request.

Comments are closed.