• Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

# bump map or normal map

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

7 replies to this topic

### #1Jeason  Members   -  Reputation: 96

Like
0Likes
Like

Posted 05 February 2012 - 03:50 AM

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.

### #2clb  Members   -  Reputation: 1587

Like
1Likes
Like

Posted 05 February 2012 - 04:09 AM

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.
Me+PC=clb.demon.fi | C++ Math and Geometry library: MathGeoLib, test it live! | C++ Game Networking: kNet | 2D Bin Packing: RectangleBinPack | Use gcc/clang/emcc from VS: vs-tool | Resume+Portfolio | gfxapi, test it live!

### #3Chris_F  Members   -  Reputation: 743

Like
1Likes
Like

Posted 05 February 2012 - 10:48 AM

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.

### #4Jeason  Members   -  Reputation: 96

Like
0Likes
Like

Posted 05 February 2012 - 08:16 PM

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?

### #5Chris_F  Members   -  Reputation: 743

Like
0Likes
Like

Posted 05 February 2012 - 08:46 PM

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.

### #6Jeason  Members   -  Reputation: 96

Like
0Likes
Like

Posted 05 February 2012 - 09:04 PM

Thank you.
From your reply and information i find, I get a better knowledge of it.

### #7swiftcoder  Senior Moderators   -  Reputation: 4722

Like
1Likes
Like

Posted 07 February 2012 - 04:19 PM

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 - SDE @ Amazon - swiftcoding        [Need to sync your files via the cloud? | Need affordable web hosting?]

### #8Jeason  Members   -  Reputation: 96

Like
0Likes
Like

Posted 07 March 2012 - 05:47 AM

Yes, i get it!
Thank you, guys!

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS