TA159

Notas, resueltos y trabajos practicos de la materia Sistemas Gráficos
Index Commits Files Refs Submodules README LICENSE
commit 46e3939056ff87a634d23f0aa553619ba6fb4571
parent 80740ed4e8ee2989ed7a50c9a11fd54534640fbe
Author: Martin Klöckner <mjkloeckner@gmail.com>
Date:   Sat, 29 Jun 2024 00:09:05 -0300

add sky texture

Diffstat:
Atp/assets/sky_day.jpg | 0
Mtp/src/scene.js | 4++++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/tp/assets/sky_day.jpg b/tp/assets/sky_day.jpg
Binary files differ.
diff --git a/tp/src/scene.js b/tp/src/scene.js
@@ -25,6 +25,7 @@ const amplitude       = 10;
 const amplitudeBottom = -2.10; // terrain offset
 
 const textures = {
+    sky:              { url: '/assets/sky_day.jpg', object: null },
     roca:             { url: '/assets/roca.jpg', object: null },
     pasto:            { url: '/assets/pasto.jpg', object: null },
     tierra:           { url: '/assets/tierra.jpg', object: null },
@@ -77,6 +78,9 @@ function setupThreeJs() {
 
     window.addEventListener('resize', onResize);
     onResize();
+
+    textures.sky.object.mapping = THREE.EquirectangularRefractionMapping;
+    scene.background = textures.sky.object;
 }
 
 function onTextureLoaded(key, texture) {