Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Sprite shape + perspective camera jittering lines

Discussion in '2D' started by BinarySouls, Jun 24, 2022.

  1. BinarySouls

    BinarySouls

    Joined:
    Jan 14, 2018
    Posts:
    13
    Hello!, I'm using Sprite Shape 7.0.5 in Unity 2021.3.5f1.

    To show the issue I made a simple closed shape using a black square for all parts (sprites and corners)
    In real levels, I'm using multiple points on each segment to add variety (this makes the issue more visible for this example, so it comes handy)

    Scene view:

    upload_2022-6-24_5-10-8.png

    Issue video:


    It's hard to catch it on video but you can see the lines/gaps appearing mostly at top right and top left corners, but sometimes it also happens on ground/ceil. This is causing a sort of "detached corners" effect on my real shapes when camera passes by.

    Any help would be appreciated.

    Thanks!
     
  2. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,802
    Looks like pixel rounding error. Not sure exactly what is causing the issue, but one thing I would try is to mess with how you are moving your camera. If you're moving it via FixedUpdate (due to character movement with physics maybe?), then you could try moving the camera in LateUpdate to follow the player. Or perhaps add a tiny amount of interpolation/damping to the camera movement. Sometimes tweaks like that solve visual oddities. Again, not sure how to really solve the actual visual bug, just food for thought.
     
  3. BinarySouls

    BinarySouls

    Joined:
    Jan 14, 2018
    Posts:
    13
    Thanks @LiterallyJeff , I tried tweaking the camera update but nothing seems to fix it. Adding damping only makes the lines more visible on the slow camera movement (I removed it for the video).
    I tried also antialiasing and other graphics settings, modifying sprite's import settings...no luck.
    This only happens on sprite shape, it doesn't on tilemap or simple sprites.
     
  4. BinarySouls

    BinarySouls

    Joined:
    Jan 14, 2018
    Posts:
    13
    I found it! Camera->Output->MSAA was set to off, setting it to use settings from render pipeline and set MSAA 8x in render asset does the trick. Thanks!
     
    LiterallyJeff likes this.