Search Unity

Tile Map mesh tearing problem / FilterMode.Point quality

Discussion in '2D' started by headcrap, Feb 2, 2015.

  1. headcrap

    headcrap

    Joined:
    Jul 29, 2014
    Posts:
    37
    Hi,

    i draw my tile map (tmx) as mesh and have really strange tearing problems between the tiles.
    Video of the problem:
    https://www.dropbox.com/s/e9ntt6s3zzcna9u/tiletearing.mov?dl=0

    First i try this solutions without luck.
    (http://forum.unity3d.com/threads/tile-map-tearing-problems.225777/)

    Camera: Orthographic Size 8
    Quality: Anti Aliasing On / Off no changes
    Texture ist power of two (2048x2048)

    I load the texture in runtime with this piece of code:
    ...
    this.texture = www.texture;
    this.texture.filterMode = FilterMode.Trilinear;
    //this.texture.filterMode = FilterMode.Point; Bad Quality
    ...

    When i change the filterMode to Point the problem is gone but my Texture is very blurry.

    Any suggestions?

    Thanks
    Christian
     
  2. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    569
    To get good quality pixel art graphics, do the following:

    Sprite settings:
    Filter Mode: Point
    Format (compression): Truecolor

    Make a new material, select Sprite shader, in the settings it should have a checkbox for Pixel snap, enable it.
    Use this material for all your sprites instead of the default sprite material.

    Hope that helps :)
     
    theANMATOR2b likes this.
  3. headcrap

    headcrap

    Joined:
    Jul 29, 2014
    Posts:
    37
    Thanks for your reply. I load the texture from the streaming asset folder and use the WWW class.
    I think unity will ignore the settings from the texture because i load them from code right?
     
  4. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    569
    Yeah, so you'll have to do the settings via code :) That way you should also assign the new Sprite material with pixel snap enabled.