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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Fullscreen on Chrome sometimes only uses a small part of the screen

Discussion in 'WebGL' started by Good-old-Grim, Mar 17, 2016.

  1. Good-old-Grim

    Good-old-Grim

    Joined:
    Jan 17, 2014
    Posts:
    33
    It looks like this: http://i.imgur.com/an73DJQr.png

    Switching it off and on again will randomly give either proper fullscreen or this. Sometimes, just as randomly, the browser window is sized down to match the WebGL canvas when exiting fullscreen. This does not happen in FF, so I figure it's a Chrome bug, but maybe there's a workaround?
     
  2. alexsuvorov

    alexsuvorov

    Unity Technologies

    Joined:
    Nov 15, 2015
    Posts:
    327
    Hello Good old Grim.

    Are you able to consistently reproduce this bug in Chrome with another content like an empty project for example? Can you reproduce the bug on another PC / in other versions of Chrome?
     
  3. Good-old-Grim

    Good-old-Grim

    Joined:
    Jan 17, 2014
    Posts:
    33
    I am no longer able to reproduce the problem. In the meantime I upgraded Unity from 5.3.2 to 5.3.4, so I assume that fixed it. However, when exiting fullscreen, the Chrome window is now always sized down to match the canvas. This happens both in my real project and an empty test project, in Chrome 49.0.2623.87, as well as Canary 51.0.2682.0

    The test project is just a sprite with a boxcollider and the following code:
    Code (csharp):
    1. public class NewBehaviourScript : MonoBehaviour {
    2.    public void OnMouseDown()
    3.   {
    4.   Screen.fullScreen = !Screen.fullScreen;
    5.   }
    6. }
     
  4. illa3d

    illa3d

    Joined:
    Dec 7, 2014
    Posts:
    17
    I'm experiencing the same issue with WebGL build from Unity 5.3.5f1 only in Chrome browser (Version 51.0.2704.63 m). Firefox and Edge works as it's supposed.
    I'm switching the fullscreen mode with the above code too.

    Anyone have any clue?
     
  5. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    223
    Can report similar issue here as well.
     
  6. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Does anyone have a reproducible case for this they could send us in a bug report?
     
  7. MvD

    MvD

    Joined:
    Oct 26, 2010
    Posts:
    13
    Same problem here with Chrome. However, it only happens for me when I use a WebGL template that makes the canvas scale with the browser size. When I use one of the two default templates, fullscreen works fine.

    I have created a small test project that includes the template made by Virtual Playground (http://virtualplayground.d2.pl/?p=959). If you build with this template, the fullscreen canvas in Chrome will be the same width as the windowed canvas. And if you build with one of the two standard templates, fullscreen works fine. Left mouse button toggles fullscreen mode. Right mouse button sets resolution to the monitor resolution. Interesting: if you are in windowed mode and you first click the right mouse button and then the left button, the canvas will span the entire screen.
     

    Attached Files:

  8. MvD

    MvD

    Joined:
    Oct 26, 2010
    Posts:
    13
    Also, the problem is the same whether I use the Screen.fullScreen = !screen.Fullscreen method on mouse down or create a small Javascript plugin that calls SetFullscreen(0 and SetFullscreen(1)
     
  9. therealao

    therealao

    Joined:
    Feb 13, 2017
    Posts:
    5
    Also having this problem with chrome 56 and unity 5.5.0f3 Any help would be much appreciated.
     
  10. ypoeymirou

    ypoeymirou

    Joined:
    Jul 31, 2015
    Posts:
    54
    Same here (Chrome 56 and 5.5.0p1)

    The canvas size in full screen is not updated to the new resolution I set. It renders correctly only a portion of the screen (corresponding to the default resolution of the plugin), the rest is visual garbage...

    Regular: http://imgur.com/4gJtLFS
    Fullscreen: http://imgur.com/A05hfNq (the bug)
     
  11. ypoeymirou

    ypoeymirou

    Joined:
    Jul 31, 2015
    Posts:
    54
    Bug reported: Case 883144

    Thanks
     
  12. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
  13. cgmagic

    cgmagic

    Joined:
    Oct 5, 2013
    Posts:
    12
    Just let you know, I have just experienced the same issue here. Unity version 5.5.0F3 tested on Firebox.
     
  14. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    If you have a simple repro, it would be great if you could submit a bug report (we already have one but a smaller project would be better)
     
  15. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    331
    I hope I'm not making this even more confusing, but we used to have the problem noted in the original post going all the way back to the initial Unity 5 release. I'm not sure if that bug is still the same fullscreen bug being reported now, but the original problem iirc was actually in the .css file. It was a timing issue. The width and height are set to 100%, but for some reason those pixel values are sometimes not updated in time. The width and height would then get set to wrong (old?) pixel values. The fix for us was setting the width and height values in the .css file to explicit pixel values every time the canvas size changed (including fullscreen) instead of just setting them to 100%.

    But perhaps a different bug. Apologies in advanced if this has made things more confusing!
     
  16. ypoeymirou

    ypoeymirou

    Joined:
    Jul 31, 2015
    Posts:
    54
    Hi,

    (POTENTIAL SOLUTION FOR YOU BELOW)

    By discussing the issue with Unity, in my case the issue was caused by the fact that I had one camera in Defered rendering path (the one rendering my asset in my showroom) and another camera with Forward rendering path (for the background of my showroom).

    By setting both to Froward, the issue disappears. This is still an issue for me, but it could be a valid workaround for you until Unity fixes it.

    Yvan
     
  17. Lumen-Digital

    Lumen-Digital

    Joined:
    Aug 3, 2012
    Posts:
    16
    Hi Marco
    I have the same issue that was resolved by disabling anti aliasing in the quality settings.