Search code examples
unity-game-enginescreen-resolution

Resolution for 2d pixel art games


I'm having problems to set the right resolution on unity to not have pixel distortion on my pixel art assets. When I create an tile grid, on the preview tab the assets look terrible.

enter image description here

I have an tilemap with 64x32 resolution for each tile.

I'm using 64 pixels per unit.

The camera size is set to 5 in a 640x360 resolution (using the following formula: vertical resolution / PPU / 2).

What I'm doing wrong and what I'm missing?


Solution

  • To solve this problem and get an "pixel perfect" view, you need to apply the following formula:

    Camera size = height of the screen resolution / PPU (pixels per unit) / 2

    This will do the job!