Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Sudden fps decrease when toggling full screen in WebGL

Discussion in 'WebGL' started by ammar_12435, Jul 30, 2019.

  1. ammar_12435

    ammar_12435

    Joined:
    Jun 28, 2018
    Posts:
    24
    Hi!

    So I am experiencing a significant fps drop in my game whenever I toggle in FullScreen mode. In normal screen mode the fps is fine.

    To verify this I created an empty scene ( just one cube) and run the build on a chromebook (dual core 1.6ghz, 4gb ram).

    When full screen is off, I get 60fps, and when full screen toggle is on, I get around 30-40fps. This is a massive difference.

    Any help?
    Thanks in advance!
     
  2. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,068
    Chromebook is currently not a platform we support.

    But are you getting the 60fps when running in non-fullscreen but with the max screen resolution?
     
  3. ammar_12435

    ammar_12435

    Joined:
    Jun 28, 2018
    Posts:
    24
    What exactly do you mean by Chromebook not being supported. What issues could arise if my game is played on Chromebooks instead of windows/mac browsers?

    This is for the empty scene test:

    WebGL build resolution : 1280 * 768
    Non-fullscreen (Max Resolution) : 60 fps
    Full-Screen : 30-40 fps
     
  4. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,068
    As per our manual https://docs.unity3d.com/Manual/webgl-gettingstarted.html we only support major browsers on desktops.
    That said it does seem odd that you get different FPS for the same resolution. If you can reproduce this on a desktop Chrome browser then please do send in a bug report.
     
  5. ammar_12435

    ammar_12435

    Joined:
    Jun 28, 2018
    Posts:
    24
    I was able to reproduce it on a windows laptop machine:

    i7 / NVIDIA GeForce GT 650M
    WebGL build resolution : 1280 * 768
    Non-fullscreen: 60 fps
    Full-Screen : 30-40 fps

    Does this count for a bug report or does it have to be specifically to on desktop?
     
  6. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,068
    If you get the same behaviour on desktop that'd be a bug indeed.

    But just to be sure: You are getting the 60FPS when running in non-fullscreen mode at (almost) fullscreen screen resolutio?
     
  7. ammar_12435

    ammar_12435

    Joined:
    Jun 28, 2018
    Posts:
    24
    The desktops I can currently get my hands on all have i7/Nvidia Gtx 1060 or above and are giving 60 fps in both full-screen and non full-screen.

    I ran it on another windows laptop machine (so now there's three laptops with same issue):

    i7 / NVIDIA GeForce 820M
    WebGL build resolution : 1280 * 768
    Non-fullscreen: 45-50 fps
    Full-Screen : 20-30 fps

    So the scenario is that I am getting nice fps on non-fullscreen mode at (almost) full-screen screen resolution and the fps rapidly drop when I go full screen, if thats what you were asking.

    I am attaching the screen shots as well.

    Fullscreen:

    fullscreenFPS.png

    Non full screen:
    nonFullscreenFPS.png
     
  8. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,068
    By the looks of it this drop is to be expected. The GPU has to update way less canvas pixels in the lower pictured version since the white space around the canvas makes a considerable amount of screen space.

    Try increasing the canvas size in the template to cover the whole page and measure again.
     
    ROBYER1 likes this.
  9. ammar_12435

    ammar_12435

    Joined:
    Jun 28, 2018
    Posts:
    24
    I think I have found the issue. The tabs in which the game was running were zoomed out (in chrome) which caused the fps to drop in full screen.

    So I used the same build (resolution 1280 * 768) and simply zoomed out and tested the fps:

    Chromebook resolution (1366 * 768)

    - Chrome Zoom 100% (Non-fullscreen 60fps | Fullscreen 55fps)
    - Chrome Zoom 90% (Non-fullscreen 60fps | Fullscreen 38fps)
    - Chrome Zoom 80% (Non-fullscreen 60fps | Fullscreen 28fps)
    - Chrome Zoom 75% (Non-fullscreen 60fps | Fullscreen 24fps)
    - Chrome Zoom 67% (Non-fullscreen 60fps | Fullscreen 20fps)
    - Chrome Zoom 50% (Non-fullscreen 60fps | Fullscreen 12fps)
    - Chrome Zoom 33% (Non-fullscreen 60fps | Fullscreen 7fps)
    - Chrome Zoom 25% (Non-fullscreen 60fps | Fullsceen Cant see fps since the scene is rendered as if zoomed in)

    It seems each time we zoom out and toggle full screen, Unity also renders the newly added pixels (white pixels ).
     
  10. ammar_12435

    ammar_12435

    Joined:
    Jun 28, 2018
    Posts:
    24
    Uhm, I am not sure is this supposed to be this way? No matter what the zoom ratio is, in full screen the number of pixels rendered by the gpu should be same ( i.e native device resolution). So why do full-screen fps depend on the zoom percentage?

    Thanks