Download

Pixel perfect sprites using orthographic camera, help!

I’m getting distortions in my sprite that I can’t seem to solve.

The problem: I have a .png file that is 640x360. My orthographic camera is set to ortho width = 640 and in the editor preferences I have set New Viewport resolution to 640x360.

How I expect it to show up in the play window:
alt text

How it shows up in my play window:
alt text

It also looks like the sprite is lit a little bit (difference in the green colour)

My process: I import the .png into UE4 and then apply Paper 2D settings. I then make a sprite. Here are the settings of each:

alt text

*note: when opening the texture in UE4, I can zoom in and out at multiples of 640x360 (like 1920x1080) and the pixel fidelity is maintained.

alt text

I have set the camera and the sprite in the world at the exact same x,z location {0, Y, 0} (y locs are different so camera doesn’t clip the sprite). Here are the camera settings:

alt text

I’ve tried my best to turn off all post processing on the camera, be it via project settings or the actual camera itself.

Help!

Any suggestions on how I can fix this? If possible, I would also like to be able to scale to different window resolutions that are multiples of 640x360.

Maybe you could try increasing the “Screen Percentage” in the Post Process settings. This will make it render more pixels, then scale it down to the viewport size.

UPDATE: I found something that helps.

In your editor window you can change the Resolution Scale to 100%:

alt text

Here is the result: alt text

**Edit: The picture in the post shows a bit of distortion, but if you open the picture to view it in full, the distortion goes away and represents what I see on my play window.

I’d like to add that it seems to scale well in multiples of 640x360. For instance, at 1920x1080, the pixels do not seem to distort when they scale up. For now I am satisfied with this solution.

minor note: There’s still a bit of lighting happening on the sprite but that is a separate issue. Lighting can be completely removed by changing it to Unlit mode using F2 in the play window or via a console command.