Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question WebGL limitations

Discussion in 'Web' started by Vagonn, Jul 12, 2023.

  1. Vagonn

    Vagonn

    Joined:
    Aug 1, 2014
    Posts:
    9
    I am building a simple URP scene (Unity 2022.3.4 LTS) with one cube in front of the camera, but I am unable to achieve a frame rate above 30 FPS on my Xiaomi Mi A2 device. Despite it not being considered low-end and having a 60 Hz screen refresh rate, I'm still experiencing limitations. It is interesting why very basic scene cannot go up above 30 FPS. Are there any approaches to achieve the goal of 60 FPS?

    Screenshot_20230712-120308 (1).png Screenshot 2023-07-12 121545.png Screenshot 2023-07-12 121609.png
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,467
    Have you tried a release build?
    Also reboot the device to ensure you start with a clean slate.
     
  3. Vagonn

    Vagonn

    Joined:
    Aug 1, 2014
    Posts:
    9
    Development build is unchecked in Build Settings. Did you mean that?
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,467
    No, Player Settings. You can build code as debug, release and master which affects code optimization levels.
     
  5. Vagonn

    Vagonn

    Joined:
    Aug 1, 2014
    Posts:
    9
    The only place with Debug and Release options was C++ Compiler Configuration in Other Settings and it is set to Release
     
  6. xeosD

    xeosD

    Joined:
    Apr 6, 2023
    Posts:
    9
    I was having a similar problem only an only slightly more complex scene - the unity starter assets first person controller demo scene. I was getting 10 fps per second on a GTX 1060. Rebooting did in fact fix it, so that's not an empty suggestion at all! It seems Unity specific as other apps/benchmarks were running at the regular speed even when unity was doing very poorly. In fact it might not be GPU related at all; I suspect the C# runtime was at fault as most of the frame time was CPU - even with zero scripts loaded.
     
    Last edited: Oct 7, 2023
  7. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    If already the empty scene with a single cube is giving performance issues in a Release build, that does suggest that there could be something off with the pixel size of the canvas. I have a couple of entry-level < 100€ Android phones lying around, and observed that those do have pretty bad per-pixel fill rate on GPUs. Testing some bare WebGL API tests showed that already running the Chrome browser was giving performance challenges with the browser compositor, already before adding in any WebGL content.

    You could try the pixel fill rate at some WebGL canvas drawing benchmark web sites, e.g. http://clb.confined.space/cards/ to see how the device performs there. That might give a clue as to what the performance could be at the limit.