assimp / assimp

The official Open-Asset-Importer-Library Repository. Loads 40+ 3D-file-formats into one unified and clean data structure.
https://www.assimp.org
Other
11.01k stars 2.92k forks source link

Bug: FBX roughness texture is not found with aiTextureType_DIFFUSE_ROUGHNESS #4767

Open ftedoldi opened 2 years ago

ftedoldi commented 2 years ago

I have a problem when loading FBX objects, in particular the roughness texture is not found. To get the texture i use the following code:

if(material->GetTextureCount(aiTextureType_DIFFUSE_ROUGHNESS) > 0)
{
    mat.hasRoughnessTexture = true;
    std::cout << "Has texture roughness" << std::endl;
    this->_gammaCorrect = false;
    std::vector<Texture2D> roughnessMap = loadTexture(material, aiTextureType_DIFFUSE_ROUGHNESS, this->_gammaCorrect);
    mat.PBR_textures.insert(mat.PBR_textures.end(), roughnessMap.begin(), roughnessMap.end());
}

"Has texture roughness" never get printed. The FBX object i use is a simple sphere with albedo, normal, metallic and roughness maps, exported from blender. gltf and obj objects works fine, the only problem i get is this one with FBX.

redsigma commented 1 year ago

Try to look for aiTextureType_SHININESS . The roughness should be there. Not sure how correct this is but that's how it works from what I tested.