From 8fc45011c9dc2aba8446d10860cccb62979ae8fb Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Wed, 13 Mar 2019 15:41:43 +0100 Subject: [PATCH] Add a second light. --- src/open.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/open.js b/src/open.js index 2319de0..19798f8 100644 --- a/src/open.js +++ b/src/open.js @@ -4,7 +4,6 @@ const STAR_POINTS = 5; let scene, camera, renderer; let coreStarGroup; -let lights = {}; let animation = { steps: 0, x: new Float32Array(4), @@ -154,11 +153,15 @@ function initLighting() { spotLight.shadow.mapSize.height = 1024; // default scene.add(spotLight); + let spotLight2 = new THREE.PointLight(0xffffff, 0.8); + spotLight2.position.set(-10, 0, 0); + spotLight2.castShadow = true; + spotLight2.shadow.mapSize.width = 1024; // default + spotLight2.shadow.mapSize.height = 1024; // default + scene.add(spotLight2); + let ambient = new THREE.AmbientLight(0x404040); scene.add(ambient); - - lights.spotLight = spotLight; - lights.ambient = ambient; } /**