Search Unity

How to prevent visible "cracks" in geometry?

Discussion in 'Scripting' started by glom1envisage0, Feb 17, 2012.

  1. glom1envisage0

    glom1envisage0

    Joined:
    Apr 3, 2011
    Posts:
    167
    This is neither a question about shading or scripting but kind of in between. I've noticed that some meshes I import to unity show lines that appear to be tiny breaks at the seams where two "faces" meet. Is there a remedy to this? I find that it's a lot more noticeable when anti-aliasing is enabled by running the game at the "fantastic" graphic quality setting in the stand alone executable build.
     
  2. ivkoni

    ivkoni

    Joined:
    Jan 26, 2009
    Posts:
    978
    perhaps your texture/uv mapping is not perfect?
     
  3. andorov

    andorov

    Joined:
    Feb 10, 2011
    Posts:
    1,061
    Is this on animated characters?

    Sometimes when you have deeply nested objects (like animated characters who have many bones), and the scaling is set up poorly (ie: scale of 100 followed by scale of 0.01 on the bones), the net result can is not always what you expect. The problem can also occur on static objects if you have really odd scale values. For example, if you imported the model at 0.01f scale (default, when using the FBX exporter on some programs) and then scale it up by 100.
     
  4. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    What 3d app are you using? Are you vertex snapping things together in unity?
     
  5. glom1envisage0

    glom1envisage0

    Joined:
    Apr 3, 2011
    Posts:
    167
    I tried re-scaling in Blender and applying a new uv map(one that worked for another object) and the "cracks" still show. Also, the frame rate drops heavily when the object(several sections of level geometry) are in view. This mesh was originally a flat race-track like structure that I gave some "hills" with the "sculpt mode" in Blender. I've had times where there would be large cracks when applying to much sculpting and I'd have to go back and fill in the gaps but this time, the object appears break-free until it's in unity.
     
  6. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    Are you sure its gaps in the geometry and not overlapping geometry that is causing some Z fighting?
     
  7. jwilliamsen

    jwilliamsen

    Joined:
    Aug 8, 2010
    Posts:
    56
    There are a few reasons that "seams" can show up:

    1)Your geometry vertexes aren't snapped together (this one is the most obvious). This doesn't mean welded, just co-located.

    2) You are deforming geometry that isn't welded - usually happens with multiple bone influence on a vertex

    3) On a skybox, if the textures on the faces aren't set to "Clamp" instead of "Repeat" in the Inspector, you'll have seams

    4) Finally, it can be due to MIP mapping and having textures that are set up incorrectly. The biggest "gotcha" is using textures where your UV's have inadequate bleed pixels and/or a background color that is way too contrasty for your texture. Here's an example:


    Here, the artist decided that white would be a good border color - resulting in very annoying edge-sizzle.
    $Borders White.jpg

    Here, the borders were swapped out for red to hilight where MIP mapping was using the border of the texture:
    $Borders Red.jpg

    Here, a dark grey is subsituted for background color - resulting in the "seams" disappearing:
    $Borders Grey.jpg


    Hope this helps! :)
     

    Attached Files:

    Last edited: Jan 21, 2014