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

Question Opacity different in UI Builder than Game view

Discussion in 'UI Toolkit' started by jtheis85, Mar 11, 2023.

  1. jtheis85

    jtheis85

    Joined:
    Oct 13, 2021
    Posts:
    19
    Why is the opacity on these buttons so much different in the UI Builder vs the actual Game view? I have to set my opacity quite a bit darker that I'd like in the UI builder just so that it looks OK in the game view. But this means the UI Builder is somewhat useless in actually previewing what things will look like. What's going on here? Game view looks the same whether I am running it or not.

    upload_2023-3-11_11-33-21.png
     
  2. jtheis85

    jtheis85

    Joined:
    Oct 13, 2021
    Posts:
    19
    This is on 2022.1.20f1 (I tried updating to 2022.2.9f1, but this version had other UI Toolkit problems, namely with the dynamic color hints causing incorrect colors to be applied to elements, so I had to revert).
     
  3. useraccount1

    useraccount1

    Joined:
    Mar 31, 2018
    Posts:
    266
    From what I remember, UI Builder always uses a gamma color space, while your game seems to be using linear color space.

    There is no proper way to fix this other than force your UI to work in a gamma color space or stop using UI Builder altogether.
     
  4. jtheis85

    jtheis85

    Joined:
    Oct 13, 2021
    Posts:
    19
    That's a real bummer. Isn't linear color space the default in unity? Also, from what I'm reading here, linear is superior to gamma in a number of ways, so I don't think I'd want to change (plus who knows what knock on effects it would have in my project at this point). Is there no way to switch UI Builder into linear mode?