Home Technical Talk
The BRAWL² Tournament Challenge has been announced!

It starts May 12, and ends Sept 12. Let's see what you got!

https://polycount.com/discussion/237047/the-brawl²-tournament

Mirroring and stacking UVs leads to tangent discontinuity and seam

trs79
polycounter lvl 14
Offline / Send Message
trs79 polycounter lvl 14
Hello all, I've been stuck on this for a while and would appreciate any help. In Maya I have a mesh where I mirrored the top half of the geo, which also mirrored and stacked the uvs. I did this to increase texel density. I then exported as a .fbx file and made sure to export smoothing groups but not tangents and binormals. Next I imported the mesh into Substance Painter and checked the box to "compute tangent space per fragment"

I didn't bake, but just applied a brushed metal material (not even a smart material). I see very visible seams where the geo was mirrored, please see the screenshot below:


Here is the uv layout in Maya. The checkerboard pattern is aligned so I would think the pattern should be contiguous:

My understanding is mikkt tangent space should allow for mirrored and stacked uvs, and by not exporting the tangents and binormals in maya Painter should be computing them. I've searched the forums and found other posts regarding mirroring and seam issues but I'm not sure what the solution is here. Thanks!

Replies

  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 13
    * stack / offset in UV1 will always create butterfly effect in texturing. As for seams, default materials that use material finish filters or if you use finishing filters in layers this is totally normal behaviour. 

    *To avoid finishing filter seams you make logical UV seams so that seams are hidden. 
  • trs79
    Offline / Send Message
    trs79 polycounter lvl 14
    Thanks for the response. I do want the butterfly/mirroring effect in this case but not the seam. Can you clarify what a material finish filter is? I'm using the brushed aluminum material in Painter.

    It really seems like a left-hand/right-hand tangent space mismatch kind of like what is described for Maya here: https://help.autodesk.com/view/MAYAUL/2025/ENU/?guid=GUID-169FEA8E-0289-4B12-A181-D7C79FC98BC2

    I can't hide the seam in my case. For modeling something like a table surface the seam would also be right down the middle if I wanted to mirror and stack a wood material for higher density.
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 13
    In painter > filters > material finishes. These are sometimes part of the pre made materials inside Painter, these will always show seams unless UV seams fall in more logical places. (example: apply material finish on chest armour plates  https://www.youtube.com/watch?v=ueC2qGzWrgQ&t=1276s that wont show seams) 

    As for your mirroring and tangents I dont know if its Maya related, try exporting with fixed tangents as shown in your link but instead of applying pre made materials make a basic material with normal map. 
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    some thoughts.. 
     - any warping in normals will exaggerate the discontinuity so you want to make sure they're actually flat
     - i have seen occasions where baking to the flipped half of the uvs in painter caused a seam like this on an otherwise perfectly good model - also happened when the uvs were stacked

    - does it go away if you dont let painter mess with the tangents?? 
  • gnoop
    Offline / Send Message
    gnoop sublime tool
     I don't use SPainter much  but from your initial screen an description  I looks like your material uses   some tillable stretched  noise using your original  UV with some scaling factor .  That way they never be looking perfectly seamless, mirrored or not . 

     Besides  any small height details turned to normal map are never in fact produce  perfectly up mean /average normal.  Especially on such kind of stretched details with tiny  gradients.   There would be always a little of  random slant  and it often gets visible om mirrored  seams.    
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 13
    Another thing I forgot to mention, always send your mirror UV outside of UV1 space via offset in either U or V +1 or -1 etc
  • trs79
    Offline / Send Message
    trs79 polycounter lvl 14
    Thanks all for your comments! I ended up trying to solve this in Unreal Engine 5. I brought in my plane  mesh with the texture and sure enough the seam was there too. Based on this thread: https://polycount.com/discussion/116922/a-solution-to-normal-maps-with-mirrored-uvs-in-udk I flipped the x channel in a shader just for the mirrored uvs and the seam was gone! I'm guessing Painter doesn't do any kind of auto flipping of vectors for mirrored shells. (I tried a plane where the mirrored axis was x instead of y like the image in my opening post)

    @HAWK12HT Thanks, I did have to move my mirrored uv shell to the +1 tile to make it work, then the shader could check if uv.x was greater then 1.0 then flip x in the normal map. Does unreal have any way of auto detecting mirrored uvs, or is the only solution there to have custom shader code to do it?
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    Unreal supports flipped uvs out of the box so something is going wrong. 

  • pior
    Offline / Send Message
    pior grand marshal polycounter
    @trs79 You might want to check the last few posts in this thread as this could be relevant : https://polycount.com/discussion/comment/2797192#
  • trs79
    Offline / Send Message
    trs79 polycounter lvl 14
    @poopipe Yeah I would think Unreal should support detecting mirrored uvs out of the box without any additional shader logic, do you have any additional tips on how it should work?

    @pior Thanks for the link to that thread, I've been reading through the thread and other normal map pages on Polycount. It seems like much of the information relates to baking normal maps, in my case I'm filling a layer with a material in Substance Painter which paints the normal map. I think in that case it isn't compensating for the angle of the uv shell, whereas baking does? Maybe that's my problem?
    The top image shows the seam with the shader flip-x trickin Unreal, whereas the bottom image doesn't and shows the seam

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    well - the point is that you don't have to do anything . 

    if this is just a basic tiling normal map in tangent space my best guess is that something is happening to the model at some point  - or  - your normal map is not stored/interpreted in the right colorspace
  • trs79
    Offline / Send Message
    trs79 polycounter lvl 14
    Gotcha, after your response I kept trying and found an easier way to fix the seam without the shader tweak. I kept the mirrored uv shell in a tile to the right of the 0-1 tile and made sure the uv's weren't reversed (they were blue in Maya instead of red like I had before). Then in Unreal I could set the X-axis tiling mode to "mirror". This kept the tangents consistent on the mesh but still kept the right mirroring which fixed the seam. I found with reversed uvs the mesh came into Unreal with reversed tangents which caused trouble.

    I still don't know how to remove it in Painter but it doesn't matter since Unreal is my target engine.
  • trs79
    Offline / Send Message
    trs79 polycounter lvl 14
    I also learned if I uncheck "use mikkt tangent space" on the static mesh import in Unreal the tangent doesn't get flipped and there is also no seam and I can use reversed uv shells (red in Maya). However the lighting seems blown out on the mirrored side of the mesh so I don't think this is a correct solution.
  • pxgeek
    Offline / Send Message
    pxgeek interpolator
    not that this is what's happening, but just in case it was overlooked: the face doesn't have it's normal flipped (as can happen when mirroring geometry)?
  • trs79
    Offline / Send Message
    trs79 polycounter lvl 14
    @pxgeek Good idea, but I made sure normals aren't reversed.
Sign In or Register to comment.