Search Unity

WebGL on Retina

Discussion in 'WebGL' started by fastgamedev, Jul 12, 2018.

  1. fastgamedev

    fastgamedev

    Joined:
    Mar 27, 2014
    Posts:
    91
    Any update on getting WebGL builds to use full resolution on Retina screens? I remember asking that question back in 5.6 days, and the answer was not until the Editor supports Retina. The Editor now does support Retina, so can we please get this feature?
     
  2. fastgamedev

    fastgamedev

    Joined:
    Mar 27, 2014
    Posts:
    91
  3. tmars

    tmars

    Joined:
    Jul 26, 2013
    Posts:
    9
    +1 for this
     
  4. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,653
    @tmars @fastgamedev I think we still don't have a bug report for this. Would you mind submitting one with a description of the problem, repro steps and a repro project?
     
  5. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    331
    I can make a proper repo case tomorrow, but in the meantime just go to any Unity webgl content on a high dpi monitor (or more accurately when devicePixelRatio is greater than 1). The content will be rendered at [screen resolution] / devicePixelRatio and then the browser will scale the result up (naively) by devicePixelRatio.
     
  6. fastgamedev

    fastgamedev

    Joined:
    Mar 27, 2014
    Posts:
    91
    Can you please post the bug report # here, so I can comment on it too.
     
  7. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    331
    Sorry for the delay, totally forgot I said I would do this! At any rate here is the bug report (https://fogbugz.unity3d.com/default.asp?1079788_da7gn57s8im0lsa9) and the two images I attached to it. You can clearly see the "T" is being upscaled on the high DPI monitor whereas it's "correct" on a "normal DPI" monitor.

    High DPI:

    HighDPI_T.png

    Low DPI:

    LowDPI_T.png
     
  8. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,653
  9. ortin

    ortin

    Joined:
    Jan 13, 2013
    Posts:
    221
  10. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    305
    I noticed this article https://support.unity3d.com/hc/en-u...WebGL-looks-wrong-on-High-resolutions-Retina-

    The issues with the solutions in this article:
    1. If we check Screen.width/height in Unity, it still uses the value without window.devicePixelRatio.
    2. If the parent style controls the canvas size(width:100%), if the window size changed, we need to set the canvas size again, as it updated to use the size from it's parent.

    Is there a way to control Unity's Screen.width/height values instead?

    Thanks
     
  11. jedicam

    jedicam

    Joined:
    Jul 11, 2017
    Posts:
    1
    De-Panther likes this.
  12. TheRoccoB

    TheRoccoB

    Joined:
    Jun 29, 2017
    Posts:
    53
    Yes @jedicam that seems to be the way.

    I purchased the asset, and it looks like they do some fancy find and replace that changes the devicePixelRatio in a few places, but would be really nice to have this built in :).
     
  13. Yaeker

    Yaeker

    Joined:
    Nov 20, 2017
    Posts:
    2
    On Unity 2019.1.3 the problem persists. Are there any news on a potencial fix soon?
     
    arumiat likes this.
  14. arisdev82

    arisdev82

    Joined:
    Feb 27, 2019
    Posts:
    23
    It would be nice to get a fix over this.
     
    arumiat likes this.
  15. Yaeker

    Yaeker

    Joined:
    Nov 20, 2017
    Posts:
    2
    Hello,

    Sorry to bump this thread again, but in the release notes of the current alpha and beta versions I don't see a fix for the retina display, even though the bug report has been accepted. Can we expect this anytime soon, or it is not a priority?

    Kind regards
     
    arumiat likes this.
  16. tomhog

    tomhog

    Joined:
    Dec 22, 2012
    Posts:
    36
    Hi

    I provided an asset store plugin that fixes this problem.

    WebGL Retina Tools.
    http://u3d.as/CjZ

    A free lite version which only fixes debug builds available here.

    WebGL Retina Tools Lite
    http://u3d.as/Cpw

    It supports Unity 5.6 up to 2019.1, has support for Name files as Hashes, GZip compressed builds, removing
    the warning dialogs on mobile and a few other features.

    Shameless plug over ha
    Tom
     
  17. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    164
    It's fixed in 2019.3 beta.
     
    arumiat, kelceyp and De-Panther like this.
  18. PushoN

    PushoN

    Joined:
    Jul 5, 2012
    Posts:
    13
    How do you know this?
     
  19. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    164
    Patch notes and tested myself
     
    arumiat likes this.
  20. praleks0000

    praleks0000

    Joined:
    Jan 4, 2013
    Posts:
    4
    De-Panther and jukka_j like this.
  21. JeanLuc

    JeanLuc

    Joined:
    Aug 6, 2012
    Posts:
    8
    arumiat likes this.
unityunity