Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

UI Canvas bugs on non-native resolution?

Discussion in '5.3 Beta' started by Zuntatos, Nov 3, 2015.

  1. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    612
    My interface scaled nicely in 5.2 (since the dx9 canvas-breaking-fix and dx11 letterbox fix), but in 5.3.0b5 If I change the resolution to something below native shifts both the visual part of the interface to the right some amount, and the 'physics' part of the ui that's raycasted etc seems to also shift upwards.

    Anyone else stumbled across this? If there's some confirmation or desire I'll try to make a demo scene of it.

    Edit: Forgot to mention: it seems to work fine in the editor, only the build shows this. Dx9 / dx11 / glcore all seem to show it
     
    Last edited: Nov 3, 2015
    movra likes this.
  2. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Could you file a bug on it i havn't heard of this before.
     
  3. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    612
    Filed a bug report, named "Canvas elements at wrong location at non-native resolution". I'm not sure if it has come through; the bug reporter froze after the progress bar of sending it completed and disappeared. I'll post link if I receive it.

    Edit: If not, I'll try again in an hour or so.
     
  4. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    612
    Well. My bug reporting tool seems broken. But it's simple enough to replicate. An empty scene with a single button centered to the middle is all that's needed. In the editor, the button will correctly stay in the middle with switching resolutions. In the player, the button will shift to the right or even out of screen at a low enough resolution. The selection box gets some additional translation upwards.

    Obviously this behaviour wasn't in 5.2.

    Some example pics I uploaded here: http://imgur.com/a/UriWg




    Sadly enough my mouse isn't visible on them, but at the first it's on the object, the 2nd it's about 100 px above it and the third about 200 or so.
     
  5. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
    So it's back. With a vengeance.

    If you have a Windows standalone build and set the full screen resolution to a non-native resolution, through the resolution dialog or through Screen.SetResolution() in-game, the UI will be contorted and the hit detection will be off.

    On a positive note the "Default is native resolution" defaulting to 1024x768 bug, seems to be partially resolved in that when you disable the resolution dialog and enable "Default is Full Screen", the build will actually run in the native desktop resolution correctly.

    So the workaround at the moment is to disallow changing to non-native resolutions when the game is in full screen mode.
     
  6. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    612
    @movra I believe it's a different bug. That bug was either the dx9 one, where the canvas simply stopped rendering, or the dx11 one, that messed up all rendering. This time around, the rendering itself seems all fine; it's only the canvas rendering that's having a bit of a brain fart. Oh, and it appears to be there on dx9/dx11 and opengl as well.
     
  7. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
    @Zuntatos With the linked thread I'm referring to the issue where QA consistently misses obvious resolution problems with Windows standalone builds. And this has been going on since at least June!
     
  8. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    612
    @movra Ah, that's very true. I suppose they do not have unit tests involving resolution changes.
     
  9. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
    I'm not sure if you can unit test these kind of UI problems, but you could at least have an automated test that checks if the standalone player matches a reference image, and repeat that test for several resolutions.

    Actually the bare minimum would be to have an intern manually build and run an otherwise empty default project with just one button and one cube in it.

    I expected better after this:

     
    Last edited: Nov 3, 2015
  10. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    612
    @movra Update on the bug report; got reproduced by QA and sent to devs
     
    movra likes this.
  11. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    612
    Small update; with 2 screens, main 1920x1080 and secondary 1680x1050, playing on the 1080p screen seems to make the canvas bug appear on any resolution except 1680x1050.
     
  12. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    612
    Bump for attention as it's quite a nasty blocking bug. No progress afaik, changelog doesn't list it as fixed nor as known issue.
     
  13. Alex-Lian

    Alex-Lian

    Guest

    Only recently investigated, and likely due to multi-display support. Fix being vetted and working on getting inbound. Will likely disable the mix of multi-display and UI for the time being.
     
    movra and Zuntatos like this.