Home Technical Talk

Unreal 4 seams at UV center edges

ScottHoneycutt
polycounter lvl 13
Offline / Send Message
ScottHoneycutt polycounter lvl 13
ZxD9hQV.jpg

I have seam lines showing up in the center of some of my meshes in Unreal 4. I can see by the fish that its at the edge of the UV seams, not at a symmetry point in the model. I don't know why. I have 2 UV sets and the second one is all within 0-1 space. The trash can that's black and white after baking the lighting looks like only one side is getting lit. Do you have to manually set something with the lightmaps?

Replies

  • tharle
    Offline / Send Message
    tharle polycounter lvl 9
    it looks like you've mirrored your uv's so the normal map for the mirrored part is reading backwards, hence the lighting errors.

    https://answers.unrealengine.com/questions/42813/normal-map-with-mirror-uv.html
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    Thanks for the response. The fish has all unique space in both UV sets and the leather part of the bench is just as mirrored as the lower part. What I don't get is that you are taught to maximize UV space, mirror your UVs, etc. I'm sure with the plethora of instruction to do so that I'm not making a huge mistake that can't be fixed by mirroring some UVs, especially since its not like I haven't mirrored UVs before with fine results. Someone on that thread you linked said you can't mirror normals. I'm confused. Is that actually right? People do it all the time and tell you to mirror your UVs. Also he said normal maps are shadow information. I'm guessing that's incorrect, and that its "height" information to be correct.

    Another thing I don't understand is that you told strongly from some to NEVER paint out errors on a normal map, but here we have tutorials for doing so:

    http://www.polycount.com/forum/showthread.php?t=51088

    Does it have anything to do with the exactness of the symmetry of the model? I've dealt with that before where you don't get a seam if the symmetry modifier is in perfect place immediately, but the seam shows if you have to move it in place.

    Thoughts?
  • Farfarer
    You should be able to do something like this in the shader to fix it I think?

    if (dot (cross (normal, tangent), binormal) <= 0.0) {
    binormal = -binormal;
    }
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    Where do you place code in the shader? Thanks
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    Another piece of information I could add would be that these look fine without any seams in Marmoset. If I take away the normal map completely, the seem on the bench goes away. If I have a normal map that is literally just the flat blue background color, the issue remains as is.
  • german01
    Offline / Send Message
    german01 polycounter lvl 13
    Did you try to invert the green channel?
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    german01 wrote: »
    Did you try to invert the green channel?

    Yes
  • Farfarer
    It's an issue with the binormal not being flipped when the UVs are. Fairly common issue with game engines.

    You can either try to fix it in the shader (I think UE4 does the transforms in the pixel shader anyway) or possibly in the mesh... although I suspect that would need some coding.
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    Farfarer wrote: »
    It's an issue with the binormal not being flipped when the UVs are. Fairly common issue with game engines.

    You can either try to fix it in the shader (I think UE4 does the transforms in the pixel shader anyway) or possibly in the mesh... although I suspect that would need some coding.

    This sounds like great advice, however I'd need a start as to how to fix such things. I've never placed in code before. Another question is how such things happen and what can be done to prevent them. I want to learn the issue so I can fix/prevent it in the future.

    Thanks
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    tTuOWmj.jpg

    Progress. The trashcan's extreme white to black was in fact a lightmap issue. The lightmap index was set to the wrong number without me knowing it or where the switcher was. Now the fish's uv seams are still there though as well as a slight seam on the trashcan which might be because of the model (I'll look into that). I'm still stumped about the fish issue.
  • Quack!
    Offline / Send Message
    Quack! polycounter lvl 17
    This could be a file format error.

    Have you tried exporting to different file formats? Tried different export/import settings?
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    KfqCGlB.jpg

    Here's another image. I tried with and without "tangents and binormals", with and without triangulation, tried fbx and obj, ... no difference. Also tried converting to an object space map ... didn't help. This is just me making stuff in 3ds max, testing it in Marmoset, seeing it looks good, placing it in Unreal, then struggling mightily to figure this out. I haven't done anything special that I know of. It should be simple but it isn't. I just want this piece to work. I just want to make some art. I'm flabbergasted. Do you recommend never mirroring your models in the UVs unless its a separate element? It isn't like ALL the pieces are doing this. I've had mirrored geo and uvs in Unreal before. :(

    Thanks to everyone.
  • Quack!
    Offline / Send Message
    Quack! polycounter lvl 17
    Welp, post the files with your current smoothing groups intact. We can take a look.

    Mirroring should be fine. And any errors wouldn't be THIS present.
  • AdvisableRobin
    Offline / Send Message
    AdvisableRobin polycounter lvl 10
    Check if the vertices are welded along the seam and when you export it as an FBX make sure Tangent & Binormal are selected under Include > Geometry.
  • wirrexx
    Offline / Send Message
    wirrexx ngon master
    https://www.youtube.com/watch?v=VyTH0Xtn_D4 if by chance it is the lightmap, check this tutorial, and see if it helps.

    I've had that problem myself, usually live AdvisableRobin mentions, it's that the vertices are not welded.

    This is how the problem usually occur.

    in 3ds max. When you're modeling and have the Unwrap modifier on, if you by chance move a vertix on your modell model with the modifier on, it will sometimes break (so you have to weld it again).
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    http://www.speedyshare.com/cQkFT/scottupload2.zip

    Let me know if you can't get the file. Tangents and binormals are intact. The fish was made with the ProOptimizer modifier so it wasn't really "mirrored" except earlier in the process as a high poly.

    Thanks

    Edit: I changed the link, the first one had shortcuts, not real files.
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    f44TMb5.jpg

    I remade the UVs for the trashcan and rebaked. Now the seam in the center is gone, but there is a seam on the side where the UV is now ending.

    I reoptimized the fish with 3ds Max' ProOptimizer. I took it into Mudbox and retopologized it thinking it could maybe reverse an issue with the mesh. I took it back into Max, touched up the model, reUVed, rebaked. Now the exact same issue is STILL on the fish, only now showing up at the new UV seam edges. Wow. Thank you to everyone who is looking. I still don't get it.

    Am I missing something? Do all game environment props have these issues? :(
    It looks fine in Marmoset. I make changes to the models and UVs and it simply moves the errors.
    8NPjIxV.jpg
  • Quack!
    Offline / Send Message
    Quack! polycounter lvl 17
    Normals look good in max's viewport (minus the poor topology and uv layout). I'll test in unreal when I get home tonight.
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    Quack! wrote: »
    Normals look good in max's viewport (minus the poor topology and uv layout). I'll test in unreal when I get home tonight.

    Thank you. Some people think its the normal, others the lightmaps/UE settings. It looks to me like a lightmap issue and is only happening in Unreal, however it is taking place on the seams of the texture UVs. I've never been more stumped, so thanks
  • AdvisableRobin
    Offline / Send Message
    AdvisableRobin polycounter lvl 10
    Just throwing this out there, could this be a case of tangent basis not being sync'd? Or does Unreal just import the basis?
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    Just throwing this out there, could this be a case of tangent basis not being sync'd? Or does Unreal just import the basis?

    I don't know how to answer that. I believe it has something to do with normals. It's not the green channel needing flipped if that's what you mean. It looks fine in 3ds Max and Marmoset, but not UE4. I have confirmation that it shows the error in another engine. I threw it into a UE4 marketplace scene. It's fine until I place the normal onto it. No build necessary.
  • Quack!
    Offline / Send Message
    Quack! polycounter lvl 17
    Just throwing this out there, could this be a case of tangent basis not being sync'd? Or does Unreal just import the basis?

    Unreal can import the basis, as long as it's sent with the FBX.
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    Quack! wrote: »
    Unreal can import the basis, as long as it's sent with the FBX.

    If you are referring to "tangents and binormals" in the .fbx settings, I've tried checking and unchecking such (usually checking). Are there any general guidelines anyone can give as to how to avoid such errors? I won't stop until I fix these issue, otherwise I'm not learning, only covering up the issue. Thank you everyone.
  • KazeoHin
    Offline / Send Message
    KazeoHin polycounter lvl 8
    I've never worked in UE4, but in the UDK, I've seen a simillar issue, my solution was to have UV shells in their own smoothing group, or in maya: harden all shell border edges, then re-bake.
  • Quack!
    Offline / Send Message
    Quack! polycounter lvl 17
    So I fixed this!

    When you import your normal map texture, make sure that you have it's Compression settings set to TC Normal Map. When imported it brings them in as TC Default, which is not for normal maps. Also make sure that in the material editor that the normal map node is a normal map node and not a default one, this should give you an error so it should be obvious.

    fish_normals.jpg
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    Quack! wrote: »
    So I fixed this!

    When you import your normal map texture, make sure that you have it's Compression settings set to TC Normal Map. When imported it brings them in as TC Default, which is not for normal maps. Also make sure that in the material editor that the normal map node is a normal map node and not a default one, this should give you an error so it should be obvious.

    :poly102: You truly did. Wow. Thank you. In UDK I was checking the normal compression on import, now in UE4 I'm not getting that import option screen but occasionally seeing the message on the bottom-right of the screen telling me something imported as a normal map. The detail maps were all fine but several of the baked maps were color textures. I had tried to switch them in the material, but it simply gives an error and breaks the material ... unless you know to go to the details and check the compression to normal map as well. Wow. This one really got to me. The fish looks good now.

    I still see a couple lines here and there that I don't know about in the scene (mostly one model that I never showed in these pics), but I think I can handle it ... will let you all know later. I did have some lightmap issues on top of this normal compression disaster.

    Thanks.
  • Gigantoad
    Offline / Send Message
    Gigantoad polycounter lvl 5
    instead of setting the compression manually, you can suffix the normal map file name with _N (or _normal will work too I think). That should set the compression automatically on import.
  • Quack!
    Offline / Send Message
    Quack! polycounter lvl 17
    Good point gigantoad.

    Now that the import thing is clear Scott, I have some topology crits for you.

    I would not recommend ever creating a low poly using an auto-optimizer, unless you are on a severe time crunch. This object can be described using much fewer triangles while retaining the same exact quality with a manual retopo. Using proper edge distribution and controlling the retopo will also let you have the best possible unwrap, as of right now you are wasting 30% percent of your possible texel density.

    The small silhouette bumps that the scales of the fish give are barely worth the triangle count. IF you wanted to retain those then using a few isolated extrusions would be best rather then spend tons of triangles with detail there.

    On top of that, in your unwrap, I ran a relax on the islands to see if they had the least amount of stretching and they relaxed a TON. I would suggest adding one of the great checker boards from the polycount wiki and taking note of your texel density.

    Get an asset like this done to a high level will allow you to do this for high priority objects in the future.

    Good luck and I am glad we got you sorted!
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    Quack! wrote: »
    Good point gigantoad.

    Now that the import thing is clear Scott, I have some topology crits for you.

    I would not recommend ever creating a low poly using an auto-optimizer, unless you are on a severe time crunch. This object can be described using much fewer triangles while retaining the same exact quality with a manual retopo. Using proper edge distribution and controlling the retopo will also let you have the best possible unwrap, as of right now you are wasting 30% percent of your possible texel density.

    The small silhouette bumps that the scales of the fish give are barely worth the triangle count. IF you wanted to retain those then using a few isolated extrusions would be best rather then spend tons of triangles with detail there.

    On top of that, in your unwrap, I ran a relax on the islands to see if they had the least amount of stretching and they relaxed a TON. I would suggest adding one of the great checker boards from the polycount wiki and taking note of your texel density.

    Get an asset like this done to a high level will allow you to do this for high priority objects in the future.

    Good luck and I am glad we got you sorted!

    Thanks. Appreciate it. :thumbup:
Sign In or Register to comment.