diff --git a/examples/webgl_shadowmap_pointlight.html b/examples/webgl_shadowmap_pointlight.html index 4545eea509056..cbb37398d2181 100644 --- a/examples/webgl_shadowmap_pointlight.html +++ b/examples/webgl_shadowmap_pointlight.html @@ -41,8 +41,6 @@ const light = new THREE.PointLight( color, intensity, 20 ); light.castShadow = true; - light.shadow.camera.near = 1; - light.shadow.camera.far = 60; light.shadow.bias = - 0.005; // reduces self-shadowing on double-sided objects let geometry = new THREE.SphereGeometry( 0.3, 12, 6 ); diff --git a/src/lights/PointLightShadow.js b/src/lights/PointLightShadow.js index ee635cb93c6ea..995a0bca050b3 100644 --- a/src/lights/PointLightShadow.js +++ b/src/lights/PointLightShadow.js @@ -64,6 +64,15 @@ class PointLightShadow extends LightShadow { const camera = this.camera; const shadowMatrix = this.matrix; + const far = light.distance || camera.far; + + if ( far !== camera.far ) { + + camera.far = far; + camera.updateProjectionMatrix(); + + } + _lightPositionWorld.setFromMatrixPosition( light.matrixWorld ); camera.position.copy( _lightPositionWorld );