Search Unity

WebGL lags

Discussion in 'Web' started by Nakaii, Apr 10, 2017.

  1. Nakaii

    Nakaii

    Joined:
    Jul 4, 2016
    Posts:
    23
    Hi.
    I working on my own WebGL project. I have problem with optimization. Specifically with WebGL lags. In Unity Editor i have average 75-80FPS but in WebGL only 35 - 45. Between that is very big FPS drops and player overall lagging.
    How can a game more optimized for WebGL?
    My project: https://tesing-.itch.io/test1

    Thank you.
     
  2. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    There's really only one way to know- use the profiler to see what's taking the most time and optimize that. Usually it's things like physics and large amounts of batches/setpass calls.
     
  3. yopunky

    yopunky

    Joined:
    Sep 1, 2014
    Posts:
    9
    I tried your game. Safari and Firefox get 60fps constantly. Looks to be locked at this speed. Your other counter fluctuates rapidly between 16.7 and 17.2 ms but hovers around 16.7 ms).

    Personally I have found both the profiler and the frame debugger very useful in my understanding of how the game is rendered and also finding the resource hogs.

    Note: I can't get your game to work on Chrome on my Mac at all and it throws this error: (The page at https://v6p9d9t4.ssl.hwcdn.net says:
    An error occurred running the Unity content on this page. See your browser's JavaScript console for more info. The error was: Uncaught TypeError: Cannot read property 'enumerateDevices' of undefined) - this might be an SSL error as Firefox also has a certificate violation with your server's certificate (I don't think it likes the format of your domain name (the hyphen - followed by the dot .) - I needed to override this exception in firefox to get it to work.

    This test was run on an iMac 5K (4GHz i7) running MacOS Sierra 10.12.4 & currently latest browser releases.

    Good Luck with your game.
     
  4. Nakaii

    Nakaii

    Joined:
    Jul 4, 2016
    Posts:
    23
    Thank you very much. I solved it.
     
  5. Kankuran

    Kankuran

    Joined:
    Jan 31, 2018
    Posts:
    1
    A bit late, but how did you solve it? Remember? Thanks!
     
    vovo801 and SwixDevs like this.