Add support for normal maps, the classic way
- get compiant to tinyobjloader and other importers - closes https://github.com/assimp/assimp/issues/3726kimkulling-issues-3726
parent
2f5a31110c
commit
ac6b8988df
|
@ -61,7 +61,8 @@ static const std::string EmissiveTexture1 = "map_emissive";
|
||||||
static const std::string EmissiveTexture2 = "map_Ke";
|
static const std::string EmissiveTexture2 = "map_Ke";
|
||||||
static const std::string BumpTexture1 = "map_bump";
|
static const std::string BumpTexture1 = "map_bump";
|
||||||
static const std::string BumpTexture2 = "bump";
|
static const std::string BumpTexture2 = "bump";
|
||||||
static const std::string NormalTexture = "map_Kn";
|
static const std::string NormalTextureV1 = "map_Kn";
|
||||||
|
static const std::string NormalTextureV2 = "norm";
|
||||||
static const std::string ReflectionTexture = "refl";
|
static const std::string ReflectionTexture = "refl";
|
||||||
static const std::string DisplacementTexture1 = "map_disp";
|
static const std::string DisplacementTexture1 = "map_disp";
|
||||||
static const std::string DisplacementTexture2 = "disp";
|
static const std::string DisplacementTexture2 = "disp";
|
||||||
|
@ -321,7 +322,7 @@ void ObjFileMtlImporter::getTexture() {
|
||||||
// Bump texture
|
// Bump texture
|
||||||
out = &m_pModel->m_pCurrentMaterial->textureBump;
|
out = &m_pModel->m_pCurrentMaterial->textureBump;
|
||||||
clampIndex = ObjFile::Material::TextureBumpType;
|
clampIndex = ObjFile::Material::TextureBumpType;
|
||||||
} else if (!ASSIMP_strincmp(pPtr, NormalTexture.c_str(), static_cast<unsigned int>(NormalTexture.size()))) {
|
} else if (!ASSIMP_strincmp(pPtr, NormalTextureV1.c_str(), static_cast<unsigned int>(NormalTextureV1.size())) || !ASSIMP_strincmp(pPtr, NormalTextureV2.c_str(), static_cast<unsigned int>(NormalTextureV2.size()))) {
|
||||||
// Normal map
|
// Normal map
|
||||||
out = &m_pModel->m_pCurrentMaterial->textureNormal;
|
out = &m_pModel->m_pCurrentMaterial->textureNormal;
|
||||||
clampIndex = ObjFile::Material::TextureNormalType;
|
clampIndex = ObjFile::Material::TextureNormalType;
|
||||||
|
|
Loading…
Reference in New Issue