Fixed the texture assignment for the OBJ loader (it wasn't doing anything with the spceular texture)

This commit is contained in:
trent 2017-03-17 14:34:17 -04:00
parent a38ab4ff80
commit f1e81c34a3

View file

@ -267,7 +267,7 @@ void OBJReader::parseMaterialLibrary(QIODevice* device) {
}
if (token == "map_Kd") {
currentMaterial.diffuseTextureFilename = filename;
} else {
} else if( token == "map_Ks" ) {
currentMaterial.specularTextureFilename = filename;
}
}
@ -611,6 +611,9 @@ FBXGeometry* OBJReader::readOBJ(QByteArray& model, const QVariantHash& mapping,
if (!objMaterial.diffuseTextureFilename.isEmpty()) {
fbxMaterial.albedoTexture.filename = objMaterial.diffuseTextureFilename;
}
if (!objMaterial.specularTextureFilename.isEmpty()) {
fbxMaterial.specularTexture.filename = objMaterial.specularTextureFilename;
}
modelMaterial->setEmissive(fbxMaterial.emissiveColor);
modelMaterial->setAlbedo(fbxMaterial.diffuseColor);