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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Enabling Pixel Perfect Camera Causes Flickers

Discussion in '2D' started by OguzhanBozkurt28, Sep 17, 2022.

  1. OguzhanBozkurt28

    OguzhanBozkurt28

    Joined:
    Oct 18, 2020
    Posts:
    4
    I am adding pixel perfect camera to my game. But when I enable it, moving the cursor in and out to game view causes flickers. When I disable it, same problem does not occur. Also, flickering does not happen in play mode.



    Btw, I have 2 different versions of Pixel Perfect component. I am using the first one, second one does not work properly. I don't know why there are 2 different versions of it.

    Unity version: 2022.1.14f1
    Pixel Perfect version: 5.0.1
    CineMachineVersion: 2.8.9
     

    Attached Files:

  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Something you are setting in code is fighting with what per pixel needs to do, I think, probably fov or something?
     
    OguzhanBozkurt28 likes this.
  3. OguzhanBozkurt28

    OguzhanBozkurt28

    Joined:
    Oct 18, 2020
    Posts:
    4
    Thanks for the reply. I created this scene which has only camera, cinebench and a sprite and problem still occurs.
    I created 2 different projects for 2D and 2D URP. Flickering problem occurs in 2D URP one.

    Edit: Since there is no problem in play mode(as far as I know), I can solve this problem by enabling the pixel perfect component in a script. But it is a bit annoying visual bug. :D I am open to solutions to fix this problem.
     

    Attached Files:

  4. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Sounds like an urp bug then. Not sure what cinebench is.
     
  5. OguzhanBozkurt28

    OguzhanBozkurt28

    Joined:
    Oct 18, 2020
    Posts:
    4
    Thanks for your messages! Cinebench is a camera package that has a lot of options and features for different camera scenarios.
     
  6. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,620
    You mean Cinemachine?
     
  7. OguzhanBozkurt28

    OguzhanBozkurt28

    Joined:
    Oct 18, 2020
    Posts:
    4
    Yes, I mean Cinemachine, sorry what I had thought and what I wrote is completely different. :)
    Problem can be repeated with only cinemachine 2d and camera(both pixel perfect component attached) on a 2d URP project. Even if you don't have any other objects in the scene, edges of the screen flickers.

    Unity version: 2022.1.14f1
    Pixel Perfect version: 5.0.1
    CineMachineVersion: 2.8.9
     
    MelvMay likes this.
  8. kennyy_

    kennyy_

    Unity Technologies

    Joined:
    Apr 7, 2021
    Posts:
    94
    Hi @OguzhanBozkurt28, I believe it's a bug with the Pixel Perfect Camera fighting with the editor scene's camera. Can you report the issue and attached your project so we can track it.
     
  9. flasker

    flasker

    Joined:
    Aug 5, 2022
    Posts:
    193
    disable cinemachine
     
  10. eddyrc7

    eddyrc7

    Joined:
    May 19, 2021
    Posts:
    4
    for anyone reading this still, try setting the priority in the cinemachine camera higher and that should do it.
     
  11. P_e_t_a_c_h_e_k

    P_e_t_a_c_h_e_k

    Joined:
    Dec 26, 2017
    Posts:
    25

    Good day! I faced the same error, any news on this problem? Cinemachine is perfect for my project(
     
  12. P_e_t_a_c_h_e_k

    P_e_t_a_c_h_e_k

    Joined:
    Dec 26, 2017
    Posts:
    25
    i tried different values(100, 11, 100000, -11, -1, 0 and so on) but none of it helped
     
  13. kennyy_

    kennyy_

    Unity Technologies

    Joined:
    Apr 7, 2021
    Posts:
    94
    Hi @P_e_t_a_c_h_e_k, I've submitted a fix for this issue. Which version of unity are you on? I'll update this thread when a new build is published with the fix.
     
    P_e_t_a_c_h_e_k likes this.
  14. P_e_t_a_c_h_e_k

    P_e_t_a_c_h_e_k

    Joined:
    Dec 26, 2017
    Posts:
    25
    Hi, I tried on version 2021.3.12f there was this problem, but when I updated the project to version 2022.2.1f1 this problem disappeared.
     
  15. kennyy_

    kennyy_

    Unity Technologies

    Joined:
    Apr 7, 2021
    Posts:
    94
    The fix has landed in 2021.3.17f1 and 2022.2.3f1. Let me know if you're still having the same issue.
     
  16. RafaelGaju

    RafaelGaju

    Joined:
    Apr 8, 2020
    Posts:
    3
    is there a way to install the fix in previous versions?