How does Mikktspace work for calculating the tangent space during normal mapping?

Increasingly the 3D industry is adopting the standard of Mikktspace for calculating tangent space for normal mapping and other effects which rely on accurate and consistent calculation of tangent space from one application to another. Blender, xNormal, Unity, Substance Painter and Unreal Engine are just a few I can think of which now use Mikttspace. I'm personally attempting to re-code my own projects to adopt this standard as well.

But there are very few resources on how Mikktspace works as it is a relatively new thing. What little resources there are, are usually scarce on details and very technical, not very user friendly to understand, or assume the coder has a certain level of knowledge which is a bit above the average newbie just starting out who needs things explained more carefully.

I am looking for a clear explanation of how Mikktspace works and how to implement it, with a simple explanation of how the maths and code works in a way which is not limited to just one language.

For the sake of example, lets suppose a programmer has a mesh object, with a index of vertices, each with a position, normal and UV coordinate, and list of triangles which reference that index.

For example:

• Vertex: { X Y Z NX NY NZ S T }
• VertexIndex: A list of Vertex
• Triangle: { V1 V2 V3 } (in correct winding order for normal direction)
• TriangleList: A list of Triangle

In simple terms, how would one go about calculating per vertex a tangent vector (TX TY TZ) and bitangent vector (BX BY BZ) for each vertex in a way which conforms to Mikktspace?

• Is it too hard? Anyone is welcome to give it a go if they feel they can give an answer. Even just a brief explanation of what specifically differs from Mikktspace's technique to the general technique of tangent space calculations will do? Aug 14, 2016 at 18:12

There is more code to that project:
https://github.com/teared/mikktspace-for-houdini/tree/master/source

Also you can find information about tangent space normal maps here:

Other information about the tanget space normal maps (Mikktspace) are not very clear.

A brief explanation on the methods is very long and therefore I have included the two links above to refer to the good explanation about tangent space normal maps.

Note: Blender also gives advice on why not to use this method.

I hope this was helpful :)

• I think you should put some information (an introduction of sorts) apart from the links alone. They're not very helpful if they'd one day become 404. Aug 19, 2016 at 19:43
• The pdf link works fine for me @Fire Feb 11, 2018 at 10:54
• "Blender also gives advice on why not to use this method" can you provide a link to this? It would definitely improve this answer. Jun 25, 2018 at 20:51
• This answer would be immediately deleted on stack overflow. It's surprising it hasn't been deleted here. This isn't an answer. It's some links. Links can be left in comments or used to augment an answer but without an actual explanation in the question itself it's not answer and should be flagged and deleted as "not an answer"
– gman
May 20, 2020 at 10:26
• Here's the guidelines: Effectively if you remove the links and the answer doesn't give you any info then it's not an answer
– gman
May 22, 2020 at 5:51