8
\$\begingroup\$

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?

\$\endgroup\$
  • \$\begingroup\$ 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? \$\endgroup\$ – Grady Aug 14 '16 at 18:12
3
+50
\$\begingroup\$

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:
https://archive.blender.org/wiki/index.php/Dev:Shading/Tangent_Space_Normal_Maps/ http://image.diku.dk/projects/media/morten.mikkelsen.08.pdf

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 :)

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – Aistis Aug 19 '16 at 19:43
  • \$\begingroup\$ Very true, good idea Aistis. But you can also download a website if you want to. \$\endgroup\$ – Tripl3Fac3 Aug 19 '16 at 19:44
  • \$\begingroup\$ I'm accepting this answer as the correct answer because Tripl3Fac3 has been a great help to me personally, and the information that Tripl3Fac3 has provided in the links does pretty much summarise all the collective best resources on this subject as it currently stands. \$\endgroup\$ – Grady Aug 20 '16 at 9:07
  • 1
    \$\begingroup\$ The pdf link works fine for me @Fire \$\endgroup\$ – Tripl3Fac3 Feb 11 '18 at 10:54
  • 1
    \$\begingroup\$ 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" \$\endgroup\$ – gman May 20 at 10:26

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.