Search Unity

Question WebGL low fps URP

Discussion in 'Web' started by Sopqos, Nov 25, 2023.

  1. Sopqos

    Sopqos

    Joined:
    Apr 29, 2016
    Posts:
    3
    I have this game that runs fine on the editor, but has very low fps on the build version in any browser (chrome, firefox, edge). A scene with 150 fps in the editor corresponds to around 40 in the build.

    In my debugging quest, I disabled everything in the scene with the exception of the camera gameobject (and component). Even then, the fps fluctuates around 120-140.

    I also have hardware acceleration enabled.

    I've tried the performant, balance and high pipelines. Not that it should matter if its only rendering the skybox but still...

    Is this normal?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,892
    WebGL is generally the most restricted platform, it‘s even less capable than most mobile devices even though it runs on a desktop computer.

    But it‘s hard to say anything about your case, we don’t know anything about your project or hardware specs.

    Note that build options and player/quality settings make a great difference.
     
    De-Panther likes this.
  3. Sopqos

    Sopqos

    Joined:
    Apr 29, 2016
    Posts:
    3
    1070ti, ryzen 5 3600, 32GB ram. On a 2080, the fps almost double.

    I've experimented with the quality settings and it didn't change much, player settings are the default ones and, on the build options, I've tried optimize code for runtime speed instead of the build size.

    I've tried a new project, and the issue is the same, build version is around 100-120 fps in a scene with nothing but a basic camera and skybox, while the editor version (both in WebGL) is around 500.
     
    Last edited: Nov 26, 2023
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,892
    Try building a starter kit, anything with more content in it. Empty scene performance doesn‘t matter. It may be artificially slowed down to prevent waste of energy etc. I pushed one of Synty‘s demo scene to webgl with full postprocessing in URP and got steady 60 fps in Chrome (but only 35 in Firefox) with a 1070.
     
  5. Sopqos

    Sopqos

    Joined:
    Apr 29, 2016
    Posts:
    3
    Thanks for your help. My game runs smoothly now in the browsers I've tested, but only because I took a more aggressive approach to optimization. My problem is/was more regarding the inefficiency of the webgl build/browser capability of running it. Caught me by surprise that the build version, that always has higher fps than the editor (in the case of OS builds), ended up having a fraction of fps. But from what I've seen from others, this is apparently normal.