From 5f575c6a06b087a604a3af8ed42afe13af8a947d Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 2 Apr 2021 00:42:05 +0200 Subject: Added fancy skybox from old EVE --- derelict.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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) } -- cgit v1.1