diff --git a/code/AssetLib/Obj/ObjFileMtlImporter.cpp b/code/AssetLib/Obj/ObjFileMtlImporter.cpp index 283735912..bf1b70c90 100644 --- a/code/AssetLib/Obj/ObjFileMtlImporter.cpp +++ b/code/AssetLib/Obj/ObjFileMtlImporter.cpp @@ -122,8 +122,8 @@ void ObjFileMtlImporter::load() { { ++m_DataIt; getColorRGBA(&m_pModel->m_pCurrentMaterial->ambient); - } else if (*m_DataIt == 'd') // Diffuse color - { + } else if (*m_DataIt == 'd') { + // Diffuse color ++m_DataIt; getColorRGBA(&m_pModel->m_pCurrentMaterial->diffuse); } else if (*m_DataIt == 's') { @@ -144,7 +144,9 @@ void ObjFileMtlImporter::load() { } else if (*m_DataIt == 'r') { // Material transmission alpha value ++m_DataIt; - getFloatValue(m_pModel->m_pCurrentMaterial->alpha); + ai_real d; + getFloatValue(d); + m_pModel->m_pCurrentMaterial->alpha = static_cast(1.0) - d; } m_DataIt = skipLine(m_DataIt, m_DataItEnd, m_uiLine); } break;