Search Unity

UIElements Runtime with different color spaces

Discussion in 'UI Toolkit' started by Kan15hkSMT, Feb 6, 2020.

  1. Kan15hkSMT

    Kan15hkSMT

    Joined:
    Nov 13, 2019
    Posts:
    37
    How does runtime UIElements handle different color spaces? What is the expected setup?

    I had a runtime panel which rendered correctly in gamma color space but when I switched the color space to linear the panel was rendered with incorrect colors. Is this expected behavior?
     
  2. AlexandreT-unity

    AlexandreT-unity

    Unity Technologies

    Joined:
    Feb 1, 2018
    Posts:
    376
    There is a known issue with the 19.3 runtime package in linear. It causes colors to look lighter compared to the UI Builder or to the same result in gamma. We are in the process of landing a fix and backporting it to 19.3.
    https://issuetracker.unity3d.com/is...-ui-builder-than-color-displayed-in-game-view

    Once the fix lands, the biggest difference that will remain, between gamma and linear, will be blending. By nature, blending in gamma looks different from blending in linear. There are pros and cons to both, and there is no magic way to make both look the same in all circumstances.

    We will look into adding an option on the panel to override the project color space (can't give ETA now). It would be useful, for example, if you want to render the world in linear and the UI overlay in gamma. Then a special shader could be used to merge both results.
     
    Ferazel and Kan15hkSMT like this.
  3. Ferazel

    Ferazel

    Joined:
    Apr 18, 2010
    Posts:
    517
    I want to request that we would love UI toolkit to be able to support a different color space than the main renderer. Gamma is what most 2D artists use and what text mesh pro looks the most accurate in. Or if maybe you could tweak texture import settings on sRGB to get a more “gamma blend”.
     
  4. ChristianTeister

    ChristianTeister

    Joined:
    Apr 8, 2021
    Posts:
    7
    This is a still huge issue in combination with HDRP, since high transparency gradients produce horrible banding in linear color space:
    linear_high_transparency.png

    Any news when the option to override the color space per UI panel will be finally added?
    Without that UI Toolkit is unusable in combination with HDRP, except when your UI uses no transparency.
     
    Last edited: Jun 19, 2023
  5. jonasgoessler04

    jonasgoessler04

    Joined:
    Sep 1, 2023
    Posts:
    1
    I need it too, please make the option