Normal maps from assimp

Started by
2 comments, last by 215648 10 years, 2 months ago

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("Normal Map Loaded:"); //never happens
	
	
	                        OutputDebugStringA(cpath);
	
	
	                        OutputDebugStringA("\n");
	
	
	#endif
	
	
	 
	
	
	                        ID3D11ShaderResourceView* srv = mInfo.Mgr->CreateTexture(cpath);
	
	
	 
	
	
	                        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

Advertisement

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?

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.

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

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.)

This topic is closed to new replies.

Advertisement