I am using assimp to import 3d models in my game engine. For some reason, no matter what model or model format I use, assimp does not report any textures whatsoever. Why is this?
The following is the very simple setup with assimp:
const aiScene* scene = importer.ReadFile(asset, aiProcessPreset_TargetRealtime_Quality);
if (scene->HasMaterials())
{
for (unsigned int i = 0; i < scene->mNumMaterials; i++)
{
const aiMaterial* material = scene->mMaterials;
aiString texturePath;
unsigned int numTextures= material->GetTextureCount(aiTextureType_DIFFUSE); // always 0
if (material->GetTextureCount(aiTextureType_DIFFUSE) > 0 && material->GetTexture(aiTextureType_DIFFUSE, 0, &texturePath) == AI_SUCCESS)
{
// never happens..
// scene->mNumTextures is always 0 aswell - although that only applies to embedded textures
}
}
}
I'm using various models that I am positive has textures, for example models from tutorials that are designed for the very specific reason of loading textured models using assimp.
What could be the reason for this?