什么是聚光源

const spotLight = new THREE.SpotLight(0xffffff,1.0);
scene.add(spotLight);
spotLight.position.set(0, 50, 0);
spotLight.target.position.set(50,0,0);
scene.add(spotLight.target);
平行光DirectionalLight阴影步骤
mesh.castShadow = true;
const directionalLight = new THREE.DirectionalLight(0xffffff, 1);
directionalLight.castShadow = true;
### 模型阴影接收属性`.receiveShadow`
planeMesh.receiveShadow = true;
### 4. `.shadowMap.enabled`允许渲染器渲染阴影
renderer.shadowMap.enabled = true;
### `CameraHelper`可视化`.shadow.camera`
const cameraHelper = new THREE.CameraHelper(directionalLight.shadow.camera);
scene.add(cameraHelper);
### 5. `.shadow.camera`设置阴影渲染范围
OrthographicCamera( left, right, top, bottom, near, far )
directionalLight.shadow.camera.left = -50;
directionalLight.shadow.camera.right = 50;
directionalLight.shadow.camera.top = 200;
directionalLight.shadow.camera.bottom = -100;
directionalLight.shadow.camera.near = 0.5;
directionalLight.shadow.camera.far = 600;
阴影范围.shadow.camera