Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Update to Unity 5.1 = too bright GUI

Discussion in 'Extensions & OnGUI' started by manutoo, Jun 11, 2015.

  1. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    265
    Hello,

    I just updated from Unity 5.0.1 to 5.1.0f3 and the whole GUI got way too bright !
    Whether using GUI.Box() or GUI.DrawTexture() the result is too bright. For the texture, it seems that removing the "Bypass sRGB sample" on importation (available when selecting "Advanced" texture type) fixes the issue.

    I'm using Deferred Legacy rendering, and Linear color space.

    All my GUI textures normally use "Legacy GUI" for texture type.

    Anyone else got this issue ?
     
    Last edited: Jun 11, 2015
  2. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    265
    Switching to gamma color space "fixes" the issue...
    I tried with another project, much simpler than my current project, with the same effect on texture.

    My GUI.Box() fails because it uses a texture, but it seems that everything that doesn't use a texture is correctly displayed (GUI.Button(), etc.) .

    Am I supposed to change type & then uncheck "Bypass sRGB sample" on all my GUI textures ? o_O
     
  3. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    265
    I filled a bug report => #703980 .
     
  4. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,038
    Kind of interesting. The same thing happens with NGUI if you try to use Linear color space. Not just in 5.1, but 5.0.x as well.
     
  5. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    265
    Bug is still present in 5.1.0p1 (released yesterday).
     
  6. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    600
    Same issue here, just wanted to make a report too.
    Can you share the link to the report? I can't find a way to search for IDs.

    Version is 5.1.0f3
     
  7. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    265
    Glad to know I'm not the only one in this case !

    I'm not sure if I can share the link or not, as it leads to my bug account.
    But here the exact report :
     
  8. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    334
    I have the same issue, also fixed by unchecking Bypass sRGB. At least there's a temporary workaround - thanks for filing a bug report.
     
  9. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    265
    Still getting this issue with 5.1.1f1 released yesterday.
     
  10. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    265
    And when building, everything gets too dark again ; I have to set the textures back to "Legacy GUI" to make them look normal again... :confused:

    So it's a very annoying bug, and I still didn't get any answer for my bug report...
     
  11. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    265
    Still not fixed in 5.1.1p1 released yesterday... o_O
     
  12. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    600
    Just recognized that it only happens in the editor, in a build it is fine.
     
  13. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    265
  14. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    334
    It's still happening in both the build and the editor in 2017.4.3 (LTS).
     
  15. fatboynotslim

    fatboynotslim

    Joined:
    Aug 19, 2013
    Posts:
    6
    Also present in 2018.3.0f2.

    Unfortunately the "bypass srgb" option is gone and has been replaced with an "sRGB" checkbox - and ticking or unticking it has no effect; the texture is still drawn too brightly in the gui. Whether as part of a button image, or using gui.drawtexture, it's too bright and no way to fix...

    Edit: Found a painful workaround.

    Use graphics.drawTexture instead. Colors will now be correct. The problem is, if you just do this during ongui, the texture will be drawn twice - once correctly, and once wierldy and hugely covering half the screen (well, that's what happened to me)

    To fix: Draw it during onGui, BUT only during the repaint event. Like this:

    public void OnGUI()
    {
    if (Event.current.type.Equals(EventType.Repaint))
    {
    Graphics.DrawTexture(new Rect(0, 0, 128, 128), aTexture);
    }
    }

    Now I get perfectly coloured, single instance textures.
     
    Last edited: Feb 11, 2019
  16. mowax74

    mowax74

    Joined:
    Mar 3, 2015
    Posts:
    29
    I also see the button textures way to bright in linear workflow. Some elements are gamma corrected from Unity, some not. Must be a bug, there is no working checkmark on the sprite to set it correctly.

    It's ridiculously stupid from Unity, that such a major bug is not getting fixed in kind of 5 years or even longer.
    What's the purpose of having the GUI-textures gamma corrected in linear workflow? Linear workflow is to get correct lighting when rendering. But since the GUI images are unlit no gamma correction is needed.

    People want to see the GUI images exactly like it is displayed in Photoshop. No fix, no tweak, no workaround.

    Have found a custom UI shader anyway, where you can set if the sprite image gamma should be corrected or not. But this should work out of the box, not via custom fix shader.