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

Webplayer wrong aspect ratio when in fullscreen

Discussion in 'Editor & General Support' started by uforoboso, May 29, 2014.

  1. uforoboso

    uforoboso

    Joined:
    Dec 11, 2013
    Posts:
    14
    Hello,

    I am experimenting my first builds. I noticed that when switching my webplayer builds to fullscreen, the scene is viewed in a 4:3 ratio screen size (and at very low resolution) instead of 16:9 and high resolution.

    My build was made both in the standard settings (960x600) and in a custom resolution - that I setted up in webplayer build settings - of 1920x1080.

    When I enter fullscreen (also in the 1920x1080 version) the scene is viewed in 4:3 and with a very low resolution, very much like 960x600 but enlarged on a 27" screen, so with black bars on the sides.

    I have read - by googleing - that I should setup the standalone resolution, but when I go to the standalone settings, there are no settings options there for width/height, only checkboxes for other options.

    I am sure the fullscreen in high res and 16:9 can be done, as I just watched a build made at 1280x720, which can be viewed in fullscreen very well and with correct aspect ratio.

    What am I missing? (I have Unity standard, not Pro)

    Thanks!!
     
  2. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    http://docs.unity3d.com/Manual/class-PlayerSettings.html

    Publishing a web player

    Default Web Screen Width and Default Web Screen Height determine the size used in the html file. You can modify the size in the html file later.

    Default Screen Width and Default Screen Height are used by the Web Player when entering fullscreen mode through the context menu in the Web Player at runtime.
     
  3. uforoboso

    uforoboso

    Joined:
    Dec 11, 2013
    Posts:
    14
    Thanks! But that is exactly what I am doing, when I tried building with 1920x1080. The size in html changes, so I see the player bigger in the browser.

    Then, when I switch to fullscreen, the aspect ratio is always the same: 4:3 and low resolution.

    I also tried to set Default width and height to 9999 x 9999 (as suggested in some other page) but nothing changes.

    I am on a Mac with 2560x1440 resolution, I will try now to export with that size, but - if it works - what will happen to users with different resolutions?
     
    Last edited: May 30, 2014
  4. uforoboso

    uforoboso

    Joined:
    Dec 11, 2013
    Posts:
    14
    Ok, so I tried 2560x1440. The webpage adapts accordingly, as expected. When I run fullscreen, the always identical 4:3 aspect ratio appears, with side black bars and low resolution. This result never changes for any of the settings I tried: 1920x1080, 9999x9999, 2560x1440, plus the default one. The fullscreen ALWAYS turns to be that low-res 4:3 aspect ratio with black bars on the sides........

    (I would take screenshots but unfortunately I can't find a way to do it when in webplayer fullscreen)

    And I can't setup default width/height for standalone (as suggested here: http://answers.unity3d.com/questions/328637/when-switching-to-full-screen-on-web-player-i-get-1.html) because those settings are not present in the standalone tab for the settings, even if they are actually listed as properties in the page linked above (http://docs.unity3d.com/Manual/class-PlayerSettings.html). The page itself is confusing, as there is a screenshot where the properties are NOT existent (exactly as it appears in Unity) while the properties are listed in the underneath table (and as suggested in the solution page above).

    Can it be possible that a previous version of Unity was doing all this much better, and the actual version is messed up??? The webplayer fullscreen option really doesn't seem to get the default height/width.

    This statement indeed is NOT representing the reality I am experiencing:

     

    Attached Files:

    Last edited: May 30, 2014
  5. uforoboso

    uforoboso

    Joined:
    Dec 11, 2013
    Posts:
    14
    No one has a solution? I actually found a lot of other threads on the same issue, all without any final solution. It seems Mac is the problem.

    Still, I tried to open the players on a PC browser and the issue is still there.

    I contacted the creator of that webplayer that works, and he just redirected me to the same build settings, meaning he is just using that and it works there.

    Why is this working for many, but is an issue for many others? (and there are no official statements about this? some of the threads are years old)
     
  6. uforoboso

    uforoboso

    Joined:
    Dec 11, 2013
    Posts:
    14
    bump... ?
     
  7. Bllly

    Bllly

    Joined:
    Sep 23, 2014
    Posts:
    5
    Hey @uforoboso , do you still have this error? Perhaps you can try these settings, they worked for me.
     

    Attached Files:

  8. uforoboso

    uforoboso

    Joined:
    Dec 11, 2013
    Posts:
    14
    thanks! I will try.. I actually didn't proceed with webplayers after that issue
     
  9. uforoboso

    uforoboso

    Joined:
    Dec 11, 2013
    Posts:
    14
    It works!! Thanks a lot Billy! :)
     
  10. Bllly

    Bllly

    Joined:
    Sep 23, 2014
    Posts:
    5
    No problem! Happy Coding!
     
  11. ArnoC

    ArnoC

    Joined:
    Sep 7, 2013
    Posts:
    10
    All of those tricks don't work for me in Unity 5.0.1 ....

    But I have a very simple solution that works: use Direct3D 9 instead of 11 => boom, it works! (at least for me)
    And I have no glitches with D3D9, whereas with D3D11 my windows are a bit messed up once I leave fullscreen mode in my web player game.

    It's true though that the desktop resolution settings corresponds (roughly) to the web player fullscreen resolution setting, but only with D3D9.
     
    Last edited: Apr 22, 2015
  12. Zorranco

    Zorranco

    Joined:
    Jul 15, 2014
    Posts:
    23
    You are right Arno, I updated to 5.0.2.f1 and it started to stretch while in full screen window (it used not to do it before). However, if you un-select DX11 from player preferences, window maintains it's 1:1 proportion again
     
  13. StealThePixels

    StealThePixels

    Joined:
    Apr 2, 2015
    Posts:
    68
    Excuse me can you tell me where can i un-select DX11 and select DX9 for my builds?
    This is what i see from the player settings and there's no way to do it



    Thanks
     
    Last edited: Sep 6, 2015
  14. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,136
    I don't understand the webplayer to fullscreen behaviour either. In 5.1.1 my Standalone settings are "Default is Native Resolution", I have defined 1024x768 for webplayer. It runs fine in the browser but after right-click fullscreen it appears to be the same 1024x768 stretched across my widescreen monitor.

    I just want it to choose the native resolution when going fullscreen - trying the hack above to set standalone to a very high resolution just locks firefox on switching fullscreen.