diff --git a/code/ObjFileData.h b/code/ObjFileData.h index 51a2088f1..59c39d48c 100644 --- a/code/ObjFileData.h +++ b/code/ObjFileData.h @@ -159,6 +159,7 @@ struct Material aiString textureBump; aiString textureSpecularity; aiString textureOpacity; + aiString textureDisp; //! Ambient color aiColor3D ambient; diff --git a/code/ObjFileImporter.cpp b/code/ObjFileImporter.cpp index eb1d4098f..84b8df5b2 100644 --- a/code/ObjFileImporter.cpp +++ b/code/ObjFileImporter.cpp @@ -556,6 +556,9 @@ void ObjFileImporter::createMaterials(const ObjFile::Model* pModel, aiScene* pSc if ( 0 != pCurrentMaterial->textureBump.length ) mat->AddProperty( &pCurrentMaterial->textureBump, AI_MATKEY_TEXTURE_HEIGHT(0)); + if ( 0 != pCurrentMaterial->textureDisp.length ) + mat->AddProperty( &pCurrentMaterial->textureDisp, AI_MATKEY_TEXTURE_DISPLACEMENT(0) ); + if ( 0 != pCurrentMaterial->textureOpacity.length ) mat->AddProperty( &pCurrentMaterial->textureOpacity, AI_MATKEY_TEXTURE_OPACITY(0)); diff --git a/code/ObjFileMtlImporter.cpp b/code/ObjFileMtlImporter.cpp index db7e947d6..2c63592a0 100644 --- a/code/ObjFileMtlImporter.cpp +++ b/code/ObjFileMtlImporter.cpp @@ -279,6 +279,10 @@ void ObjFileMtlImporter::getTexture() else if (!ASSIMP_strincmp(&(*m_DataIt),"map_bump",8) || !ASSIMP_strincmp(&(*m_DataIt),"bump",4)) out = & m_pModel->m_pCurrentMaterial->textureBump; + // Displacement texture + else if (!ASSIMP_strincmp(&(*m_DataIt),"disp",4)) + out = &m_pModel->m_pCurrentMaterial->textureDisp; + // Specularity scaling (glossiness) else if (!ASSIMP_strincmp(&(*m_DataIt),"map_ns",6)) out = & m_pModel->m_pCurrentMaterial->textureSpecularity;