2
0
Эх сурвалжийг харах

Fix normal and specular textures not being baked using model library.

clementlandrin 1 жил өмнө
parent
commit
ab92f03ffa

+ 1 - 8
hrt/prefab/l3d/ModelLibrary.hx

@@ -320,7 +320,6 @@ class ModelLibrary extends Prefab {
 		var normalMaps : Array<h3d.mat.BigTexture> = [];
 		var specMaps : Array<h3d.mat.BigTexture> = [];
 		var tmap = new Map();
-		var hasNormal = false, hasSpec = false;
 
 		function allocDefault(name,color,alpha=1) {
 			var tex = new h3d.mat.Texture(16,16);
@@ -539,7 +538,7 @@ class ModelLibrary extends Prefab {
 					hasSpec = specularTexture != null;
 				}
 
-				var pos = loadTexture(sourcePath, diffuseTexture, hasNormal ? normalMap : null, hasSpec ? specularTexture : null);
+				var pos = loadTexture(sourcePath, diffuseTexture, normalMap, specularTexture);
 				if ( pos == null )
 					return null;
 				var matName = m.name;
@@ -572,12 +571,6 @@ class ModelLibrary extends Prefab {
 					};
 					bakedMaterials.set(key, bk);
 
-					// if( !hasNormal && m.normalMap != null )
-					// 	error(sourcePath+"("+m.name+") has normal map texture");
-
-					// if( !hasSpec && m.specularTexture != null )
-					// 	error(sourcePath+"("+m.name+") has specular texture");
-
 					hmd.materials.push(m2);
 					return bk;
 				}