Advertisement Jump to content
Sign in to follow this  
newtechnology

Normal maps from assimp

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

If you intended to correct an error in the post then please contact us.

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("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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
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 this post


Link to post
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!