EdyJ / blender-to-unity-fbx-exporter

FBX exporter addon for Blender compatible with Unity's coordinate and scaling system.
MIT License
947 stars 98 forks source link

#33 Adding tangent space export option #34

Closed mdwigley closed 11 months ago

mdwigley commented 1 year ago

This pull request includes an "Additional" option group that includes tangent space calculations to be exported with the mesh data.

By default this option is turned on.

EdyJ commented 1 year ago

Thank you for the pull request! Could you please elaborate a bit about the tangent space? I mean, currently exported FBX files work fine in Unity. Does this change is related with some option in the Unity importer? What are the advantages and implications of including tangent space calculations into the model?

I just want to understand more about this feature, as I never used it or felt the need for it. Thank you!

mdwigley commented 1 year ago

Tangents are always present whenever there are normals in a model. Unity will calculate them for you, but (if the design tool allows) having them calculated by the design tool is a better choice.

You can see below, on the FBX importer, which options are available for tangent handling.

UnityTangentSpace

These calculations are needed whenever a model uses a shader that is normal mapped:

"If the Mesh has no tangents, it won’t work with normal-mapped shaders."

https://docs.unity3d.com/Manual/FBXImporter-Model.html

This pull request gives the exporter the option to use Blender's tangent calculations instead of having Unity do it.