Bug report, 4.7 degenerat tangent bases on objects that have correct tangents. simple object?

Hi, since upgrading to 4.7 degenerate tangent bases errors are appearing on objects that have correct tangents. When importing the .fbx file exported from Maya I will get this degenerate tangent bases error. I’ve created a simple test object, a cube with one extrusion. This object has 100% hard edges and pops up the degenerate tangent bases error. The test object has no issues in Maya and Maya’s own cleanup polygons tool does not flag it as having issues.

To further confuse the issue setting all the edge normals to soft in Maya stops the error from appearing. This is wrong, a combination of soft and hard edge normals from Maya need to work to create the desired shading in game, and also create error free normal map bakes without adding extra edge loops.

I’ve attached the model, please export it as .fbx with tangents and binormals turned on and triangulation turned off. Note it will pop up the error complaining about degenerate tangent bases, please fix this. It looks like this flag has been added to 4.7 and is causing hundreds if notlink text thousands of false positives and is really annoying when reimporting your mesh multiple times since it pops up the message each time.

Hi Malcolm,

We have a ticket (UE-11426) in for this to be addressed. I’ve added your information and simple repro to the ticket.

Once this has been addressed I’ll update this post here.

Thank you!

Tim

Hi,

We think this post contains useful information which we would like to share with our public UE4 community. With your approval, we would like to make a copy of this post on the public AnswerHub which includes the discussion but strips out your username and company name. Please let us know if you are okay with this.

Thanks!

Hi Malcolm,

The degenerate tangent bases was the result of the MikkTSpace code added in 4.7.

We’ve exposed the check box to disable this in the Static Mesh Build Settings with CL-2519373.

Thank you!

Tim

Hey Tim, this seems strange, I’m using normals from Maya fbx, but I’m letting Unreal generate the tangents, this would imply Unreal can’t generate valid Mikk tangents on meshes. I feel like there’s a bug here.

It’s possible there is a bug in the integration of MikkTSpace. If reverting to the older proprietary method of computing tangents works for you, you should use it on these problem meshes for the time being.

If you debug and find out why the tangent calculations are failing, let us know and we will integrate the fix.

If you could attach the problem asset we can try to reproduce the bug in-house.

Hi Nick, I had already attached the problem mesh above. It’s a simple test object, a cube, with one extrusion on it. I was hoping Epic would resolve the issue since it is clearly a bug and I would imagine affects all vanilla users as well, but I haven’t confirmed that.

This is what I see with that model.

MikkTSpace:

Old UE code:

The MikkTSpace results look more sane than the old code. But…

The input mesh looks like it has screwy UVs on some faces (notice the distorted texture). I would guess that is why MikkTSpace is failing.

You’re right! Objects now need uv’s on all faces to avoid the warning message in 4.7. I would have never thought that uv’s would contribute to degenerate tangent spaces. I thought tangents were based on normals not uv’s?

Nick what you do you think about changing the error message to inform the user of the problem they need to fix as an artist, such as “you have some faces without uv’ coordinates” which is causing degenerate tangents.

From an artists perspective a model without uv’s is still a valid model as this is not an issue for Maya, and I thought not for real time rendering in Unreal. Mostly this situation would occur with test objects or greybox objects that come from the meshing team. Or are we saying as a community that we should always have uv mapping on all faces of any object that enters the unreal pipeline.

Ah, that explains it. So, tangents are kinda goofy but they actually depend on UVs.

Basically, the “tangent” vector points in the direction of the U texture coordinate and the “bitangent” (or “binormal” depending who you ask) points in the direction of the V texture coordinate. That coordinate space provides a mapping from “texture space” to “object space” which is what lets tangent space normal mapping work. That’s a very simple explanation.

Good suggestion on the error message, we could offer some suggestions.

Okay good to know. Thanks for investigating.

Hi Ben go ahead there’s nothing proprietary in this post so feel free to share it.