I want my sprites to look very sharp on the screen. For example, I want a 100x100 pixel sprite to occupy exactly 100x100 pixels on the screen without any distortion or aliasing, in any resolution.
I import my PNGs with the following settings: PPU: 100, Filter: Point, Compression: None. Transform scale: 1,1,1
I started by creating a script that adjusted the camera’s orthographicSize with the following formula: (Screen.height / 2) / PPU. I got the following results: (I cut the image exactly where the artifacts appear).
I’m not sure if I need to apply antialiasing or if I’m doing something wrong. I should note that regardless of the resolution, I want my pixels to be 1:1, even if they appear smaller or larger.
The screenshots are from my phone; everything looks fine in the editor, but not on my phone.
You need to not only position the camera correctly on pixel boundaries and make sure that the ortho size is compatible (that’s what the PP camera behaviour does), you also need logic to ensure that the sprites are placed correctly on pixel boundaries. That’s your job. If anything is off, you will get aliasing.
It is debuggable by studying what numbers are being fed in, starting from the presentation resolution (Screen.width / height) and on down through the camera size and world pixels and on down to your source art.
Pixel Perfect requirements are extremely stringent, like a banknote: