The inner circles of Pixel hell - Pixel Perfection & Cameras

For the love of all things Holy - Lets answer this God forsaken question once and for all. As you can probably already guess I have been skipping around/through? pixel hell for the last few weeks and have partially lost my sanity. Every time I hit that play button, my sprites look like trash.

My Sprites:

  • Background sprites are drawn in 1920x1080 1:1 in Aseprite - They look mighty fine, crisp like bacon on a Sunday morning - Can I get an Amen?
  • Character/Object sprites are drawn in 16x16

When imported into unity, my sprites are setup with:

  • Point (No filter)
  • No compression
  • PPU: I have tried 1,100,16 & 20 - Distortion in all — Currently back to 16
  • Pixel Unit Mode: Bottom Left Hand Corner - Pixel (Although it always reverts back to normalized?)
  • Grid settings for XYZ: 1/PPU - Currently 0.0625 for a PPU of 16

Pixel Perfect Camera:
Reference Resolution: 256x144
PPU: Whatever my sprites are set to (16)

What I have tried:

I just don’t understand why an image drawn in 1920x1080 and with the camera setup for 16:9…it still distorts??

Despite my ‘humorous’ thread, I’m losing patience with Unity and will jump ship soon. Just want to make sure its not me and I have tried everything.

Here’s an example of bricks on a wall being distorted:

6343308--704811--upload_2020-9-24_14-52-55.png

Would really appreciate some guidance- Thanks in advance!

Update:

I set all sprite configs back to PPU = 1. Heres what I found when I press play:
With the display mode set to 16:9 and by shear luck of re-sizing the window I found this resolution that looks right (at least visually): 1444x812…

Which is not 16:9… next I put my eyeball up to the God damn monitor and counted how many pixels actually made up a “pixel” it was 9.

I’m confused.

are you testing this in the build?

build the game and take a full printscreen and show us

Hi Raarc,

Yes I was testing in build. So I’ve finally managed to find a winning combination of configs:

  • Set everything to 1PPU
  • Pixel Perfect Camera (PPC), reference resolution: X:320, Y:180
  • PPC Pixel Snapping is checked
  • Orthographic Size = 180

For 1920x1080 I get a pixel ratio of 6:1
For 1280x720 I get a pixel ratio of 4:1

My only concern is with performance, I’ve heard having a low PPU can be a bit of performance killer?

1 PPU is not performance killer but it limits your map size

1 PPU means that 1 unit ( x,y,z map coordinates ) = 1 pixel

unity map coordinates are vector3 ( float ) which becomes unreliable if you make your map larger than 99999( 5 digits )

So if you dont intend to make your maps bigger than x = 99999, y = 99999 you can use 1PPU, otherwise you need to try to get 16 or 32 PPU

also here is a formula that you are missing for your orthographic size to be pixel perfect

((Screen.currentResolution.height) / (scale * PPU)) * 0.5f;

Appreciate the replies Raarc,

However doesn’t the pixel perfect cam already calculate the required orth cam size? I can see it moving in increments of 0.0XX. It just so happened that 180 was a clean number for the size I needed.

Ah I don’t use pixel perfect camera, maybe it calculates it for you