Search Unity

Triple Buffer Confusion

Discussion in 'General Graphics' started by MariuszKowalczyk, Aug 21, 2017.

  1. MariuszKowalczyk

    MariuszKowalczyk

    Joined:
    Nov 29, 2011
    Posts:
    301
    Look at this article: http://www.anandtech.com/print/2794/

    According to this link, it's possible to remove tearing and have a frame rate not limited by the refresh rate of the monitor (by frame rate here I mean the Update() function being called more than 60 times per second on a 60hz monitor).

    To achieve this they suggest to use vsync off and triple buffer. At the very end of this article, they say that many developers thinks that a render queue functionality is the same as triple buffering but it's not the same and it will not let you achieve the described results.

    In Unity 3D there is this function QualitySettings.maxQueuedFrames, according to Dave Hampson from Unity (https://feedback.unity3d.com/suggestions/triple-buffering-vsync), when you set this to 2, it's the same as Triple Buffering. But, according to this post of a moderator (https://forum.unity3d.com/threads/coroutines-vs-update.67856/#post-2729515), triple buffering is not implemented in Unity and never will be implemented.

    So my questions are:
    1) Is this maxQueuedFrames = 2 the same as the Triple Buffering described in the article I have linked to on top?
    2) If not, then why is the real triple buffering not implemented and what is the difference between maxQueuedFrames and this real triple buffering?
    3) Most important question: is this possible in Unity3D to run the game logic more than 60 times per second on a 60hz monitor while avoiding tearing? I want to achieve this to reduce the input latency.

    I hope someone will be able to answer, thank you in advance!
     
    Last edited: Aug 21, 2017
  2. Alterego-Games

    Alterego-Games

    Joined:
    Jul 13, 2015
    Posts:
    354
    Thread necro, because I think its insane this information is this difficult to find:

    1) Nope, this is not the same.
    2) Your guess is as good as mine as why Unity has never implemented Triple Buffering. MaxQueuedFrames is the amount of frames that the CPU can work ahead, when the GPU is having a tough time. This will increase/decrease lag, because having more frames in the queue means that every new frame is later!
    3) No... And this is why I think Unity should definitely add support for Triple Buffering.
     
  3. MariuszKowalczyk

    MariuszKowalczyk

    Joined:
    Nov 29, 2011
    Posts:
    301
    Thank you for the answers, I was waiting for so long!
     
  4. WidmerNoel

    WidmerNoel

    Joined:
    Jun 3, 2014
    Posts:
    66
    The previous answers seem to be outdated regarding Unity's capabilities. The current state of the engine seems to be:

    "Unity uses three framebuffers for triple buffering, but if a device does not support it, it falls back to double buffering and use two framebuffers including two color buffers."

    Source: https://learn.unity.com/tutorial/optimizing-graphics-in-unity#