Home Technical Talk

Mirrored and/or continous Surfaces and Smoothing/Hardedge

polycounter lvl 18
Offline / Send Message
oXYnary polycounter lvl 18
I just want to confirm that I'm not screwing this up. When you have a mirrored UV layout, you don't need to make each mirror separate via smoothing or a hardedge? Results in XN would seem to confirm this since seam is slightly less noticeable when 1 group.

Does this same logic apply to a UV island that's actually a complete object? Like a unwrapped ball. In other words not based on the UV islands edge.

Replies

  • Noors
    Options
    Offline / Send Message
    Noors greentooth
    -Where you have hard egdes in you mesh, break uv.
    You use an hard edge to limitate extreme normal bending between 2 faces (90° degrees for instance), and thus limitate errors due to : 8bit format/dxt compression/unsync engine...

    -A break in uv doesn't require a hard edge in the mesh.
    =>You don't have to break normals on a symmetry.
  • oXYnary
    Options
    Offline / Send Message
    oXYnary polycounter lvl 18
    You make hard edges based on your uv islands as well according to the your making me hard thread since the engine will break them regardless. Hence still confused. Are continous (as in wrap around/cyndrical side) and mirrored the exception to the rule?
  • Eric Chadwick
    Options
    Offline / Send Message
    This is the way I understand it...

    A vertex along a hard edge will get two different vertex normals, pointing in different directions.

    When a mesh is lit with a normal map on it, the renderer (game engine) needs to calculate the axis tripod for each vertex normal... normal, tangent, and bi-tangent. This is called the tangent basis.

    These axes are used to properly transform the incoming lighting from world space into tangent space, so your normal-mapped model will be lit correctly.

    The renderer calculates those axes using the vertex normal, the V coordinate, and some math (my eyes glaze over when they get to this part; I'm not a graphics programmer).

    I've heard the tangent basis described as "flow" across the model, something to do with the math involved in calculating those vertex tripods.

    If the UV is continuous across this hard edge, then it is more difficult for the renderer to determine the directions of the 3 axes for those two vertex normals, because that vertex along the seam has the same V coord for both of its vertex normals.

    So, it's good to break UVs where you have hard edges, because that helps the renderer calculate the tangent basis properly.

    Edit... But when you use a mirrored UV, there is no hard edge there (usually), so each vertex along the seam has a single vertex normal. All the renderer needs is a different V coord to calculate the two different axes it needs for that vertex's tangent basis.

    Some renderers detect when mirrored UVs exist, and allow them to be in the same UV location (overlapped). Others don't do this, so they require the two shells to be offset in UV space. You offset one of them by 1 whole UV unit, so it gets mapped the same as the other shell, because the texture is tiled.
  • Quack!
    Options
    Offline / Send Message
    Quack! polycounter lvl 17
    We can chit chat about this all day long. But this would take less effort to actually test in your pipeline.

    Just do a test bake, you will learn more about the way it works.
  • oXYnary
    Options
    Offline / Send Message
    oXYnary polycounter lvl 18
    Oh, I have.... I have... I have spent the last week literally going in circles on this. Even though I have done it many times before (but recently was animating so hadn't been), I'm at the point now that I am missing something big, or xnormal is broken. But this information should be standardized as it is versus hidden in a series of different posts that contradict one another if not seen in context in that thread.

    Eric, I am speaking the other direction though. Making hardedges/smoothing groups based on your UV islands which the dem shapes thread recommends for the reasons you state. When that islands edge is actually a mirrored surface (like half a sphere), or an island that attaches/wraps to itself (like a cylinder). Those particular edges.

    It sounds like your confirming that indeed, if they share the same edge on same island, no hard edge is required.
  • Noors
    Options
    Offline / Send Message
    Noors greentooth
    oXYnary wrote: »
    You make hard edges based on your uv islands as well according to the your making me hard thread since the engine will break them regardless. Hence still confused.
    Well this is wrong. Engine wont' break normals. If 2 map vert are splitted, it will make 2 geo vert with the same normal.
    Besides, 1st EQ post :
    • To avoid artifacts, you must split your uvs where you use hard edges.
    • You do not however, NEED to use hard edges wherever you split your uvs(as some may suggest)
    It's clearly explained in handplane 3d vid.

    What do they say tho, is that adding a hard edge where you already have uv split won't add any vertex to your model. So it's "free", so you might want to use hard edge, again, in order to have less extreme normal bending to compensate. But you don't "have to" If it's in a middle of a smooth surface, (sphere) there's no point to do it.

    I think you have to understand what is the structure of a mesh, what normals and uv's actually are, then normal map theory is just "good sense".
    If the UV is continuous across this hard edge, then it is more difficult for the renderer to determine the directions of the 3 axes for those two vertex normals, because that vertex along the seam has the same V coord for both of its vertex normals.
    Ha? For me the main issue is that the normal map have to compensate different normals on a 1 pixel line. Will that pixel right between the 2 faces compensate the right face ? You can't say.
    +filtering+mipmap = will never look good.
    You have to break uv to let enough padding, so the normal map can compensate "freely"
    Some renderers detect when mirrored UVs exist, and allow them to be in the same UV location (overlapped). Others don't do this, so they require the two shells to be offset in UV space.

    I'm not sure that the position overlap/offset matters for the engine (unless for baking purposes) but i'm not dev either.
  • Eric Chadwick
    Options
    Offline / Send Message
    The offset is usually required for mirrored shells, in my experience, because the tangent basis needs a different V coord, to derive the tangent. But a hard edge is not required on the mirror seam.
    Ha? For me the main issue is that the normal map have to compensate different normals on a 1 pixel line. Will that pixel right between the 2 faces compensate the right face ? You can't say.
    +filtering+mipmap = will never look good.
    You have to break uv to let enough padding, so the normal map can compensate "freely"

    Different issue, but another good reason for a UV split.
  • oXYnary
    Options
    Offline / Send Message
    oXYnary polycounter lvl 18
    Never watched the handplane video. Always figured it was directions on how to use handplane itself. Will give it a gander.

    So the final conclusion is, no I do not need to break if a continuous smooth surface like a reflected part on itself or say a cylinders side break.

    There must be something else wrong then. Will post in xnormal thread.
  • Eric Chadwick
    Options
    Offline / Send Message
    Did you offset the mirrored uv shell?
  • oXYnary
    Options
    Offline / Send Message
    oXYnary polycounter lvl 18
    Yea, I think i just discovered my issue. Something I wouldnt have thought of in 1000 years normally.
Sign In or Register to comment.