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. Dismiss Notice

Bug UI Builder doesn't support linear color space (and UI toolkit too?)

Discussion in 'UI Toolkit' started by useraccount1, Feb 6, 2022.

  1. useraccount1

    useraccount1

    Joined:
    Mar 31, 2018
    Posts:
    266
    Today I've noticed that somehow I don't use linear color space in my project. I've fixed that, solved many issues I had with lightning, but now I have a problem with UI. Most of it is broken.

    The first thing I found while searching this issue was a piece of information about trying to implement an option to have UI rendered in a different color space than the rest of the game. That was exactly 2 years ago. What was the result of that research? I suppose that it's simply not possible or not going to land anytime soon. It's not even on the roadmap.


    But now, there are a lot of problems with linear color space in the UI Toolkit making a simple switch absurdly difficult. For example, UI Builder doesn't support it at all.


    Here is how my UI looks in linear color space (Game view):
    UI5.PNG


    Here is how my UI looks in gamma color space (Game view):
    UI3.png


    Here is how my UI looks in UI Builder while the linear color space is turned on (I've added a picture from the scene view as a background):
    UI6.PNG

    Now, How I'm supposed to quickly adapt anything when I have to switch between UI Builder and game view to see what I'm doing?


    And that's not the worst part, I have something more dramatic. The font got somehow thick to the point of me getting a problem with reading the text.
    Here's the comparison:

    UI FOnts.png

    Icons got thicker too
    UI Same zoom.png


    I'm trying to find whether this is normal as the linear space changes blending. So far, I have only found posts from around 2015 about UI which don't apply sRGB. I wonder whether it's the same problem here. I can see all colors in the linear space looks unnatural, too bright, faded.

    I'm using unity 2021.2.10
     
    DarkRewar likes this.
  2. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    515
    UI authored in gamma space will look different when rendered in linear space, as the blending of the color cannot be the same. This is expected, but the ui builder does not currently support displaying a linear UI, so the best way to simultaneously see the result and edit it would be to use the live reload feature so that changes in the UI builder are reflected in your game view as they occur.
     
    Last edited: Mar 23, 2023
  3. Oneiros90

    Oneiros90

    Joined:
    Apr 29, 2014
    Posts:
    77
    @SimonDufour any chance we might have a dedicated color space setting in the UI Panel Settings? I don't like the "use a render texture and blit it" solution
     
  4. jtheis85

    jtheis85

    Joined:
    Oct 13, 2021
    Posts:
    19
    Is a linear-space UI builder on the roadmap at all?
     
    Sluggy likes this.
  5. ChristianTeister

    ChristianTeister

    Joined:
    Apr 8, 2021
    Posts:
    7
    High transparency gradients look horrible in linear color space, because of the banding: linear_high_transparency.png
    This prevents UI Toolkit in combination with HDRP (which requires linear color space) from being production ready.
     
    Last edited: Jun 19, 2023