Hi guys!
I'm not sure whether or not my normal map baking workflow is synced. I am using 3ds Max 2016 for baking and Unity 5 as my target game engine. Ideally, I just want to make my low poly object a single SG and not care about hard edges and UV splits anymore. As I understand it, the synced tangent basis workflow allows me to do that. I'm familiar with the Cage vs Explicit Mesh normals discussion and in theory with other quirks of normal map baking. I'm still not sure if my workflow is synced. Here is what I do (the crucial settings):
1) Bake with "Projection Options" in the "Render to Texture" dialog set to Red: Right and Green: Up. Is that correct for Unity? According to the Wiki it should be, but I don't know if it's up to date.
2) Then export the low poly mesh with "tangents and Binormals" checked in the FBX exporter.
3) In Unity's FBX importer settings I would choose "Tangents" to "Import".
Is that all I have to do? Or am I missing a big piece of the puzzle?
Before that I always used to export my low poly for baking to xNormal (without tangents and binormals in FBX) and use that tangent space calculator plugin for Unity. In Unity I would then set the importer to "Calculate Tangent Space". I would prefer to do it all in 3ds Max though as I like to avoid any import/export that is not absolutely necessary.
Thanks so much for any help!
Replies
You should use xNormal (or other MikkTSpace baker) to bake normal maps. OR render a world space normal from 3ds Max and use HandPlane to convert to a tangent map.
I thought exporting tangents and binormals via FBX solves the problem of mismatching tangent spaces at the expense of larger FBX files? That isn't the case?
Btw, are my settings in the "Projection Options" in the "Render to Texture" correct for Unity?
Unity will discard the binormal and simply store a handedness value, which would be fine if the tangent basis was orthogonal, but 3DS Max's is not.
3DS Max's normal maps also require that the tangent basis be normalized per-pixel (which Unity doesn't do).
https://www.youtube.com/watch?v=gR3r7Xmhmlk&list=PLB0wXHrWAmCx994Cb7iRFSmupYHFw5DTx&index=21
?
Or is this workflow OK for Maya? The baked normal maps looked fine in Unity.
I never heard of a non-orthogonal tangent basis. Wow, this stuff is so unnecessarily convoluted.
So eventually I have to use xNormal to get a synced tangent basis workflow? Does xNormal default to MikkTspace now or do I still need your plugin?
Also, what's the consensus on MightyBake and Knald. Have these evolved to something better than xNormal? Thanks!
xNormal and all other bakers default to mikkT as far as I know. Only 3ds Max doesn't. (I don't know about Maya maybe somebody else can let us know.)
In Unity he then imports the tangents from the FBX and the results look fine. So why does this work for him when according to Farfarer exporting tangents + binormals alone won't fix the underlying issue. Someone stated that most likely Maya isn't using mikktspace either (like Max). So we have a tangent basis mismatch there, too.
So no, your baking isn't synced as your baker/engine have different tangent basis.
I'm just a bit baffled that there is no way to get a straight synced workflow between 3ds Max and Unity without external tools. Very odd.
Final question:
Assuming I had no access to an external baker due to whatever reason and I had to bake within Max. Would exporting the tangents + binormals via FBX and importing them in Unity at least make normal mapping artifacts less noticable as compared to not exporting them and letting Unity calculate their own?
Best bet is to try some tests and see what happens. Nothing beats testing it yourself.
But basically you will not be able to use the averaged verts/synced workflow for hard surface assets between Max and Unity.
Input Tangent and Binormal,
or
Input Tangent with Computed Binormal ?
Also, a general technical question: based on the comment by Wes shown in the screenshot above, the current unified way of working is to not export tangents in the FBX - but of course everything else needs to be carefully exported (hard edges, edited vertex normals in the case of a weighted pass on the mesh, triangulation choice, and so on - all of which are thankfully supported by FBX and OBJ if I am not mistaken).
What is the technical reasoning behind that ? Isn't storing everything BUT one specific set of data an open door for some potential issues ? Or is it just something that has been decided in order to be compatible with as many 3d formats as possible ?
[edit] : answer below in the PDF linked by Jed. The reason to leave this open is precisely because there is no unified way to calculate this data, and that's when Mikkt calculation steps in to save the day.
(I think that an image clearly showing what each data set represents would be a big help for everyone - veterans and newcomers alike !)
Lastly, are the exact specifications for Mikkt available somewhere ?
http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Synched_Workflow
(On a side note, I know that Maya can actually display tangent combing directly on the model, which certainly helped me understand this topic better a few years back, so maybe the guide could show some screenshots of that. I also find the xnormal 3d viewer to be a great help when it comes to tracking down these kind of issues as early as possible)
and the source code is here, follow the links to mikktspace.c and mikktspace.h https://wiki.blender.org/index.php/Dev:Shading/Tangent_Space_Normal_Maps
It is interesting that there exists no unique or correct way to interpret what is the accurate reconstruction of tangent space at pixel level. This problem is further complicated by the fact that there is no unique way to determine the approximations for vertex level tangent space either. These two observations are a strong indication of a compatibility problem in terms of sampled normal maps generated by different software.
Good stuff.
Substance Painter
Enable: Compute tangent space per fragmenthttps://support.allegorithmic.com/documentation/display/SPDOC/Project+configuration
Unreal 4
Import Normal Method: Import Normalshttps://docs.unrealengine.com/latest/INT/Engine/Content/FBX/ImportOptions/
Unity 5.3+
Normals: ImportTangents: Calculate Tangent Space
http://docs.unity3d.com/540/Documentation/Manual/FBXImporter-Model.html
https://knowledge.autodesk.com/support/3ds-max/learn-explore/caas/CloudHelp/cloudhelp/2017/ENU/3DSMax/files/GUID-49490C91-E450-4F62-BF5D-F84A1F768959-htm.html
Basically even when the option is enabled, the FBX format cannot really store it anyways. That explains a lot.
Now of course there is also the issue of various exporters/importers handling quad diagonals differently (if I am not mistaken, XNormal and Toolbag2 differ in that regard), but that's another topic altogether and easily solved by triangulating before baking and exporting anyways.