diff options
author | Aki <please@ignore.pl> | 2021-04-02 00:42:05 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2021-04-02 00:42:05 +0200 |
commit | 5f575c6a06b087a604a3af8ed42afe13af8a947d (patch) | |
tree | 53697ca2ccf7609f7539305a6ab5594c087f0696 | |
parent | 0e7a49a66f93463ad66842f8558d66e669e27309 (diff) | |
download | derelict-prototype-5f575c6a06b087a604a3af8ed42afe13af8a947d.zip derelict-prototype-5f575c6a06b087a604a3af8ed42afe13af8a947d.tar.gz derelict-prototype-5f575c6a06b087a604a3af8ed42afe13af8a947d.tar.bz2 |
Added fancy skybox from old EVE
-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) } |