Search Issue Tracker

Won't Fix

Votes

16

Found in

2021.3.34f1

2022.3.19f1

2023.2.8f1

2023.3.0b5

Issue ID

UUM-62389

Regression

No

Game view introduces banding and renders differently from UI Builder when Gradients from opaque-to-transparent white are selected

--

-

Reproduction steps:
1. Open the attached project "ReproProj"
2. Open the “/Assets/Scenes/Main Menu.unity” Scene
3. In Hierarchy, select “Main Camera” GameObject
4. In Inspector, select Background Type as “Solid Color”
5. In the Project window, open “/Assets/UI/Main Menu/Definitions” directory
6. Open MainMenu.uxml
7. Compare the preview in the UI Builder and Game view

Expected result: The preview in Game view is the same as in UI Builder
Actual result: Preview in the Game view differs from UI Builder and is banded

Reproducible with: 2021.3.34f1, 2022.3.19f1, 2023.2.8f1, 2023.3.0b5

Reproducible on: Windows 10 Enterprise 21H2
Not reproducible on: No other environment tested

Notes:
- Only reproducible with URP/HDRP
- Reproduces with Windows Standalone Player

  1. Resolution Note:

    As discussed on the forum thread, the problem arises when working with alpha gradients in a linear colorspace project. Since the alpha channel is not gamma-corrected, banding can occur. There are other factors at play, such as the float precision at which the GPU will perform the blending operations. Some GPU uses higher-precision floats, which helps reducing the banding.

    Working with color gradients help since the RGB channels are gamma-corrected. Otherwise, a workaround is to render the UI and a float RenderTexture, which should eliminate the banding.

Comments (2)

  1. Hyperion90

    Feb 10, 2024 14:24

    Also: The exact same issue appears even if instead of using a texture, we are drawing a gradient with MeshGenerationContext upon subscribing to generateVisualContent.

  2. Hyperion90

    Feb 10, 2024 14:13

    I believe the resolution to this task applies to another (but relevant) problem related to the reported issue.

    The problem is the banding itself. We do not necessarily mind the difference between the Game View and the UI Builder - the bigger issue is the banding itself.

    Even though the exported texture indeed contains some banding, it definitely shouldn’t be that visible. This seems like an issue related to how Unity renders the UI.

    If the issue is related to differences between linear/gamma colorspaces, why is the banding still far more noticeable after changing the project’s color space to Gamma?

    If the issue is related to the differences between colorspaces, then why do some specific graphics cards actually render the content without any (noticeable) banding in Game View?

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.