17
\$\begingroup\$

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

\$\endgroup\$
  • 2
    \$\begingroup\$ You can also find some information here: tangent space normal mapping. It contains pictures, maybe it's clearer this way for some. \$\endgroup\$ – Sil May 8 '13 at 9:33
29
\$\begingroup\$

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.

\$\endgroup\$
1
\$\begingroup\$

A partial answer, to append to Nicol's answer.

Lots of advantages. According to an article I found (which is also linked in the comments), there are still some slight disadvantages. However, with artists that are used to dealing with these problems, or objects that are somehow less prone to these challenges, this disadvantage may not be very impactful.

From an article on tangent space normal mapping:

Although a good implementation can limit problems, the fundamental idea of normal mapping has its flaws. Unwrapping complex models and putting seams in less exposed areas can be tricky for artists. The following images show object space normal maps (left) and tangent space normal maps (right). Here object space normal maps cause a lot less problems because bilinear filtering softens the edges and flat surfaces have simply one normal and are therefore perfectly flat. Seams on the left side are much less visible as the shading is independent from the UV layout and the triangle distortions.

Object space normal maps:

Object space normal maps

Tangent space normal maps:

tangent space normal maps

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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