Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualKaiserJohan

Posted 21 April 2013 - 02:04 PM

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[i];
         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?


#2KaiserJohan

Posted 21 April 2013 - 01:54 PM

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[i];
         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.
        }
    }
}
 

 

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?


#1KaiserJohan

Posted 21 April 2013 - 01:53 PM

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[i];
         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.
        }
    }
}
 

 

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?


PARTNERS