Gamasutra is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

January 24, 2021
Press Releases
January 24, 2021
Games Press

If you enjoy reading this site, you might also want to check out these UBM Tech sites:

# Feature: 'Messing with Tangent Space'

July 16, 2007 | By Staff

July 16, 2007 | By Staff
More: Console/PC

What is tangent space, and more important, what is its relevance to game design? In this in-depth feature, FXLabs programmer Siddharth Hegde discusses both tangent space and its practical uses, and why it is such an important consideration in many of today’s pixel shaders.

In this excerpt, Hegde explains the obvious benefits of utilizing tangent space:

"Why use tangent space in the first place? Why not just declare all positions and vectors in world space?

Certain per pixel lighting techniques and many other shaders require normals and other height information declared at each pixel point. This means that we have one normal vector at each texel and the n axis will vary for each texel. Think of it as a bumpy surface defined on a flat plane.

Now if these normals were declared in the world space coordinate system, we would have to rotate these normals every time the model is rotated even a small amount. Remember that the lights, camera and other objects also involved in these calculations will be defined in world space and will move independent of the object. This would mean thousands or even millions of object to world matrix transformations will need to take place at the pixel level. We all know matrix transformations don't come cheap.

Instead of doing this, we declare the thousands of surface normals in the tangent space coordinate system. Then we just need to transform the other objects (mostly consisting of lights, the camera, etc) to the same tangent space coordinate system and do our calculations there. The count of these objects won’t exceed 10 in most cases.

So it’s 1000000s vs 10s of calculations. Hmmm… It’s going to take a while to decide which one would be better."

You can now read the entire feature with more on the practical uses of tangent space, along with many pseudocode examples (no registration required, please feel free to link to this feature from external websites).

### Related Jobs

Sucker Punch Productions — Bellevue, Washington, United States
[01.22.21]

Programmer
Sucker Punch Productions — Bellevue, Washington, United States
[01.22.21]

Producer
Deep Silver Volition — Champaign, Illinois, United States
[01.21.21]

Senior Technical Designer
Remedy Entertainment — Espoo, Finland
[01.21.21]

Senior Programmer (Character Tech)