Browse Source

Updated builds.

Mugen87 2 years ago
parent
commit
2ca66f1fd9
4 changed files with 30 additions and 51 deletions
  1. 10 17
      build/three.cjs
  2. 10 17
      build/three.js
  3. 0 0
      build/three.min.js
  4. 10 17
      build/three.module.js

+ 10 - 17
build/three.cjs

@@ -21299,10 +21299,6 @@ class MeshDistanceMaterial extends Material {
 
 		this.type = 'MeshDistanceMaterial';
 
-		this.referencePosition = new Vector3();
-		this.nearDistance = 1;
-		this.farDistance = 1000;
-
 		this.map = null;
 
 		this.alphaMap = null;
@@ -21319,10 +21315,6 @@ class MeshDistanceMaterial extends Material {
 
 		super.copy( source );
 
-		this.referencePosition.copy( source.referencePosition );
-		this.nearDistance = source.nearDistance;
-		this.farDistance = source.farDistance;
-
 		this.map = source.map;
 
 		this.alphaMap = source.alphaMap;
@@ -21555,7 +21547,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
 
 	}
 
-	function getDepthMaterial( object, material, light, shadowCameraNear, shadowCameraFar, type ) {
+	function getDepthMaterial( object, material, light, type ) {
 
 		let result = null;
 
@@ -21633,9 +21625,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;
 
 		}
 
@@ -21669,7 +21660,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 );
 
@@ -21679,7 +21670,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 );
 
@@ -27089,9 +27080,11 @@ function WebGLMaterials( renderer, properties ) {
 
 	function refreshUniformsDistance( uniforms, material ) {
 
-		uniforms.referencePosition.value.copy( material.referencePosition );
-		uniforms.nearDistance.value = material.nearDistance;
-		uniforms.farDistance.value = material.farDistance;
+		const light = properties.get( material ).light;
+
+		uniforms.referencePosition.value.setFromMatrixPosition( light.matrixWorld );
+		uniforms.nearDistance.value = light.shadow.camera.near;
+		uniforms.farDistance.value = light.shadow.camera.far;
 
 	}
 

+ 10 - 17
build/three.js

@@ -21304,10 +21304,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 			this.type = 'MeshDistanceMaterial';
 
-			this.referencePosition = new Vector3();
-			this.nearDistance = 1;
-			this.farDistance = 1000;
-
 			this.map = null;
 
 			this.alphaMap = null;
@@ -21324,10 +21320,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 			super.copy( source );
 
-			this.referencePosition.copy( source.referencePosition );
-			this.nearDistance = source.nearDistance;
-			this.farDistance = source.farDistance;
-
 			this.map = source.map;
 
 			this.alphaMap = source.alphaMap;
@@ -21560,7 +21552,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 		}
 
-		function getDepthMaterial( object, material, light, shadowCameraNear, shadowCameraFar, type ) {
+		function getDepthMaterial( object, material, light, type ) {
 
 			let result = null;
 
@@ -21638,9 +21630,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 			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;
 
 			}
 
@@ -21674,7 +21665,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 							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 );
 
@@ -21684,7 +21675,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 					} 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 );
 
@@ -27094,9 +27085,11 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 		function refreshUniformsDistance( uniforms, material ) {
 
-			uniforms.referencePosition.value.copy( material.referencePosition );
-			uniforms.nearDistance.value = material.nearDistance;
-			uniforms.farDistance.value = material.farDistance;
+			const light = properties.get( material ).light;
+
+			uniforms.referencePosition.value.setFromMatrixPosition( light.matrixWorld );
+			uniforms.nearDistance.value = light.shadow.camera.near;
+			uniforms.farDistance.value = light.shadow.camera.far;
 
 		}
 

File diff suppressed because it is too large
+ 0 - 0
build/three.min.js


+ 10 - 17
build/three.module.js

@@ -21297,10 +21297,6 @@ class MeshDistanceMaterial extends Material {
 
 		this.type = 'MeshDistanceMaterial';
 
-		this.referencePosition = new Vector3();
-		this.nearDistance = 1;
-		this.farDistance = 1000;
-
 		this.map = null;
 
 		this.alphaMap = null;
@@ -21317,10 +21313,6 @@ class MeshDistanceMaterial extends Material {
 
 		super.copy( source );
 
-		this.referencePosition.copy( source.referencePosition );
-		this.nearDistance = source.nearDistance;
-		this.farDistance = source.farDistance;
-
 		this.map = source.map;
 
 		this.alphaMap = source.alphaMap;
@@ -21553,7 +21545,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
 
 	}
 
-	function getDepthMaterial( object, material, light, shadowCameraNear, shadowCameraFar, type ) {
+	function getDepthMaterial( object, material, light, type ) {
 
 		let result = null;
 
@@ -21631,9 +21623,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;
 
 		}
 
@@ -21667,7 +21658,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 );
 
@@ -21677,7 +21668,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 );
 
@@ -27087,9 +27078,11 @@ function WebGLMaterials( renderer, properties ) {
 
 	function refreshUniformsDistance( uniforms, material ) {
 
-		uniforms.referencePosition.value.copy( material.referencePosition );
-		uniforms.nearDistance.value = material.nearDistance;
-		uniforms.farDistance.value = material.farDistance;
+		const light = properties.get( material ).light;
+
+		uniforms.referencePosition.value.setFromMatrixPosition( light.matrixWorld );
+		uniforms.nearDistance.value = light.shadow.camera.near;
+		uniforms.farDistance.value = light.shadow.camera.far;
 
 	}
 

Some files were not shown because too many files changed in this diff