update : add displacement map support to obj-material importer. this feature is supported by some special exporters.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1347 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/13/merge
kimmi 2013-01-07 21:05:53 +00:00
parent 84939d5aec
commit cc88a3a0de
3 changed files with 8 additions and 0 deletions

View File

@ -159,6 +159,7 @@ struct Material
aiString textureBump;
aiString textureSpecularity;
aiString textureOpacity;
aiString textureDisp;
//! Ambient color
aiColor3D ambient;

View File

@ -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));

View File

@ -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;