Search Unity

Bug MacOs Ventura flickering black on Game View when enable Vsync

Discussion in 'macOS' started by thanghp456, Dec 16, 2022.

  1. thanghp456

    thanghp456

    Joined:
    Feb 12, 2017
    Posts:
    4
    Hi everyone, I used 2021.3.1 and 2021.3.16 it happen this.
     
  2. toddmakesgames

    toddmakesgames

    Joined:
    Dec 5, 2018
    Posts:
    6
    This vsync issue seems to only happen when I have ProMotion turned on, when I set the refresh rate down to 60hz or connect to an external display, I don't have the tearing/flickering issue.

    macOS Ventura 13.1, Unity 2021.3.16f1
    Macbook Pro 16", M1 Max
     
  3. Gillissie

    Gillissie

    Joined:
    May 16, 2011
    Posts:
    305
    Did you report this as a bug?
     
  4. BACALL

    BACALL

    Joined:
    Feb 21, 2017
    Posts:
    87
    Last edited: Mar 7, 2023
  5. CaptainPMM

    CaptainPMM

    Joined:
    Aug 11, 2020
    Posts:
    1
    If you dont want to change your display settings...
    I hereby present to you a kinda random fix I came up with while fiddling around with this issue:

    Code (CSharp):
    1.  
    2. #if UNITY_EDITOR_OSX
    3.  
    4. using UnityEngine;
    5.  
    6. namespace Utils {
    7.     public static class MacVSyncFix {
    8.         [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
    9.         public static void Fix() {
    10.             QualitySettings.vSyncCount = 2; // Change from default 1 to 2 did the trick
    11.         }
    12.     }
    13. }
    14.  
    15. #endif
    16.  
    Just create a file somewhere in the Assets folder and you can now use the Game View's VSync again.
    In the builds I did not have any problems.
     
  6. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,086
    This is locking the frame rate to half the screen's refresh rate. Not really a fix, more like a crippling to get back to 60Hz when running in ProMotion's 120Hz.
     
  7. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    Any updates on the internal status of this one @Tautvydas-Zilys?

    edit: just wanted to add that whilst I do feel like the Mac version of Unity is really struggling along as of late, I do *really* appreciate the hard work you're putting in keeping us all in the loop. So thanks for that @Tautvydas-Zilys!
     
    Last edited: Apr 28, 2023
    Unifikation likes this.
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    I'll ask the team responsible for that area.
     
    adslitw likes this.
  9. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    Hey @Tautvydas-Zilys, any updates from the team? Or is there someone active on the forum I can ask? Thanks!
     
    Unifikation likes this.
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Sorry, this fell of my radar a bit. As far as I can tell it's assigned to the appropriate engineering team and it's in their backlog. Unfortunately they couldn't give me any particular timelines.
     
    adslitw likes this.
  11. cystedtwister

    cystedtwister

    Joined:
    Mar 3, 2022
    Posts:
    1
    This is bad. Bad.
     
    BACALL and Unifikation like this.
  12. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    BACALL and Unifikation like this.
  13. BACALL

    BACALL

    Joined:
    Feb 21, 2017
    Posts:
    87
    @Tautvydas-Zilys I understand that you guys have a lot of work to do, but could you please explain why it’s taking so long to fix the flickering bug? The flickering is not only annoying, but it also makes ProMotion unusable on MacBooks. It’s been like this for over six months now :/ I either have to plug the laptop into an external monitor or configure the Display settings every time I work in Unity. I’m confused why this isn’t a priority for you. I don’t mean to sound rude, and I apologize if I do...
     
    adslitw and Unifikation like this.
  14. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,086
    And if you're using a black background, it's also hard to see why your game keeps jarring itself all over the place. Thanks to this thread, I found an indication of the symptom, even if we don't yet know the cause.

    There's something wrong with the depth buffer, would be my guess, on Unity for Macs with Apple Silicon.

    @Tautvydas-Zilys can we at least get some indication that your teams have figured out why and what, and how you'll fix... and when?
     
    BACALL likes this.
  15. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
  16. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,716
    If there is a workaround, and it seems there is, use the workaround and move on, don't expect timely bug fixes from Unity, their turnaround times are 6+ months on average, and a mac only non computer exploding issue is of below average priority.
     
    Unifikation likes this.
  17. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    Eh, I disagree. The workaround is either to halve the framerate of my screen which doesn't help when I'm making sure things are framerate independent, or disable vsync (which is what I do) but it eats battery. So either way Unity runs like crap on AS Macs. I pay a lot of money to Unity, I think I'm well within my rights to be politely chasing up on a bug that's been annoying me for months.
     
    BACALL likes this.
  18. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,716
    You are totally within your rights, I just think it's wasted effort. You cannot depend on Unity delivering fixes in a timely manner so don't depend on that. Unity has always (at least the last 5-6 years) had a ton of issues on Macs and with Silicon the issues have exploded.

    For example, here is a video of me having tons of fun making Unity freeze when trying to maximize / minimize the game view by double clicking the top bar:


    I battled with QA for a bit, but then I somehow found out that adding command line arguments to disable editor multithreading stops the freezing, so I just did that and moved on. After also having to disable multithreaded rendering on my builds on all platforms to stop our games from crashing, I think it's more productive for me to consider Unity a single threaded editor and renderer and act accordingly than to actually fight with QA.
     
    Last edited: Jun 30, 2023
  19. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,086
    These problems are MUCH worse when trying to screen record video of gameplay via Quicktime or similar. Shockingly bad. Something needs to be done about Unity's general disregard for Apple Macs given their new claim to being THE engine for VisionOS.

    No idea who to nudge to make this concern into action at Unity's end. Do knows some folks at Apple that might be pissed to discover this kind of goings on and am sending this thread their way.

    @Unity, please do better for Mac and (therefore) VisionOS, iOS and iPads. This kind of lag on meaningful responses and fixes to significant and fundamental and obvious flaws is deeply troubling for a market that Unity has pretty much to themselves.
     
    BACALL likes this.
  20. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    I was told they are actively working on fixing this.
     
  21. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    Just checked in on this - looks like a fix might finally be landing soon!
     
    BACALL likes this.
  22. Propagant

    Propagant

    Joined:
    Nov 18, 2013
    Posts:
    38
    Any updates on this? Even when I set the VSync to every second V Blank the flickering still occurs...
     
    Unifikation likes this.
  23. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,086
    Has it been done yet?
     
  24. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Yes, the fix landed to 2021.3.31f1 and 2022.3.10f1 (as per the issue tracker link above). Are you still reproducing it?
     
    Propagant likes this.
  25. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,086
    It still happens when recording screen video with quicktime and other video capturing software.

    No, you don't need a bug report. You need to try record video at 120fps (Pro Motion) of a game being played.

    And at 60fps, too.
     
  26. Propagant

    Propagant

    Joined:
    Nov 18, 2013
    Posts:
    38
    The issue just disappeared once I updated my Macbook Pro M1 to Sonoma OS. Also VSync with locked framerate works well now... I guess things just happen randomly o_O

    Edit: Also I'm using Unity 2022.3.10f1 (Same version before the OS update). So I guess the solution is to keep up to date with the OS on mac!
     
  27. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,086
    Nonsense.

    It's got nothing to do with the MacOS version.
     
  28. BACALL

    BACALL

    Joined:
    Feb 21, 2017
    Posts:
    87
    I don't know if it's only me but I definitely felt issues when I upgraded to macOS Ventura a year ago, that's when all the graphical issues started (V-Sync, Flickering, Lower FPS etc). Sonoma definitely feels better, maybe Apple did something with Metal 3, who knows...
     
    Propagant likes this.
  29. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,086
    No. You've gotten used to the flickering etc.

    I had someone come over to do some gameplay testing the other day, and he immediately asked "what's with all the flickering..."
     
  30. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    The issue 100% started with Ventura - I had no problems one day, updated to Ventura (changing nothing else) and the issue began. So it's not the biggest stretch to believe Sonoma might have changed something back.

    Personally I've had no problems since 2022.3.10f1, but I'm not updating OS version unless I have to, I don't want another year of issues!
     
    Propagant likes this.
  31. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,086
    This is on Unity, one way or the other. No other apps have these issues. One of the most important jobs of a game engine is to cycle from one frame to the next. Etc.
     
  32. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    Well, you're moving the goalposts a bit. However Rider did also have problems, so you're still not quite right. However I do agree that Unity have been incredibly slow to fix the issue.
     
  33. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,086
    Those were Rider versions running under Rosetta, from my experience. Not the native versions.