Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

bump map or normal map

4: Adsense

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.


  • You cannot reply to this topic
7 replies to this topic

#1 Jeason   Members   

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.

#2 clb   Members   

2147
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!

#3 Chris_F   Members   

3030
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.

#4 Jeason   Members   

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?

#5 Chris_F   Members   

3030
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.

#6 Jeason   Members   

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.

#7 swiftcoder   Senior Moderators   

18214
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 - Software Engineer @ Amazon - [swiftcoding] [GitHub]


#8 Jeason   Members   

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.