Search Unity

Rendering artifacts

Discussion in 'General Graphics' started by jRocket, Aug 1, 2019.

  1. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    I'm having an issue with the standard render pipeline. At certain angles and distances, I'm seeing what appears to be a gap between my two plane meshes. I've already checked to make sure that they are at the correct position(whole numbers in the transform), game window scale at 1x, tried vertex snapping, and made sure mesh compression is disable- but the thin line still appears. I've tried this with two different resolutions- it is less apparent at higher resolutions, but it is very noticeable at lower resolutions. Different shaders doesn't do anything either. Any ideas? I'm on 2019.2

    upload_2019-7-31_20-10-30.png
     
    peopleUnity likes this.
  2. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    I haven't, but I was able to work around the issue by slightly extending the wall mesh out on the top and bottom by something like .001. I still don't know why it's happening. I suspect some gpu rasterization issue.
     
    peopleUnity likes this.
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,348
    Looks more like a texture wrapping / UV issue than an actual gap. With point filtered textures and the "fun" of floating point math, it's very possible for the UV position to end up being just into the next row of pixels causing it to wrap and you see the top edge of the texture at the bottom.

    Try changing the Wrap Mode to Per Axis, with U set to Repeat and V set to Clamp.
     
  4. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    I don't think it's wrapping. If I remove the floor tiles, you can clearly see a row of pixels being rendered up one on one of those modular wall pieces, which is where that line would be if the floor were there. I tried all the filter and wrap modes but it still occurs.

    Probably is a floating point math thing. Moving the verts down by a very small amount (.001) does fix it.

    upload_2019-8-1_13-51-34.png
     
    Last edited: Aug 1, 2019
  5. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,348
    In that case, yeah, it's probably a rasterization issue. Again, floating point math fun means that algebraically parallel edges might not rasterize the same if the two end points are not exactly the same.

    Basically if you have a wall and a floor that don't have matching vertices along the edge they touch, there's the possibility for holes like above. Note, even if there are vertices that line up, unless they're both using the same transform there's still no guarantee they're exactly the same.
     
  6. SunnyMonster

    SunnyMonster

    Joined:
    Oct 25, 2020
    Posts:
    7
    I seem to have the same issue. But light can pass through my gaps which means they are transparent. I tried turning alpha clipping off, but the gap and its shadows persist. So I don't think it's the problem of uvs.

    So what can I do to fix the issue?
     
  7. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,348
    Please post your question as a new thread. The issue you're describing is likely completely unrelated to this conversation.