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.


Gamasutra: The Art & Business of Making Gamesspacer
View All     RSS
November 14, 2019
arrowPress Releases







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


Feature: 'Messing with Tangent Space'

Feature: 'Messing with Tangent Space'

July 16, 2007 | By Staff

July 16, 2007 | By Staff
Comments
    Post A Comment
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 todays 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 wont exceed 10 in most cases.

So its 1000000s vs 10s of calculations. Hmmm Its 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

Embodied Inc.
Embodied Inc. — Pasadena, California, United States
[11.13.19]

QA Tester
Insomniac Games
Insomniac Games — Burbank CA or Durham NC, California, United States
[11.13.19]

Mid to Senior Engine Programmer (Tools)
Insomniac Games
Insomniac Games — BURBANK, California, United States
[11.13.19]

Character TD (Rigger)
Free Range Games
Free Range Games — Sausalito, California, United States
[11.13.19]

Senior Engineer (Unreal)









Loading Comments

loader image