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

Overthrowing the Pixel Perfect Tyranny

Discussion in '2D' started by Rocky_Unity, Mar 20, 2021.

  1. Rocky_Unity

    Rocky_Unity

    Joined:
    Oct 13, 2017
    Posts:
    96
    In regards to Pixel Art games,
    Every guide out there says you use the Pixel Perfect package. To be honest, I don't think most people want Pixel Perfect. In fact, I find Pixel Perfect to cause such demoralizing effects that I want to stop trying.

    What we want is a Pixel Perfect Orthographic setting. (easy enough to calculate)
    Then we need our TileSheets to be placed in a Sprite Atlas for the automatic padding (this doesn't strictly work with Isometric tiles btw, you'll have to pad the diagonal in your art). This is to avoid the tile-tearing issue.
    All objects should "rest" at a pixel perfect location, as to avoid the floating jitter when the camera comes to a stop.

    Lastly, is the part that I'm still trying to account for. We need our character to ultimately snap to a Pixel Perfect location so they don't jitter as the camera comes to a stop. In motion, however, we don't want to snap to Pixels, because we get awful jittering effects.

    This NEARLY works fantastic. Except for only the Y-direction, I get the dreaded floating jitter.


    Again, this does not occur in the X-direction. Any thoughts? If we can solve this, I think this would be the go-to methods for creating a Pixel Art game and save a lot of people from giving up. Most importantly, it allows for a follow camera, even a smooth-follow camera.
     
  2. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    the reality is that unity was never intended to allow for pixel perfect, you can tell that is so because its so hard to achieve, all the new packages that try to support it are extra features that may enable you do achieve pixel perfect if you try hard enough.

    I myself have given up on pixel perfect, it saves me an headache and most people wont even notice. ( Take for example stardew valley, 99% of the people wouldn't notice its the farthest there is from pixel perfect and they would compare it to gba harvest moon or minish cap and say its the same style, or better)

    Now I have pixel art graphics and a smooth camera, I can go sub pixel and cheat on animations to make them more subtle and as long as I keep my ortographic size in check I dont run into distortions or jitter
     
  3. Rocky_Unity

    Rocky_Unity

    Joined:
    Oct 13, 2017
    Posts:
    96
    Exactly!! I completely agree. I think it is terribly misleading how many guides and articles immediately route you towards pixel perfect packages, which ultimately undermine what most people are trying to do. It is only the orthographic value that these guides or packages should offer (at least as a solo option), as that is a true necessity in pixel art

    Do you do anything special in your object position or movement scripts to help prevent the camera from causing strange floating effects on stationary objects (as seen in my GIF above?) ---- when I hit the pause button, my character stops, but as the camera catches up, it moves the character into a sub-pixel position and makes the character do a very small jitter effect
     
  4. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    I dont know why your camera is doing that sorry =/ I would think that it would move the background aswell into the sub pixel position but its only your character that is being displaced, or maybe it is the background being displaced upwards and it looks like its the character? I haven't experienced this problem so I cant offer a solution for it =/, maybe try to keep an eye on the transforms of everything and see what piece has a Y position it shouldnt have, the character, the background, or the camera