Announcement

Collapse
No announcement yet.

Sprite Distortion During Movement and/or Default Size

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Sprite Distortion During Movement and/or Default Size

    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.


    Setup:
    ShowFlag.PostProcessing 0
    ShowFlag.Tonemapper 0
    ShowFlag.Vignette 0
    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)

    Camera Tick:
    Set Location to Player's X & Z

    Character Movement:
    (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?
    Attached Files

    #2
    For the TLDR; I'm auto setting Ortho Width to viewport.width/2.0^factor where factor=2, but certain pixel columns/rows on my character distort too big or small. This is especially true during movement, where the distortion is perpendicular, but happens on lower factors regardless.

    There's no clear way to fix this as I've varied materials, processing, and turned off and on various tracking and rounding strategies to try and resolve it (which only created new distortions on top of those ones).

    Comment

    Working...
    X