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

Resolved Blurred sprites while moving - not the player

Discussion in 'Cinemachine' started by xDayhawk, May 29, 2022.

  1. xDayhawk

    xDayhawk

    Joined:
    Jun 24, 2020
    Posts:
    55
    Hi,

    I have a physics-based movement on my char, and i noticed the player and all other sprites get blurred out when i'm moving.
    I changed the update method on cine to "Fixed Update" and it solved it for the main player, rest of the sprites (enemies and whatnot) are still blurry when i move.

    i tried pixelated ones (16/32 pixels) and even tried a normal sprite that i didn't create, its all blurred when i move and it's driving me insane.
    i even tried a straight out 2D square sprite built-in from Unity.

    I've tried a pixel perfect camera, that didnt solve anything.

    The reason i think its related to some kind of a configuration in Cinemachine is because when i created a very simple follow script that i put on the Main Camera there's no blur on all other sprites, but then i'm back to my original problem where the main char is actually blurred out :)

    please help!

    i tried capturing it via a Clip but its really not that obvious to see.


    Additional information that may help:
    • Anti-aliasing turned OFF
    • Unity version - 2021.3.1f1
    • Tried different backgrounds, solid color (i saw a post where some1 claimed it might be related to a missing background or more solid color)
    • Turned OFF generate mip maps (again, some1 recommended on a thread i saw)
     
    Last edited: May 30, 2022
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    It's not a camera setting. You can't move some things in FixedUpdate and other things in Update and expect everything to be smooth. They are different clocks and there will be aliasing artifacts. You have to move everything in a consistent way.

    With a physics-driven main player, you have 2 options:
    1. Move evreything in FixedUpdate and nothing in Update, or
    2. Turn on interpolation on your physics objects (including player) which will generate Update-compatible positions, then move everything in Update and nothing in FixedUpdate.
    In either case, make sure to correctly include Time.deltaTime in your movement calculations.
     
  3. xDayhawk

    xDayhawk

    Joined:
    Jun 24, 2020
    Posts:
    55
    Hi,
    first of all, thank you for your fast and detailed response.

    I'm aware of "all or nothing", but the thing is - those other Sprites have nothing on them, its just an object with a Sprite renderer, there's no rigid body, no script, nothing.
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    1. Is the problem that the background objects are not rendering in a pixel-perfect way? (sorry but I can't tell from the video).
    2. Can you check something for me: put the CMBrain in SmartUpdate, play the scene, move the player, and check the vcam inspector. What does it say in grey to the right of the Solo button?
     
  5. xDayhawk

    xDayhawk

    Joined:
    Jun 24, 2020
    Posts:
    55
    Regarding #1, I use a lot of other sprites that are not pixel art, they all blur as well. the play is pixel art though.

    Regarding #2, it says "Fixed Update":
    upload_2022-5-30_15-41-40.png

    upload_2022-5-30_15-44-26.png
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    Thanks. I'm trying to understand what you mean by "blurry". If it's not pixel-perfectness, then what is it?

    Can you try another experiment? Enable interpolation on the main player, and run the scene again. What does the vcam inspector say now?
     
  7. xDayhawk

    xDayhawk

    Joined:
    Jun 24, 2020
    Posts:
    55
    When the main camera is set to Smart update and interpolation is turned OFF vCam shows Fixed update
    When the main camera is set to Smart update and interpolation is turned ON vCam shows Late update
    it actually looks a little better when interpolation is turned ON and main camera is on smart update.

    I dont know what to tell u about if its not pixel perfectness then what is it, i've added more sprites, normal sprites i've done in photoshop.
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    I would recommend leaving interpolation on, and doing all animation in the normal Update loop. Then, you can set your CMBrain to LateUpdate (which is more performant that SmartUpdate).

    As for the blurriness, I don't know what it could be other than pixel aliasing. This is an artistic decision you will have to make: do you want everything to be pixel-perfect or not? I don't know how you've set up your scene. Are all sprites (including player) on the same plane? Is the camera perspective or ortho?
     
  9. xDayhawk

    xDayhawk

    Joined:
    Jun 24, 2020
    Posts:
    55
    Hi again,

    i changed everything to update and found out that there's an extension in cine for pixel perfect, that seemed to make things much more constant

    I think we can close this, changing to resolve!
    thank you again :)
     
    Gregoryl likes this.