Normal mapping

Started by
2 comments, last by neneboricua19 19 years, 6 months ago
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
I''m a signature virus, copy me into your signature and help me spread!
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
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]
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
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

This topic is closed to new replies.

Advertisement