Jump to content

  • Log In with Google      Sign In   
  • Create Account


Assimp, problem with textures


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 KaiserJohan   Members   -  Reputation: 1022

Like
0Likes
Like

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 - 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?


Edited by KaiserJohan, 21 April 2013 - 02:04 PM.


Sponsor:

#2 Batryxamat   Members   -  Reputation: 127

Like
0Likes
Like

Posted 22 April 2013 - 10:22 AM

I recently added assimp to import my game assets using Blender to export. I had a similar problem and found that my materials were not exporting the textures from Blender.

 

Have you validated with a human readible model file format that the textures are exporting from your modeling tool?


Edited by Batryxamat, 22 April 2013 - 03:38 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS