Jump to content
  • Advertisement
Sign in to follow this  
Kawahee

Normal mapping

This topic is 5470 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

Recently, my game artist asked me if I could use normal mapping in our game. I had a look around the net and found out that a few games have used it [ Tribes, FarCry ], and I was wondering how to implement it in Direct3D9. Am I correct in saying that it needs to be set through IDirect3DDevice9::SetSamplerState? A small working sample of that would be much appreciated. - Kawahee

Share this post


Link to post
Share on other sites
Advertisement
Normal mapping is the idea of storing the normal vectors of a surface in a texture. It is meant to create the illusion of a very finely tessellated mesh.

Normal mapping is not just a setting you can specify in the device. A normal map is usually specified in either model space or what's called tangent space. After accessing the correct texel from the normal map when rendering, you have to make sure that you perform all your lighting calculations in the correct space. This could mean either transforming the normal from you normal map into the space your lighting information is in on a per-pixel basis, or, more commonly, transforming your lighting information to the space your normal map is in either in your source code or in your vertex shader.

Normal mapping has been discussed in detail many times in this forum and over in the Graphics Programming and Theory forum. I'm sure a search of these two will provide lots of usefull information. If you have specific questions, don't hesitate to ask. There are many knowledgeable and helpfull people in this forum :)

neneboricua

Share this post


Link to post
Share on other sites
Here is a tutorial on normal mapping, using the built-in functionality that you spoke of. However, if you want a reference for you own HLSL shaders, check out the Nvidia SDK. Also, Nvidia has a utility called Melody that generates normal maps.

Good to see ya, neneboricua [smile]

Share this post


Link to post
Share on other sites
Quote:
Original post by circlesoft
Good to see ya, neneboricua [smile]

:) yeah. Been busy working and sustaining my new addiction (City of Heroes). By the time i get home late at night and check the forums, most of the questions have already been answered; well, at least the ones that I can answer in 5 minutes or less.

neneboricua

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!