I find myself stuck with a mistery that is making me loose hours of work without any progress whatsoever figuring it out.
I'm making a modular environment and I'm making some trimsheet textures. In this specific case let's take a door frame made of three pieces (two vertical, one horizontal on top. Everyting is cool and neat until I take a vertical face and rotate it in the UVs to match it to the horizontal trimsheet, and that's when the normal map appears inverted in my scene. The trims were baked with substance painter, the modelling and unwrapping is done in Blender, the final result needs to go to Unreal. Funny thing, if I flip the face normal it appears correct (but then I have a flipped face obviously).
I don't understand why this is happening nor how to fix it, I tried pretty much everything that came to my mind. If I rotate the UV island to be vertical the normals appear correct, but then it doesn't match the trimsheet anymore.
Here's a pic to describe the problem:
Here you can see the UVs of the frame on the left (they are overlapped to match) and the actual result on the right. The seam is in corner and it's evident that the normals don't match. This happens in Blender, but in Unreal I get the same result.
I also tried with a new geometry and this is the result:
if it's flat on the ground it looks correct...
but if I rotate it 90deg on the x axis so that it's standing like the door, inverted normals
Can we agree this doesn't make any sense? Or am I missing something?
To be clear: there are no flipped normals, I also recalculated them multiple times, no split normals or custom normals of any kind, the normal map was baked for DirectX but doing it for OpenGL didn't change anything, and as far as I know Painter bakes in Mikkt, in the material nothing is going on (I can confirm that because in Unreal I only plugged the normal map in the normal input at it gives the same result) and the color space is correct (no sRGB). The geometry is not the problem since as I showed I tried with a plane where I just insetted the only face it had and deleted the center. Maybe it's something with Blender? I couldn't try in other softwares like max or maya since I don't own a license.
If you read all of that thank you, finding someone with more experience that can help me figure out the problem is the only card I've left.
Replies
I checked, no flipped islands, but fllipping them corrects the normals. The problem is they don't align anymore if I do that
I tried, resetting xform does nothing and no double faces either.
As you saw I can't even redo it, because this problem appears even when I try with a simple plane, so it's a generic issue, not linked to this specific model
All usual caveats apply, but it should work in this case since you're applying something baked on a flat plane onto other perfectly flat planes.
Did you rotate in edit mode or object mode and applied transformations?
Which version of Blender are you using? I guess there are no modifiers on the object?!
Would be best if you could share an example file.
Tangent normal direction is relative to UV orientation, not geometry - as explained in detail by FrankPolygon above, and as experienced by the entire game art community for at least the last 15 years.
My guess would be that some sort of wanky transform on the mesh is causing the issue (or something weird in whatever shader is applied) - I know next to nothing about Blender so can't suggest any remedy
.
Also, make sure the material is setup properly: (Non-Color)
https://www.dropbox.com/s/nrphhrexfc63daw/wonkytrim.mlt?dl=0
On a side note, you can use a RGB curve to change the normal swizzle.