Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question 2D Pixel Perfect Problem

Discussion in '2D' started by diffuse, Aug 8, 2022.

  1. diffuse

    diffuse

    Joined:
    Jul 7, 2017
    Posts:
    1
    Hey guys,

    some weeks ago I started to setup my first unity 2D project using Unity 2021.3.6f1 and URP template. I studied articles about how to achieve pixel perfect 2D and watched quite some youtube tutorials on that. As I am a experienced programmer in my daytime job, I quickly extracted the essence of how pixel perfect rendering works and how to set it up, but there is one problem I cannot seem to solve since two weeks:
    • I set up my project using URP and Pixel Perfect Camera, that calculates orthographic size accordingly.
    • My PPU is set to 128, reference resolution 640x640 (for now), pixel snap is on
    • All of my sprites have a dimension of 128x128 pixel, point filter and no compression and are rendered in tilemaps
    • Whenever my sprites' dimension are exactly matching PPU they get rendered distorted.
    • If I put my PPU higher, e.g. to 256, my 128 textures are rendered perfectly.
    • If I switch out my 128 textures to smaller ones, e.g. 64 or 32, they are also rendered perfectly on 128 PPU
    Does anybody have some experience with an issue like that? I just have no clue why this behaviour is only there when the PPU and texture dimension perfectly match. Feedback is really appreciated, thank you!
     
  2. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,802
    If you could post a screenshot or video of the distortion, that would be helpful to diagnose your issue.