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 Unity pixel art doesn't look right

Discussion in '2D' started by unity_DA4FDC8A3E73A903E7DB, Sep 11, 2023.

  1. unity_DA4FDC8A3E73A903E7DB

    unity_DA4FDC8A3E73A903E7DB

    Joined:
    Feb 1, 2023
    Posts:
    3
    Hello, I could not find any information of my problem on this forum or others.

    My Pixel art doesn't look right, the background should be grass and the sword should have a straight outline, is this a normal issue?

    I've tried:
    Changing resolutions
    Changing settings on the sprite in question, particularily compression and colour settings
    Changing zoom on the game and camera settings
    Building the game to see if the issue persists outside unity (it does but not as bad)

    upload_2023-9-11_14-9-4.png vs New Piskel (2).png + svärd_2_final.png
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    You are rotating pixel art.

    That's the problem.

    Generally you can never rotate pixel art by anything except multiples of 90 degrees.

    You get the effect you want, you will need to make separate sword graphics for each angle you wish to display.
     
  3. unity_DA4FDC8A3E73A903E7DB

    unity_DA4FDC8A3E73A903E7DB

    Joined:
    Feb 1, 2023
    Posts:
    3
    Fine, sure, I get that, doesn't make sense when you take into account that the background is also wrong, It sits on a tilemap. It's not rotated and not manipulated in any other way.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    Agreed. I didn't even notice. Looking at it now it appears you are stretching it. Don't do that.

    Pixel-perfect stuff is incredibly elusively hard to do. Part of this is because everybody has a different idea of what it entails.

    At the end of the day you have textures, you import them in some way, you put them on something (such as a SpriteRenderer or even geometry and a MeshRenderer) and you point some kind of Camera at them, a Camera which could have some additional "pixel perfect" script controls on it.

    The only way to untangle it is to steadily work up from the basic image data until you reach your desired presentation resolution.

    Then go back and figure out what you want when that resolution is now 1.5x as many pixels. There's different answers you will get from every single person and every single game design.
     
  5. unity_DA4FDC8A3E73A903E7DB

    unity_DA4FDC8A3E73A903E7DB

    Joined:
    Feb 1, 2023
    Posts:
    3
    How do you reckon it's made in for example Terraria? From what I can gather the swords/weapons are also rotated but still keep a crisp texture.
     
  6. sildeflask

    sildeflask

    Joined:
    Aug 16, 2023
    Posts:
    142
    dont use pixel perfect camera if you dont want these artifacts
     
  7. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    My engineering understanding of pixels and how they work would lead me to think that their artist made every frame of every rotation.
     
  8. MaxwellTan

    MaxwellTan

    Unity Technologies

    Joined:
    Mar 3, 2022
    Posts:
    73
    Hi, I wondering have you include the pixel perfect camera on your project.
    It is working when rotating the weapon
     

    Attached Files:

  9. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    530
    @MaxwellTan That's with URP or HDRP. With builtin rendering pipeline the pixel perfect camera works a bit differently.

    I assume the author is using pixel perfect camera with builtin rendering pipeline and "Upscale render texture" mode enabled. "Upscale render texture" could easily cause visual defects like that or shimmering for rotating objects or anything that is stretched or scaled.
     
  10. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    530
    Solution is to do one of the following:
    * Not use pixel perfect camera at all
    * Disable Upscale render texture option
    * Don't rotate sprites and carefully positioning everything aligned with pixel grid to avoid shimmering.