Search Unity

Question URP+Cinemachine+PixelPerfect incompatible?

Discussion in '2D' started by maraoz, Mar 20, 2021.

  1. maraoz

    maraoz

    Joined:
    Nov 15, 2012
    Posts:
    20
    I posted on Unity Live Help with no luck.

    I'm trying to migrate an existing project to using Universal Render Pipeline (URP). The project already uses a Cinemachine 2D camera (follows the main character), and Pixel Perfect Camera together.

    The idea of adding URP is to add some 2D lights to the game. Problem is the camera is shaky when I move to (even with Cinemachine Pixel Perfect extension). The linked doc reads:
    • When a virtual camera with the Pixel Perfect extension is set to follow a Target Group, there may be visible choppiness when the virtual camera is positioned with the Framing Transposer component.

    So, my question is: is there any workaround to get 2D Lights (I assume this needs URP), Cinemachine, and PixelPerfect camera to work harmoniously in the same project?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    I assume that you're using the URP version of PixelPerfectCamera, and not the PixelPerfect package.

    Can you send me a lightweight test project that shows the problem?

    Otherwise, please try this experiment: remove Cinemachine and replace it with a simple script that follows your target but leave the PixelPerfectCamera behaviour on the Camera. Is there still jittering?
     
  3. maraoz

    maraoz

    Joined:
    Nov 15, 2012
    Posts:
    20
    Hi @Gregoryl ! thanks so much for your reply!
    I did both your suggestions.

    1) here's a stripped down version of the project in which the camera jitters on my end:
    https://www.dropbox.com/s/3jq6x1bre4ajc10/2d-underwater-urp.zip?dl=0

    2) I tried your experiment, and to my surprise, the jittering was still there!! I thought it was a Cinemachine compatibility problem, but maybe it is something else? If you want, you can try that version with a custom camera controller on the zip I uploaded by deactivating the Cinemachine camera and activating the Main Camera Controller Script on the "Main Camera" object.

    If it helps, another bug/artifact that is introduced when I migrate my project to URP (btw I'm using this guide to migrate), is that the black bands that appeared above and below the game screen now contain "residue" images:
    upload_2021-3-22_17-37-22.png


    Thanks in advance!!
     

    Attached Files:

  4. maraoz

    maraoz

    Joined:
    Nov 15, 2012
    Posts:
    20
  5. bitlather

    bitlather

    Joined:
    Jun 17, 2014
    Posts:
    4
    This sounds a lot like what I'm experiencing right now, as well.
     
  6. maraoz

    maraoz

    Joined:
    Nov 15, 2012
    Posts:
    20
    Hey @Gregoryl ! did you have the time to look at this? The game is progressing forward, with no 2D lights, but it would add a lot to be able to use URP in this project!