summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2021-04-02 00:42:05 +0200
committerAki <please@ignore.pl>2021-04-02 00:42:05 +0200
commit5f575c6a06b087a604a3af8ed42afe13af8a947d (patch)
tree53697ca2ccf7609f7539305a6ab5594c087f0696
parent0e7a49a66f93463ad66842f8558d66e669e27309 (diff)
downloadderelict-prototype-5f575c6a06b087a604a3af8ed42afe13af8a947d.zip
derelict-prototype-5f575c6a06b087a604a3af8ed42afe13af8a947d.tar.gz
derelict-prototype-5f575c6a06b087a604a3af8ed42afe13af8a947d.tar.bz2
Added fancy skybox from old EVE
-rw-r--r--derelict.js8
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)
}