mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 17:26:24 +02:00
Merge pull request #9933 from mittens/hotfix/obj-texture-fix
Fixed the texture assignment for the OBJ loader
This commit is contained in:
commit
05c40d2930
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -612,6 +612,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);
|
||||
|
|
Loading…
Reference in a new issue