Advertisement
yskang

threejs-viewer-5

May 6th, 2020
985
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Add lights
  2. var ambientLight = new THREE.AmbientLight( 0xcccccc, 0.6 );
  3. scene.add( ambientLight );
  4. this.lights.push( ambientLight );
  5.  
  6. const dirLight = new THREE.DirectionalLight( 0xffffff, 1.4 );
  7. dirLight.position.set( 70, 122, -7 );
  8. dirLight.castShadow = true;
  9. dirLight.shadow.bias = -0.0001;
  10. dirLight.shadow.radius = 1;
  11. dirLight.shadow.camera.top = 15;
  12. dirLight.shadow.camera.bottom = -15;
  13. dirLight.shadow.camera.left = -25;
  14. dirLight.shadow.camera.right = 25;
  15. dirLight.shadow.mapSize.width = 1024;
  16. dirLight.shadow.mapSize.height = 1024;
  17. this.scene.add( dirLight );
  18. this.lights.push( dirLight );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement