# Normal maps from assimp

This topic is 2076 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm trying to load Normal maps using assimp but it never happens (diffuse map works fine.)



if (Mat->GetTextureCount(aiTextureType_NORMALS) > 0 && Mat->GetTexture(aiTextureType_NORMALS, 0,&nMapPath) == AI_SUCCESS)

{

char cpath[100];

sprintf(cpath, "Resources\\Textures\\%s", nMapPath.C_Str());

#if defined(DEBUG) || defined(_DEBUG)

OutputDebugStringA(cpath);

OutputDebugStringA("\n");

#endif

NormalMapSRV.push_back(srv);

}

dunno what's actually wrong but i'm using dwarf.x from directx sdk which should contain normal maps.

full code : http://pastebin.com/hSgGgXn6

##### Share on other sites

Are you asking a question?  What is the symptoms that you are seeing?  Simply that your code is never called doesn't mean that the model isn't loaded properly.  What does the API documentation say should be happening?

##### Share on other sites

Just to be sure, you said that the OutputDebugStringA("Normal Map Loaded:"); is never called, well, looking at the current code, is DEBUG/_DEBUG even defined?

Try debugging whether a normal map is found by assimp, as if the preprocessor isn't defined, you'll never see a message.

Edited by Migi0027

##### Share on other sites

Just to be sure, you said that the OutputDebugStringA("Normal Map Loaded:"); is never called, well, looking at the current code, is DEBUG/_DEBUG even defined?

Try debugging whether a normal map is found by assimp, as if the preprocessor isn't defined, you'll never see a message.

_DEBUG is defined and other code which use if statement with debug work fine.

(i.e I'm always using debug mode for building until the .exe is released for public.)

I'm talking/asking that if my method is wrong of loading normal maps then what should be the right method?

I saw in another post that normal maps are stored in aiTextureType_HEIGHTS but that too doesn't work for me well or dwarf.x has some problems? (the dwarf model is from DirectX SDK and it contains normal map texture but i'm not sure that if the model really uses normal map.)

Edited by newtechnology

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 15
• 20
• 20
• 11
• 9