Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

What are the advantages of normals in tangent space to normals in object space for calculation of bump mapping?

share|improve this question
2  
You can also find some information here: tangent space normal mapping‌​. It contains pictures, maybe it's clearer this way for some. –  Sil May 8 '13 at 9:33

1 Answer 1

up vote 19 down vote accepted

Everything, really.

The only benefit to object-space normals is simplicity. They're easier to use.

Tangent-space normals require a tangent-space basis, but offer:

  1. The ability to use the same texture for different surfaces. Object-space normal maps can only ever be used on the surface for which they were created. By regularizing normals in tangent-space, you gain the freedom to use the same bump texture for different surfaces. As long as the surface has a tangent-space basis, you'll get reasonable results.

  2. The ability to modify the texture mapping, with UV animation for example. Since object-space normal maps store normals in object-space, you can't just add 0.5 to all of the texture coordinates and expect to get proper normals from the texture. You can with tangent-space bump mapping.

  3. Smaller component representation. Object-space normal maps must have 3 components; you can't drop one and reconstitute it in the shader. Tangent-space normals will always have a positive Z component, so you can only store the XY of the normal. So you can either get greater precision by using a GL_RG16_SNORM or GL_RG16F formats (32-bits per texel), or employ compression by using an RG-compressed image format (GL_COMPRESSED_SIGNED_RG_RGTC1​, 8-bits per texel) format. You can try to use S3TC on an object-space normal map, but good luck with what you get back.

The absolute most you get with object-space normal maps is less computation time (not having to transform the light direction into tangent space, or alternatively, transforming the normal from tangent space into model space). But that's not a big deal, especially nowadays with deferred renderers running around.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.