Search Unity

Shuttering in standalone window with Target fps set

Discussion in 'Editor & General Support' started by jedeo1994, Mar 22, 2019.

  1. jedeo1994

    jedeo1994

    Joined:
    Sep 24, 2012
    Posts:
    12
    Hey everyone,
    So this is a particular problem that has annoyed me for quite a while. I've been thinking about it lately and thought I'd see what other Unity people are thinking.

    The Problem
    The problem is that in a standalone Windows build (Pretty sure it happens on Mac too, haven't tested very much) if you are in any form of "windowed" mode and your game frame rate and monitor refresh rate are out of sync, you get a very annoying shutter.

    As an example, if I set Unity's target frame rate to 60 and then play on a monitor at 60hz in a window with VSync off, it would shutter as I move the camera back and forth.

    Happens in windowed mode and in fullscreen windowed mode.
    If you are in exclusive fullscreen, the screen just tears.

    What I know
    What I've been able to find is that the OS is probably to blame for the shuttering. I guess Window's DWM compositor is in charge of content that is in a window. Because of that it shutters when there is a difference between the frame rate and refresh rate instead of tearing the screen.

    For normal windows content, shuttering instead of tearing is probably preferred. But in a game with fast moving content it's very jarring.

    I'm currently on 2017.4. I've also tried it on 2018.3 and it does the same thing.

    Options
    Have VSync locked on? This could be good but some people don't care for VSync. Also if someone has a very high refresh rate monitor it might be annoying to have it on.

    Cap the frame rate high enough(200 fps as an example) so that any difference in the rates wouldn't be as noticeable? The problem is that maintaining a high fps could only be achieved on pretty descent systems.

    Test build
    Here's a Dropbox with a build demonstrating. Cap the frame rate and use the left and right arrow keys to move back and forth.

    https://www.dropbox.com/s/vcq1pv62ts743zn/CamShutterTesting.zip?dl=0


    If you have any ideas or I'm an idiot and missing something let me know :)

    Thanks for your time!