diff options
-rw-r--r-- | derelict.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/derelict.js b/derelict.js index 4839fe6..ebe8a6a 100644 --- a/derelict.js +++ b/derelict.js @@ -101,6 +101,14 @@ function init() { controls.minDistance = 2 controls.maxDistance = 24 + const loader = new THREE.TextureLoader() + loader.loadAsync("https://i.imgur.com/rDGOLFC.jpg") // TODO: Don't use imgur as CDN. + .then(skybox => { + const rt = new THREE.WebGLCubeRenderTarget(skybox.image.height) + rt.fromEquirectangularTexture(renderer, skybox) + scene.background = rt + }); + window.addEventListener('resize', onWindowResize) } |