bump map or normal map

Started by
6 comments, last by xujiezhige 12 years, 2 months ago
I learn something about bump map recently.
But I still wonder why we have to use tangent space? Can we put the normal data of bump map in local space? If so, we just need transform normal to world space, then get the dot production of light direction and normal.
Advertisement
Sure, you can author your texture containing the normal vectors to lie in the object local space. Then you can look up the object normal from the texture. Note that this will require the object to have unique triangle UV coordinates for the whole mesh, and it will disallow wrapping repeating normal maps, like this http://www.paulsprojects.net/tutorials/simplebump/normal.jpg , as-is. You will also not be able to reuse the texture for other meshes, like you can do with that normal.jpg.

Tangent space is much more convenient, since there each pixel on the texture specifies the surface normal with respect to the interpolated surface normal from the vertex data.
Maybe more importantly, if you use object space normals maps, you cannot deform the object in any way. You also can't get away with storing just X & Y and reconstructing Z, so you don't get the benefits of BC5 normal map compression. I think most people just stick to tangent space normals for these reasons.
Thank you, clb and Chris_F.

Chris_F, I store the X,Y,Z for each pixel in the bump map using local space, so I just need fetch the data from bump map, then transform to world space, then take the shade equation. Why do you say I can't get away with storing just X & Y and reconstructing Z?
Because, when you store only X & Y you loosed the negative z portion of the unit sphere. Tangent space normals maps have the advantage of never having a negative Z value (or at least they shouldn't) which makes them perfect for this method.
Thank you.
From your reply and information i find, I get a better knowledge of it.
Generally the most important reason to use tangent space normal maps is to allow skeletal animation. If your model isn't going to be animated, then you can certainly use local space normal maps instead.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Yes, i get it!
Thank you, guys!

This topic is closed to new replies.

Advertisement