Search Unity

Rendering artifacts at vertex seams and object seams

Discussion in 'iOS and tvOS' started by prime31, Dec 31, 2009.

  1. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    The image below shows the issue I am having. The green circle is a seam of a single objects vertices and the red circles are where 2 different objects meet. My scene is dead simple with only 3 meshes (planes): one for the ceiling, walls and floor. When moving around the skybox showing through is much more distracting and prominent.

    How can I keep the sky from showing through?
     

    Attached Files:

  2. jackshiels

    jackshiels

    Joined:
    Feb 29, 2008
    Posts:
    357
    I had this problem once. Try turning your near clip plane up and see if that works.
     
  3. bpatters

    bpatters

    Joined:
    Oct 5, 2009
    Posts:
    164
    I get this and other similar problems when I turn on texture filtering. bilinear/trilinear filtering seems to cause this for a lot of my levels. Probably something to do with my texture atlases. I just disabled the filtering and all my artifaces went away.
     
  4. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @jackshiels, where is the near clip plane setting located?

    @bpatters, I have all texture import options set to default and the locations in question are using a tileable texture (with a lightmap blended on top)
     
  5. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    Do these artifacts appear when built to the iPhone? Are you using pixel lights in the Editor? This has nothing to do with texture settings... it happens due to overlapping geometry and is only an issue with pixel lights which the iPhone does not support. So try building to the device and I can almost guarantee that the issue will disappear.
     
  6. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @aNTeNNa trEE, the screenshot I posted is from the device. It has the artifacts on both an iPod touch 2G and a 3GS. In the editor, it looks fine. There are no lights in the scene at all. Everything is baked into the textures.
     
  7. bpatters

    bpatters

    Joined:
    Oct 5, 2009
    Posts:
    164
    On my machine it's caused by Bilinear and trilinear filtering. Bilinear is the default for imported textures.

    It happens both in the editor and on the device. I use forced vertex lighting for rendering.
     
  8. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    I think these issues are unrelated. Bilinear filtering will show this problem if your textures don't have a good color on their edges. Mipmaps will show this problem if your texture map has widely-varying areas of color. The last type of case where I've seen it is where you don't have your vertices welded - if you just have planes that line up in your modeling app, that won't translate well to Unity, due to floating point error. You either need to overlap the planes (which will still show the problem, except it won't show the skybox – just one texture of the other), or preferably, merge their verts. This last bit is a big pain, because I often want flat surfaces that connect, but are separate meshes. Oh well.

    None of these problems are specific to the handheld, however, and will show up in the Editor, so I don't know what this problem is.
     
  9. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    So, changing the texture import settings had no effect: bi, tri and none all showed the artifacts. It looks like overlapping the meshes does keep the skybox from bleeding through. I still get artifacts where two faces in the same mesh meet though (the green circle in the image from my original post). I tried removing the textures and just using a material color and I still get the artifacts at the seems. This is especially ugly at the corners of all the walls. The wall is a single mesh with 1 or 2 faces per wall. I went back through my model and made sure there were no extra verts but all looks fine. Any ideas what else this could be?
     
  10. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    As Jessy said, welding/merging the vertices will make the artifacts disappear. This is not a texture issue ;)