Browse Source

Merge remote-tracking branch 'AddictArts/dev_colladaMaterials' into dev

Mr.doob 13 years ago
parent
commit
c9dd16f884
2 changed files with 14 additions and 22 deletions
  1. 2 2
      examples/models/monster.dae
  2. 12 20
      src/extras/loaders/ColladaLoader.js

+ 2 - 2
examples/models/monster.dae

@@ -1380,10 +1380,10 @@
               </texture>
             </diffuse>
             <specular>
-              <color>0.9 0.9 0.9 1</color>
+              <color>0.1 0.1 0.1 1</color>
             </specular>
             <shininess>
-              <float>0.415939</float>
+              <float>20</float>
             </shininess>
             <reflective>
               <color>0 0 0 1</color>

+ 12 - 20
src/extras/loaders/ColladaLoader.js

@@ -2935,17 +2935,9 @@ THREE.ColladaLoader = function () {
 
 							}
 
-						} else {
-
-							if ( prop == 'diffuse' ) {
-
-								props[ 'color' ] = cot.color.getHex();
-
-							} else if ( !transparent ) {
+						} else if ( prop == 'diffuse' || !transparent ) {
 
-								props[ prop ] = cot.color.getHex();
-
-							}
+							props[ prop ] = cot.color.getHex();
 
 						}
 
@@ -2979,27 +2971,27 @@ THREE.ColladaLoader = function () {
 		}
 
 		props[ 'shading' ] = preferredShading;
-		this.material = new THREE.MeshLambertMaterial( props );
 
 		switch ( this.type ) {
 
 			case 'constant':
-			case 'lambert':
+
+				props.color = props.emission;
+				this.material = new THREE.MeshBasicMaterial( props );
 				break;
 
 			case 'phong':
 			case 'blinn':
 
-			default:
-
-				/*
-				if ( !transparent ) {
-
-				//	this.material = new THREE.MeshPhongMaterial(props);
+				props.color = props.diffuse;
+				this.material = new THREE.MeshPhongMaterial( props );
+				break;
 
-				}
-				*/
+			case 'lambert':
+			default:
 
+				props.color = props.diffuse;
+				this.material = new THREE.MeshLambertMaterial( props );
 				break;
 
 		}