Fix lighting on main star.

This commit is contained in:
2019-03-13 17:02:15 +01:00
parent fe0124c92a
commit 80a8890606

View File

@@ -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);
@@ -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);