Browse Source

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

David Gossow 12 years ago
parent
commit
b10de6101b
1 changed files with 4 additions and 4 deletions
  1. 4 4
      examples/js/loaders/ColladaLoader.js

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

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