HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: Normal Map Tangent Basis  (Read 1038 times)

Amanda_Brooks

  • General Accounts
  • *
  • Posts: 514
    • View Profile
    • Heroes and Villains
Normal Map Tangent Basis
« on: Apr 30, 13, 05:29:22 PM »

I have a technical question from from one of our artists:

"How does the HE calculate its normal map tangent basis?"
« Last Edit: May 02, 13, 12:32:22 AM by Amanda_Brooks »
Logged
"Heroes and Villains" - www.heroes-and-villains.com
Facebook: https://www.facebook.com/HeroesAndVillainsMMORPG
Twitter: @Plan_Z_Studios

HE-BENNETT

  • HeroEngine
  • *****
  • Posts: 559
    • View Profile
Re: Normal Map Tangent Basis
« Reply #1 on: May 01, 13, 10:22:48 AM »

I'm not quite sure what you mean, what problem are you trying to resolve?
Logged

Amanda_Brooks

  • General Accounts
  • *
  • Posts: 514
    • View Profile
    • Heroes and Villains
Re: Normal Map Tangent Basis
« Reply #2 on: May 01, 13, 02:05:58 PM »

This isn't actually a problem, it's just a technical enquirey about something one of our artists is interested in finding out about.
Logged
"Heroes and Villains" - www.heroes-and-villains.com
Facebook: https://www.facebook.com/HeroesAndVillainsMMORPG
Twitter: @Plan_Z_Studios

HE-BENNETT

  • HeroEngine
  • *****
  • Posts: 559
    • View Profile
Re: Normal Map Tangent Basis
« Reply #3 on: May 03, 13, 10:39:24 AM »

To rephrase, the particular combination of words "normal map tangent basis" don't mean anything to me, can you try and explain in more detail what you want to know?
Logged

PN-Dwight

  • General Accounts
  • *
  • Posts: 465
    • View Profile
    • Pirates' Nest
Re: Normal Map Tangent Basis
« Reply #4 on: May 03, 13, 11:22:47 AM »

He is either writing shaders, or he wants to know how the lighting direction is calculated.

Could you ask your artist if he wants to know because he saw some strange lighting occurences that did not fit completely?

Amanda_Brooks

  • General Accounts
  • *
  • Posts: 514
    • View Profile
    • Heroes and Villains
Re: Normal Map Tangent Basis
« Reply #5 on: May 03, 13, 05:34:43 PM »

To rephrase, the particular combination of words "normal map tangent basis" don't mean anything to me, can you try and explain in more detail what you want to know?

He gave more details:

Quote
Tangent-space normal maps use a special kind of vertex data called the tangent basis. This is similar to UV coordinates except it provides directionality across the surface, it forms a surface-relative coordinate system for the per-pixel normals stored in the normal map.

Light rays are in world space, but the normals stored in the normal map are in tangent space. When a normal-mapped model is being rendered, the light rays must be converted from world space into tangent space, using the tangent basis to get there. At that point the incoming light rays are compared against the directions of the normals in the normal map, and this determines how much each pixel of the mesh is going to be lit. Alternatively, instead of converting the light rays some shaders will convert the normals in the normal map from tangent space into world space. Then those world-space normals are compared against the light rays, and the model is lit appropriately. The method depends on who wrote the shader, but the end result is the same.

Unfortunately for artists, there are many different ways to calculate the tangent basis: 3ds Max, Maya, DirectX 9, NVMeshMender, Eric Lengyel, a custom solution, etc. This means a normal map baked in one application probably won't shade correctly in another. Artists must do some testing with different baking tools to find which works best with their output. When the renderer (or game engine) renders your game model, the shader must use the same tangent basis as the normal map baker, otherwise you'll get incorrect lighting, especially across the seams between UV shells.

so, the question is: which application do you recommend to bake normal maps with? is your tangent basis calculation based on any other software or is it your own and we will have to guestimate?
Logged
"Heroes and Villains" - www.heroes-and-villains.com
Facebook: https://www.facebook.com/HeroesAndVillainsMMORPG
Twitter: @Plan_Z_Studios