Hello, i’m not sure if that issue have been experienced before using Modo and Unity, but i’ve didn’t got that anytime before today.
I’ve updated recently Unity from 5.3.5 to 5.5.0 f3. and now i’ve found some issue on mom-closed / tigh mesh, like thoat wall.
I just got a simple material with standard shader on it. I use the normalmap on Detail channel to add some shapes to my wall, but the lighting is messed up even if on Modo the continuity / orientation of my UV1 are correct.
so on only one Mesh, without any orientation / flip issue from the UV’ in Modo i still got issue inside Unity from Face to Face, around 30 to 50 % of my mesh didnt work as it should. Have you got those kind of issue before ?
It’s not related to the Mesh, as it use is own Normal Weightmaps.
The faces got the same orientation. they are pointing to the same direction locally. I’ve used the UV Set0 for the ambient occlusion and albedo and the UV Set 1 for the detailed Normal Map using a different UVSet(1).
It looks like that if the UV’s 0 are oriented in a different way than the UV’s form the UV Set1, the normal map effect goes wrong.
This isn’t a bug, just a limitation of most real time rendering setups. The mesh only stores one tangent per vertex, and that tangent is based on UV0. If UV0 and UV1 don’t match orientations, the detail normals won’t look right. I agree that it’s not optimal, but in the average case it works well enough.
It could be fixed with a custom shader using derivatives to calculate the tangents for the detail UVs. The cotangent_frame() function in this post for example:
Ironically one of the people to first post about using derivatives to transform with normal maps, and whom used the technique in several big budget games, now works at Unity.
Unfortunately I’m not sure if it’d be easy to do in a surface shader as it assumes the normals that are output are in tangent space, and to blend two normals together nicely you generally need them both in the same tangent space, so you’d have to figure out how to transform the detail normals into the model’s tangent space.