So I've encountered a problem in Unity, and have been unable to find a fix for this. You would think it'd be pretty simple, but maybe not...
On the left half of that structure, the scaling of the object is X=-1 Y=1 Z=1
The right half is scaled normally, X=1 Y=1 Z=1
The shading of the object basically falls apart when flipping it along an axis, and for using modular parts, this is a really big blocker for me.
The only thing I've found on this topic are something to do with the vertex winding order, but any script I've found online hasn't worked.
I've tried multiple things to try and fix this issue, and all of these look the exact same as the image above:
1. Create half of the house as small prefab pieces (each post as its own object), create a larger prefab containing all of the parts, then setting X=-1 to flip it
2. Create each chunk of the structure in Maya, combine the whole thing, and in Unity set X=-1
3. Create each chunk of the structure in Maya, flip it in Maya, combine the whole thing, freeze the transforms, ensure that the normals are pointing outwards, and view it in Unity
You can try this for yourself too, with a very simple asset. In Maya, create a sphere. Delete half of the sphere, export the object as a .fbx to Unity. Duplicate the sphere in Maya, set X=-1, freeze the transforms, make sure the face normals are pointing the right way, export to Unity as a .fbx, and place them side by side. This is the result:
It boggles my mind that Unity has such a hard time with such a simple action. And I'm at a loss to figure this out, I've been looking for the past couple of days for a solution but I haven't found anything.
Is there a script, piece of code, or just some checkbox that I'm totally missing that will fix this problem? It doesn't necessarily have to be in the scene view, if this is something that can be fixed during runtime that will be good enough for my needs.
Replies
For example, on the side of the house I have a window panel that has beams, wood, floor, etc all as one prefab. I want to take that prefab, and flip it to the other side of the house, or even mirror it so that then you view it side by side, they look different. That isn't possible due to these shading errors due.
So, basically, there is no fix to get it looking perfect?
I found one solution (sorta), where I export the chunk of house as a .fbx with Tangents+Binormals turned off, and let Unity calculate those. It worked to an extent, there is a visible seam but it can be covered up with more assets. That's the closest I've gotten to resolving the issue, and even so there are still problems persisting in the model.
Does it happen with a subdivided cube too?