Pixels keep stretching in build while in fullscreen

Hi there! I am currently using the latest unity 2017.1 and I’ve encountered this nasty problem.

I am making a 2d game with pixel-perfect sprites. I’ve properly configured the camera size to match to ppu of my sprites. I am also using pixel snap in materials to make scaling and rotation feel more oldschool. Finally, I am rendering in 800x450 to make it look even more old. However, there is a problem.

Here are 3 screenshots. The one captured in unity has no deformations. The one captured in a window the size of a rendering resolutions is ok, too. However, when I switch to fullscreen (1920x1080, still render at 800x450), I encounter pixel stretching (easily seen on a main character’s eyes).

Disabling pixel snapping, adjusting resolutions and camera’s sizes do not help. Can you please help me? What am I doing wrong?



Not sure if this is what you’re looking for but you can try attaching it to your camera so long as you have a constant aspect ratio and camera size

using UnityEngine;

public class CameraScaler : MonoBehaviour {

    public float orthographicSize = 16.875f;//set this to your camera size
    public float aspect = 16/9;//set this to your aspect ratio
    void Start()
    {
        Camera.main.projectionMatrix = Matrix4x4.Ortho(
                -orthographicSize * aspect, orthographicSize * aspect,
                -orthographicSize, orthographicSize,
                Camera.main.nearClipPlane, Camera.main.farClipPlane);
    }
}

No, sadly, that’s not it