Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Help Wanted Need Help With Pixel Perfect

Discussion in 'Cinemachine' started by PaperMouseGames, Mar 31, 2021.

  1. PaperMouseGames

    PaperMouseGames

    Joined:
    Jul 31, 2018
    Posts:
    255
    Hi there! I'm having trouble with getting my Cinemachine camera pixel perfect. After some searching on google I found the suggested settings for getting this working but I think I'm having some sort of Render Pipeline issue. Some threads mentioned this but I don't know how to fix it :(

    I'll attach some images to show my settings and the issue. I'm getting a warning on the Pixel Perfect Camera attached to the CinemachineBrain about it not being compatible with the Scriptable Render Pipeline, but I just don't know how to fix this. I'm not sure what I have to change/remove from my project or how to do it to make this work.

    Or maybe I should be looking into another solution for my issue? I would really appreciate some help, thanks in advance!

    Here is my CinemachineBrain:

    Screenshot 2021-03-31 095846.png

    Here is the virtual camera:

    Screenshot 2021-03-31 095906.png

    And here is the issue I'm having:

    Screenshot 2021-03-31 092906.png
     
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    433
    Hi,
    What packages do you have installed? Could you take a screenshot of your packages? (Window -> Package Manager, Packages: In Project)

    I think you need to remove Pixel Perfect package from your project, because your render pipeline has a Pixel Perfect component. Cinemachine is expecting the render pipeline's Pixel Perfect component.
     
  3. PaperMouseGames

    PaperMouseGames

    Joined:
    Jul 31, 2018
    Posts:
    255
    Thanks for the reply, here is the picture of my installed packages:

    Screenshot 2021-03-31 104939.png

    So is the issue the 2D Pixel Perfect?
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    4,890
    Yes, remove PixelPerfect 2D. The note in the inspector from your screenshot was already telling you this (LWRP was the old name for URP).

    upload_2021-4-6_7-12-17.png
     
  5. PaperMouseGames

    PaperMouseGames

    Joined:
    Jul 31, 2018
    Posts:
    255
    Thanks for the reply! So I did this. I removed 2D PixelPerfect. I added the component to my main camera called Pixel Perfect Camera (Experimental). No longer getting the warning message.

    The issue is still there though, it's maybe a little bit less obvious but very much still getting that sort of mirage effect when I move, and sometimes even on stopping I can see the different sized pixels on screen.

    I tried to use the Pixel Snapping option on the Pixel Perfect Camera (Experimental), but while that does fix the mirage/pixel size issue, it makes everything feel very stutter-y.
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    4,890
    Try this experiment: does the problem go away if you remove Cinemachine and replace it with a simpler camera script (possibly just parenting your camera to the player)?
     
  7. PaperMouseGames

    PaperMouseGames

    Joined:
    Jul 31, 2018
    Posts:
    255
    Ok so I turned off the Cinemachine cameras, and just added a regular camera as a child to the player. The pixels are all now the same size and there is no mirage effect.

    So I guess it's either an issue with the Cinemachine cameras or with the Lerp movements? Since the player's child camera has no smoothing or anything.
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    4,890
    Can you send me a sample project that reproduces this issue? I'd like to take a closer look.
     
  9. PaperMouseGames

    PaperMouseGames

    Joined:
    Jul 31, 2018
    Posts:
    255
    I'll try to put something together. How would I send it? A Package file?
     
  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    4,890
    Either a package (you'll have to test it in an empty project to make sure you got everything), or just zip up your project if it's not too big (don't include the Library folder - it's very big and just gets regenerated if it's missing). You can PM it to me. Give me clear repro steps (which scene to open, and what to do to see the problem).
     
  11. PaperMouseGames

    PaperMouseGames

    Joined:
    Jul 31, 2018
    Posts:
    255
    Ok so I'm having some weird stuff happening:

    I made a new simple project on the same Unity version as my current project (2019.4.6f1)

    I got the Cinemachine package, and made a simple scene. Still having the same issue with the pixel sizes, but now, I don't have the Cinemachine pixel perfect extension as an option for the virtual camera.

    I also don't have the Pixel Perfect Camera (Experimental) script for the Cinemachine Brain.

    I can send you this if you want, since it's still having the issue, but I'm not sure why those things are missing.
     
  12. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    4,890
    You need to make a new project using the URP template in order to get those things
     
  13. PaperMouseGames

    PaperMouseGames

    Joined:
    Jul 31, 2018
    Posts:
    255
    Thanks for this, got it. Still having the same issue so I'm going to PM you the project package :)
     
unityunity