Fixed AO being applied to OBJ model transparency, and OBJ loader trying to force the loading of the builtin white texture.

This commit is contained in:
RainWarrior committed 2015-10-27 18:36:57 +03:00
1 parent a96ba1b7f7
commit b75593b0c6
1 file changed
+2 -2
@@ -90,7 +90,7 @@ public class OBJModel implements IRetexturableModel, IModelCustomData
{
Material mat = materialIterator.next();
ResourceLocation textureLoc = new ResourceLocation(mat.getTexture().getPath());
if (!textures.contains(textureLoc))
if (!textures.contains(textureLoc) && !mat.isWhite())
textures.add(textureLoc);
}
return textures;
@@ -1423,7 +1423,7 @@ public class OBJModel implements IRetexturableModel, IModelCustomData
break;
case COLOR:
float d = LightUtil.diffuseLight(n.normal.x, n.normal.y, n.normal.z);
if (v.getMaterial() != null) builder.put(e, d * v.getMaterial().getColor().x, d * v.getMaterial().getColor().y, d * v.getMaterial().getColor().z, d * v.getMaterial().getColor().w);
if (v.getMaterial() != null) builder.put(e, d * v.getMaterial().getColor().x, d * v.getMaterial().getColor().y, d * v.getMaterial().getColor().z, v.getMaterial().getColor().w);
else builder.put(e, d, d, d, 1);
break;
case UV: