Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question (or Bug?) CM+URP : 2D pixelPerfect zoom issue ?

Discussion in 'Cinemachine' started by Jerem_, Aug 22, 2020.

  1. Jerem_

    Jerem_

    Joined:
    Aug 21, 2017
    Posts:
    14
    Hello world !

    There are many PixelPerfect component that exists and it confuses me.
    The CM PixelPerfect component doesn't work in my 2D Tilebased game.
    CM pixelPerfect.PNG

    So I use the Camera component named "Pixel Perfect Camera (Experimental)".
    fine pixelPerfect.PNG

    I feel that the right PixelPerfect component because it seems that it's the only one working for my project ahah.
    (note : I'm aware there's another PixelPerfect component in the "2D pixel perfect" package, but it's only compatible with LWRP projects if I'm right.)

    The camera :
    camera.PNG

    The hierarchy :
    hierarchy.PNG

    CM vcam1 and CM vcam2 are used to make transitions between Areas.

    Now, I need to make a zoom on the player.
    To achieve that, I have added a 3rd "CM vcamZOOM".

    But here's the issue :
    It doesn't work. Even if it's the only vcam enabled, it's not zooming.
    I found out that disabling the "Pixel Perfect Camera (Experimental)" component on the Camera solved the problem.
    That's not a real solution since I need to use a PixelPerfect component (with the ability to Zoom).

    Am I using the right PixelPerfect component for my needs?
    Is this a compatibility bug between URP camera pixelperfect component and CM zoom ?
    Thanks for reading and for your answers.
     
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
  3. Jerem_

    Jerem_

    Joined:
    Aug 21, 2017
    Posts:
    14
    Hello @gaborkb and thanks a lot for your reply :)
    I already have read the forum thread you linked before making mine. It didn't help me because @Gregoryl asked to remove URP if it was not used by the project.
    In my case, the project needs URP.

    Is the Cinemachine pixel perfect component is supposed to work with URP ?
    => If the answer is Yes, it means I'm doing something wrong. Fixing this will surely solve the main issue.
    => If the answer is No, what are my options? To use the URP pixel perfect component and try to find a workaround ? (something like : deactivate the URP pixperfect component when I want to zoom)

    I think it's very common to work with 2D tiles (+pixel perfect), lights and zooms. This is why I feel dumb because it looks like nobody is having this issue. I'm probably doing something wrong :(
     
  4. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Pixel perfect works for your two vcams, but it does not work for the zoom camera, right? Could you send an image of your zoom vcam, and one of your working vcams.

    Did you add Cinemachine Pixel Perfect extension to your vcams, while having Pixel Perfect Camera (experimental) on your main camera? I read here, that you need to add that otherwise there is a conflict. I assume, your zoom camera zooms in by modifying orthographic size. But if you don't have Cinemachine Pixel Perfect on the vcam that modifies orthosize, then this orthographic size change is going to be overwritten by Pixel Perfect Camera (experimental).
     

    Attached Files:

    Last edited: Aug 24, 2020
    Gregoryl and Jerem_ like this.
  5. Jerem_

    Jerem_

    Joined:
    Aug 21, 2017
    Posts:
    14
    Hoooooooooooo @gaborkb, that was it ! (and I swear, I already read this link too)
    I thought URP-pixelperfect + CM-pixelperfect were doing the same job and were not supposed to work together, because of an 'obvious' conflict. Damn, It was maybe the only thing I didn't try ^^'

    So, thanks a lot, it's perfect <3

    For those who are struggling, here are some screenshots.
    My camera :
    cam.PNG

    my vCams (noZoom) :
    vcam-nozoom.PNG

    my vCam with Zoom :
    vcam-zoom.PNG

    And now, I'm using the StateDrivenCamera for the blends, which is easy and awesome to use (use it!) :
    stateDrivenCam.PNG

    Again, thanks a lot @gaborkb
     
    gaborkb likes this.