Blurry/Incorrect Rendering of Sprites with URP "Pixel Perfect Camera (experimental)"

Hello,

I’ve been trying to use the Pixel Perfect Camera (PPC) in my Unity 2D project with the URP. The behavior I am getting is a bit counter-intuitive, that is, the use of the PPC in my project causes my sprites to blur/render incorrectly. The primary sprite effect is the sign sprite, but the character sprite is effected as well if I enable Stretch Fill (which I have been leaving off).

This is what my scene looks like without the PPC attached to my main camera:
6934545--814479--without_ppc.png

I would expect my scene to look the same as the above image as I know what the sprites should look like, but once I add the PPC the sign sprite looks like this:
6934545--814476--with_ppc.png

As a reference the actual sprite for the sign is:
6934545--814485--genric_sign.png

PPC component properties are as follows. I have noticed that if I change the APPU to 15 or 17 the sign seems to render correctly (or at least as far as I can tell), but then the character sprite acts up.

6934545--814500--ppc_settings.png

Wonky character sprite after enabling Stretch Fill (notice how the top leaf on her head is now cropped).

6934545--814503--stretchfill_ppc.png

I’ve tried to the best of my ability to follow the instructions here (2D Pixel Perfect | Universal RP | 7.1.8) but I I am having no luck.

For reference the sprite sheets have a PPU of 16. The intended resolution is 640x360 (which is 16:9), and the idea is if someone full-screened the game what they would see is an upscaled version of 640x360 rendering.

Does anyone know what I might be doing wrong or how I could go about getting to the bottom of this?

Thanks,

Enable pixel snapping or move the transforms for your Sprite such that it doesn’t fall within a fractional pixel unit. That’s my guess anyway. that being said I have never ever ever found a need to use the 2D pixel perfect camera. It’s much easier to just set your screen resolution as a multiple of your Sprite size.

1 Like

Thanks for the advice. I’ve tried making sure both the camera and the sprite have integers for their position values, but this made no difference. I have also tried pixel snapping with no luck. I do notice that if I move the sign around, its appearance changes a bit (mostly its black outline), but it is rendered incorrectly.

I find this very strange as the PPC says that the pixel ratio is 1:1 (which would make sense as I have the game tab set to be 640x360).

Out of curiosity I set the reference resolution on the PPC to 320x180 and things appeared to render crisply. Of course I can’t use this reference resolution as then I don’t see everything on screen that I would expect to see since everything is now “larger”.