cutechicken commited on
Commit
c0a7f64
โ€ข
1 Parent(s): 762fa4e

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +9 -8
game.js CHANGED
@@ -821,20 +821,21 @@ class Game {
821
 
822
  // ๋ฉ”์ธ ํƒœ์–‘๊ด‘ ์„ค์ •
823
  const mainLight = new THREE.DirectionalLight(0xffffff, 1.0);
824
- mainLight.position.set(100, 100, 50);
825
  mainLight.castShadow = true;
826
 
827
  // ๊ทธ๋ฆผ์ž ํ’ˆ์งˆ ํ–ฅ์ƒ
828
- mainLight.shadow.mapSize.width = 2048;
829
- mainLight.shadow.mapSize.height = 2048;
830
  mainLight.shadow.camera.near = 0.5;
831
- mainLight.shadow.camera.far = 500;
832
- mainLight.shadow.camera.left = -100;
833
- mainLight.shadow.camera.right = 100;
834
- mainLight.shadow.camera.top = 100;
835
- mainLight.shadow.camera.bottom = -100;
836
  mainLight.shadow.bias = -0.001;
837
  mainLight.shadow.radius = 2;
 
838
 
839
  this.scene.add(mainLight);
840
 
 
821
 
822
  // ๋ฉ”์ธ ํƒœ์–‘๊ด‘ ์„ค์ •
823
  const mainLight = new THREE.DirectionalLight(0xffffff, 1.0);
824
+ mainLight.position.set(MAP_SIZE/2, MAP_SIZE/2, MAP_SIZE/2);
825
  mainLight.castShadow = true;
826
 
827
  // ๊ทธ๋ฆผ์ž ํ’ˆ์งˆ ํ–ฅ์ƒ
828
+ mainLight.shadow.mapSize.width = 4096; // ๊ทธ๋ฆผ์ž ํ•ด์ƒ๋„ ์ฆ๊ฐ€
829
+ mainLight.shadow.mapSize.height = 4096;
830
  mainLight.shadow.camera.near = 0.5;
831
+ mainLight.shadow.camera.far = MAP_SIZE * 2; // ๊ทธ๋ฆผ์ž ๊ฑฐ๋ฆฌ ์ฆ๊ฐ€
832
+ mainLight.shadow.camera.left = -MAP_SIZE; // ๊ทธ๋ฆผ์ž ์˜์—ญ ํ™•์žฅ
833
+ mainLight.shadow.camera.right = MAP_SIZE;
834
+ mainLight.shadow.camera.top = MAP_SIZE;
835
+ mainLight.shadow.camera.bottom = -MAP_SIZE;
836
  mainLight.shadow.bias = -0.001;
837
  mainLight.shadow.radius = 2;
838
+ mainLight.shadow.normalBias = 0.02; // ๊ทธ๋ฆผ์ž ์•„ํ‹ฐํŒฉํŠธ ๊ฐ์†Œ
839
 
840
  this.scene.add(mainLight);
841