Browse Source

Updated examples builds

Mr.doob 4 years ago
parent
commit
1ba1a70e99

+ 0 - 2
examples/js/effects/OutlineEffect.js

@@ -243,8 +243,6 @@
 
 				if ( material.name === 'invisible' ) return;
 				const outlineParameters = originalMaterial.userData.outlineParameters;
-				material.morphTargets = originalMaterial.morphTargets;
-				material.morphNormals = originalMaterial.morphNormals;
 				material.fog = originalMaterial.fog;
 				material.toneMapped = originalMaterial.toneMapped;
 				material.premultipliedAlpha = originalMaterial.premultipliedAlpha;

+ 0 - 66
examples/js/loaders/FBXLoader.js

@@ -757,7 +757,6 @@
 			} );
 			this.bindSkeleton( deformers.skeletons, geometryMap, modelMap );
 			this.createAmbientLight();
-			this.setupMorphMaterials();
 			sceneGraph.traverse( function ( node ) {
 
 				if ( node.userData.transformData ) {
@@ -1336,71 +1335,6 @@
 
 		}
 
-		setupMorphMaterials() {
-
-			const scope = this;
-			sceneGraph.traverse( function ( child ) {
-
-				if ( child.isMesh ) {
-
-					if ( child.geometry.morphAttributes.position && child.geometry.morphAttributes.position.length ) {
-
-						if ( Array.isArray( child.material ) ) {
-
-							child.material.forEach( function ( material, i ) {
-
-								scope.setupMorphMaterial( child, material, i );
-
-							} );
-
-						} else {
-
-							scope.setupMorphMaterial( child, child.material );
-
-						}
-
-					}
-
-				}
-
-			} );
-
-		}
-
-		setupMorphMaterial( child, material, index ) {
-
-			const uuid = child.uuid;
-			const matUuid = material.uuid; // if a geometry has morph targets, it cannot share the material with other geometries
-
-			let sharedMat = false;
-			sceneGraph.traverse( function ( node ) {
-
-				if ( node.isMesh ) {
-
-					if ( Array.isArray( node.material ) ) {
-
-						node.material.forEach( function ( mat ) {
-
-							if ( mat.uuid === matUuid && node.uuid !== uuid ) sharedMat = true;
-
-						} );
-
-					} else if ( node.material.uuid === matUuid && node.uuid !== uuid ) sharedMat = true;
-
-				}
-
-			} );
-
-			if ( sharedMat === true ) {
-
-				const clonedMat = material.clone();
-				clonedMat.morphTargets = true;
-				if ( index === undefined ) child.material = clonedMat; else child.material[ index ] = clonedMat;
-
-			} else material.morphTargets = true;
-
-		}
-
 	} // parse Geometry data from FBXTree and return map of BufferGeometries
 
 

+ 1 - 7
examples/js/loaders/GLTFLoader.js

@@ -2554,8 +2554,6 @@
 			const useVertexTangents = geometry.attributes.tangent !== undefined;
 			const useVertexColors = geometry.attributes.color !== undefined;
 			const useFlatShading = geometry.attributes.normal === undefined;
-			const useMorphTargets = Object.keys( geometry.morphAttributes ).length > 0;
-			const useMorphNormals = useMorphTargets && geometry.morphAttributes.normal !== undefined;
 
 			if ( mesh.isPoints ) {
 
@@ -2595,15 +2593,13 @@
 			} // Clone the material if it will be modified
 
 
-			if ( useVertexTangents || useVertexColors || useFlatShading || useMorphTargets ) {
+			if ( useVertexTangents || useVertexColors || useFlatShading ) {
 
 				let cacheKey = 'ClonedMaterial:' + material.uuid + ':';
 				if ( material.isGLTFSpecularGlossinessMaterial ) cacheKey += 'specular-glossiness:';
 				if ( useVertexTangents ) cacheKey += 'vertex-tangents:';
 				if ( useVertexColors ) cacheKey += 'vertex-colors:';
 				if ( useFlatShading ) cacheKey += 'flat-shading:';
-				if ( useMorphTargets ) cacheKey += 'morph-targets:';
-				if ( useMorphNormals ) cacheKey += 'morph-normals:';
 				let cachedMaterial = this.cache.get( cacheKey );
 
 				if ( ! cachedMaterial ) {
@@ -2611,8 +2607,6 @@
 					cachedMaterial = material.clone();
 					if ( useVertexColors ) cachedMaterial.vertexColors = true;
 					if ( useFlatShading ) cachedMaterial.flatShading = true;
-					if ( useMorphTargets ) cachedMaterial.morphTargets = true;
-					if ( useMorphNormals ) cachedMaterial.morphNormals = true;
 
 					if ( useVertexTangents ) {
 

+ 0 - 1
examples/js/loaders/LWOLoader.js

@@ -176,7 +176,6 @@
 
 						spec.size = 0.1;
 						spec.map = mat.map;
-						spec.morphTargets = mat.morphTargets;
 						materials[ i ] = new THREE.PointsMaterial( spec );
 
 					} else if ( type === 'lines' ) {

+ 0 - 1
examples/js/loaders/MMDLoader.js

@@ -960,7 +960,6 @@
 				params.emissive = new THREE.Color().fromArray( material.ambient );
 				params.transparent = params.opacity !== 1.0; //
 
-				params.morphTargets = geometry.morphTargets.length > 0 ? true : false;
 				params.fog = true; // blend
 
 				params.blending = THREE.CustomBlending;

+ 2 - 6
examples/js/misc/MD2Character.js

@@ -29,16 +29,12 @@
 
 				const materialWireframe = new THREE.MeshLambertMaterial( {
 					color: 0xffaa00,
-					wireframe: true,
-					morphTargets: true,
-					morphNormals: true
+					wireframe: true
 				} );
 				const materialTexture = new THREE.MeshLambertMaterial( {
 					color: 0xffffff,
 					wireframe: false,
-					map: skinMap,
-					morphTargets: true,
-					morphNormals: true
+					map: skinMap
 				} ); //
 
 				const mesh = new THREE.Mesh( geometry, materialTexture );

+ 2 - 6
examples/js/misc/MD2CharacterComplex.js

@@ -468,16 +468,12 @@
 
 			const materialWireframe = new THREE.MeshLambertMaterial( {
 				color: 0xffaa00,
-				wireframe: true,
-				morphTargets: true,
-				morphNormals: true
+				wireframe: true
 			} );
 			const materialTexture = new THREE.MeshLambertMaterial( {
 				color: 0xffffff,
 				wireframe: false,
-				map: skinMap,
-				morphTargets: true,
-				morphNormals: true
+				map: skinMap
 			} ); //
 
 			const mesh = new THREE.MorphBlendMesh( geometry, materialTexture );

+ 1 - 4
examples/js/postprocessing/SSRPass.js

@@ -11,7 +11,6 @@
 			selects,
 			encoding,
 			bouncing = false,
-			morphTargets = false,
 			groundReflector
 		} ) {
 
@@ -210,9 +209,7 @@
 			this.ssrMaterial.uniforms[ 'cameraProjectionMatrix' ].value.copy( this.camera.projectionMatrix );
 			this.ssrMaterial.uniforms[ 'cameraInverseProjectionMatrix' ].value.copy( this.camera.projectionMatrixInverse ); // normal material
 
-			this.normalMaterial = new THREE.MeshNormalMaterial( {
-				morphTargets
-			} );
+			this.normalMaterial = new THREE.MeshNormalMaterial();
 			this.normalMaterial.blending = THREE.NoBlending; // metalnessOn material
 
 			this.metalnessOnMaterial = new THREE.MeshBasicMaterial( {

+ 2 - 5
examples/js/postprocessing/SSRrPass.js

@@ -9,8 +9,7 @@
 			width,
 			height,
 			selects,
-			encoding,
-			morphTargets = false
+			encoding
 		} ) {
 
 			super();
@@ -154,9 +153,7 @@
 			this.ssrrMaterial.uniforms[ 'cameraProjectionMatrix' ].value.copy( this.camera.projectionMatrix );
 			this.ssrrMaterial.uniforms[ 'cameraInverseProjectionMatrix' ].value.copy( this.camera.projectionMatrixInverse ); // normal material
 
-			this.normalMaterial = new THREE.MeshNormalMaterial( {
-				morphTargets
-			} );
+			this.normalMaterial = new THREE.MeshNormalMaterial();
 			this.normalMaterial.blending = THREE.NoBlending; // refractiveOn material
 
 			this.refractiveOnMaterial = new THREE.MeshBasicMaterial( {

+ 2 - 2
examples/js/renderers/Projector.js

@@ -447,10 +447,10 @@
 								let x = positions[ i ];
 								let y = positions[ i + 1 ];
 								let z = positions[ i + 2 ];
+								const morphTargets = geometry.morphAttributes.position;
 
-								if ( material.morphTargets === true ) {
+								if ( morphTargets !== undefined ) {
 
-									const morphTargets = geometry.morphAttributes.position;
 									const morphTargetsRelative = geometry.morphTargetsRelative;
 									const morphInfluences = object.morphTargetInfluences;