|
@@ -226,7 +226,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- function getDepthMaterial( object, material, light, shadowCameraNear, shadowCameraFar, type ) {
|
|
|
+ function getDepthMaterial( object, material, light, type ) {
|
|
|
|
|
|
let result = null;
|
|
|
|
|
@@ -304,9 +304,8 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
if ( light.isPointLight === true && result.isMeshDistanceMaterial === true ) {
|
|
|
|
|
|
- result.referencePosition.setFromMatrixPosition( light.matrixWorld );
|
|
|
- result.nearDistance = shadowCameraNear;
|
|
|
- result.farDistance = shadowCameraFar;
|
|
|
+ const materialProperties = _renderer.properties.get( result );
|
|
|
+ materialProperties.light = light;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -340,7 +339,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
if ( groupMaterial && groupMaterial.visible ) {
|
|
|
|
|
|
- const depthMaterial = getDepthMaterial( object, groupMaterial, light, shadowCamera.near, shadowCamera.far, type );
|
|
|
+ const depthMaterial = getDepthMaterial( object, groupMaterial, light, type );
|
|
|
|
|
|
_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );
|
|
|
|
|
@@ -350,7 +349,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
} else if ( material.visible ) {
|
|
|
|
|
|
- const depthMaterial = getDepthMaterial( object, material, light, shadowCamera.near, shadowCamera.far, type );
|
|
|
+ const depthMaterial = getDepthMaterial( object, material, light, type );
|
|
|
|
|
|
_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );
|
|
|
|