Browse Source

ColladaLoader: added check for existence of diffuse/emissive properties before Material creation in Shader

David Gossow 12 năm trước cách đây
mục cha
commit
b10de6101b

+ 4 - 4
examples/js/loaders/ColladaLoader.js

@@ -3193,21 +3193,21 @@ THREE.ColladaLoader = function () {
 
 
 			case 'constant':
 			case 'constant':
 
 
-				props.color = props.emission;
+				if (props.emissive != undefined) props.color = props.emissive;
 				this.material = new THREE.MeshBasicMaterial( props );
 				this.material = new THREE.MeshBasicMaterial( props );
 				break;
 				break;
 
 
 			case 'phong':
 			case 'phong':
 			case 'blinn':
 			case 'blinn':
 
 
-				props.color = props.diffuse;
+				if (props.diffuse != undefined) props.color = props.diffuse;
 				this.material = new THREE.MeshPhongMaterial( props );
 				this.material = new THREE.MeshPhongMaterial( props );
 				break;
 				break;
 
 
 			case 'lambert':
 			case 'lambert':
 			default:
 			default:
 
 
-				props.color = props.diffuse;
+				if (props.diffuse != undefined) props.color = props.diffuse;
 				this.material = new THREE.MeshLambertMaterial( props );
 				this.material = new THREE.MeshLambertMaterial( props );
 				break;
 				break;
 
 
@@ -4492,4 +4492,4 @@ THREE.ColladaLoader = function () {
 
 
 	};
 	};
 
 
-};
+};