Search Unity

Understanding WebGL FPS in browsers

Discussion in 'Editor & General Support' started by DrJBN, May 16, 2022.

  1. DrJBN

    DrJBN

    Joined:
    Sep 28, 2014
    Posts:
    49
    Can someone elaborate on a WebGL game's use of vsync for me?

    If you create a blank project with a counter in the Update, with vsync off, and run it on your computer it will be well above 60 (400's on my computer).

    Run the same game in a browser, it locks to 60. I assume that is because the browser is locking the framerate. But, it seems to also be locking the entire loop to the framerate- that is, it is not as if the game is running and filling buffers and then the browser grabs what in the buffer and updates the screen when vsync is ready. The whole game waits.

    In my online research I record the users' framerates in the WebGL version and out of every 100 people I get a couple with framerates in the 100s and 200s, so I suppose the locking of frame rates is browser specific and not necessarily an idiosyncratic part of the webGL build?

    Anyway, my question is, is there a way around this- if there is some procedure you want continually updating as often as it can is there a way to make that procedure run independently of the vysnc, while the presentation is vsynced?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,697