I am getting a bizarre bit of behavior when I have a ‘character’ move about on the screen. I have been using LoZ sprites for testing, and when blown up (or not) they let me see if there are any issues. Even when the sprites are blown up, pixels distort slightly during movement, perpendicular to the direction. When the Viewport Width is only half the viewport width, they heavily distort even when still. This happens even though the Ortho camera has a width automatically based on the viewport size!
In the larger images Ortho is set every tick to Viewport Width / 4.0. I tried relaxing this to only setting Ortho during BeginPlay, but nothing really changed.
FYI, the displayed text is the Viewport dimensions, the Viewport Scale, and the Screen Resolution.
Character is displayed via Paper Sprite Component for testing; MaskedUnlitSpriteMaterial
Character Texture: compression - UserInterface2D, Mip Gen - NoMipmaps, TextureGroup - 2D Pixels (unfiltered)
Camera Begins: Set Ortho Width (Viewport Size / 4.0)
Set Location to Player’s X & Z
(Log Axis direction during Input)
On Tick: Make Vector out of axis movements > Add Movement Input, scale = floor(walkspeed * delta seconds (*1.42 if diagonal) ) > Round X/Z of Character > Update Camera to Player’s X/Z (as per Camera Tick)
In one picture you can see the distortion on link’s eye, with the other similar picture being him as ‘still’. There still may be subtle distortions there. The last one has Viewport.size.Width / 2.0 instead of / 4.0 and as you can see it doesn’t render right at all (particularly at the hairline).
I’m at a loss for how to set the resolution of this automatically. I’m certainly not going to try and ‘tweak’ a recommended Ortho for every possible resolution either. I’m almost positive this isn’t really an update issue with the camera, but subtle artefacting from not-quite-correct resolution settings.
I’m already setting it to be based on the viewport size, so what else can I even do? What factors should I be looking for? How can I set the resolution of this right?