diff --git a/src/open.js b/src/open.js index 19798f8..84adbc3 100644 --- a/src/open.js +++ b/src/open.js @@ -56,11 +56,11 @@ function addStar() { backMaterial.side = THREE.BackSide; let star = new THREE.Mesh(frontGeometry, material); - star.receiveShadow = true; + star.castShadow = star.receiveShadow = true; coreStarGroup.add(star); let backStar = new THREE.Mesh(backGeometry, backMaterial); - backStar.receiveShadow = true; + backStar.castShadow = backStar.receiveShadow = true; coreStarGroup.add(backStar); let ringGeometry = generateStarRing(2, 3, 0.4); @@ -128,8 +128,8 @@ function startOpenAnimation() { camera.position.z = 5; renderer = new THREE.WebGLRenderer({ - antialias: true - }); + antialias: true + }); renderer.setSize(window.innerWidth, window.innerHeight); renderer.shadowMap.enabled = true; renderer.shadowMap.autoUpdate = true; @@ -149,15 +149,15 @@ function initLighting() { let spotLight = new THREE.PointLight(0xffffff); spotLight.position.set(10, 10, 10); spotLight.castShadow = true; - spotLight.shadow.mapSize.width = 1024; // default - spotLight.shadow.mapSize.height = 1024; // default + spotLight.shadow.mapSize.width = 2048; // default + spotLight.shadow.mapSize.height = 2048; // 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 + spotLight2.shadow.mapSize.width = 2048; // default + spotLight2.shadow.mapSize.height = 2048; // default scene.add(spotLight2); let ambient = new THREE.AmbientLight(0x404040);