Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Sprites, PVRTC and artifacts on the edges

Discussion in '2D' started by TimSchroeder, Dec 1, 2014.

  1. TimSchroeder

    TimSchroeder

    Joined:
    Aug 27, 2014
    Posts:
    9
    Hi,

    we are splitting a big background sprite in 4 parts. The sprites are put together in the scene as separate sprites. This works without a problem on Android with ETC compression enabled. If we switch to iOS and use the RGB PVRTC 4 Bits compression we get artifacts (wrong color on some pixels, e.g. in a green carpet some brown pixels) around the edges. Only around the edges. If we switch to RGB16 on iOS the artifacts are gone.

    Is there a trick to make PVRTC work? We have no transparency in the sprites and no other special things. The problem is that the artifacts make the cutting line visible.

    Greetings

    Tim
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Maybe have some extra pixels around the edges that you don't use, and then overlap the sprites, so the artifacts are hidden. Or use quads UV mapped so the garbage pixels aren't displayed at all.

    --Eric
     
  3. Simon-F

    Simon-F

    Joined:
    Jan 17, 2011
    Posts:
    36
    PVRTC 1 (sort of) assumes the textures will probably tile seamlessly and so tries to share information between the left and right hand edges and, similarly, between top and bottom. Also the compressor (at least the IMG one) treats all texels equally. Perhaps there should also be an option for it to try to lower the errors on the boundaries, but that's something that can't be added in the short term.

    Other than putting all the portions together into one texture and compressing that in one go, at least in the short term, Eric's suggestion of making the source textures slightly wider (or equivalently, scaling the source data and padding) and only sampling the required portion might be the best solution.


    PVRTC-II is able to turn off the wrap-around but IOS doesn't expose it (at least, AFAIK).
     
    Last edited: Dec 2, 2014