Home Technical Talk

UV overlaps sewing

Flmn
polycounter lvl 6
Offline / Send Message
Flmn polycounter lvl 6

Within all my experience I've always left a center seam whenever I have mirrored overlap. It's kinda necessesary for baking and pretty useful if you have to do some tweaks, but I realised, that it can probably affect performance within realtime applications.

If we take a look at simple example below - symmetrical mesh which can be easily overlapped. In classic manner it would have 16 UVs, but if we sew the centerline UVs, we would get 14. If we have some dense meshes, it will be reduced in much greater amount of UVs. I think that it can be done in the final stage of prepartaion of mesh right before exporting.

However, is there any real profit for that or I'm overcomplicating it? Would like to hear your thoughts.


Replies

  • euanm
    Options
    Offline / Send Message
    euanm polycounter lvl 4

    If you sew them, doesn't that prevent you from moving one overlapping set outside of the 0-1 UV area? I suppose it depends on the baking etc. software, but generally overlapped UV's get moved outside of the 0-1 area to avoid strange results when baking.


    Furthermore, if there is any performance gain from going from 16 to 14 uvs I can't imagine it being a big enough difference to worry about in the grand scheme of things.

  • Kanni3d
    Options
    Offline / Send Message
    Kanni3d ngon master

    @euanm

    Sent 1 uv over, bake to prevent artifacts, send back, stitch

    @Flmn not overcomplicating it, but more so the fact that this is is negligible nowadays, as it is not much of a performance concern as it would've been generations ago.

    It's valid in the sense that yes you'd save a ton of vertices at runtime with more particularly denser meshes, but you'd have to do a few extra steps/take more time and care.

  • gnoop
    Options
    Online / Send Message
    gnoop polycounter

    I am not sure for certain but think it perhaps would still be 16 uv points for a video-card since tri-stripping wouldn't work across the center anyway probably. Because you would have to flip normal vectors to use same normal map pixels.

    if anyone knows better I am curious about right answer too.

  • BlueFlytrap
    Options
    Offline / Send Message
    BlueFlytrap polycounter lvl 9

    In my experience it depends the engine. Older ones tend to keep the welded uv border and twist the tangent 90° in either direction along the seam.

    Here's what that looks like exactly. Cube on the left has the mirror seam welded and the cube on the right has the mirrored uv offset by 1. They are otherwise identical.

    Flmn is right in that the cube on the left is 30 verts while the cube on the right is sitting at 42 verts. In return for 12 less verts we instead have severe zig-zag distortion applied to the normalmap along the welded seam. The above example is made to be the worst case scenario however so if you do run into this problem in your engine it won't look nearly so bad. Depending on the model and normalmap the distortion may not be visible at all.

    Worth mentioning that if you aren't using a tangentspace normalmap welded mirror seams will display just fine.

  • Kanni3d
    Options
    Offline / Send Message
    Kanni3d ngon master

    I imagine it would help a ton if you properly gave the mesh hard edges and split, to not have a nasty gradient in your normal map. Mirroring seam should be nearly, if not, fully invisible with a mostly to fully flat tangent space normal map

  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter

    it would indeed.


    this is all very interesting but it is absolutely pointless. .

    you save no resources if you do this in a way that doesn't provoke artefacts because you need to split the seam and deal with normals in all scenarios.

    You also have to deal with handling multiple mesh versions or remembering which shells you offset - neither of which is fun when you come back to an object 18 months later.


    offset the mirrored UVs and carry on.

Sign In or Register to comment.