Rendered panel is faded compared to preview

Hi all,

I created a visual tree asset that displays some labels.
In preview, it looks great:

However, when rendered in game, it seems to have some “faded” effect:
5421300--551235--upload_2020-1-29_17-45-32.png

Is there some option / effect that might be currently changing the quality of the rendered panel?

More info:

  • No scaling is applied (default scaler “Pixel” with value 1).
  • I’m using URP

Thank you!

What is the color space of your project? Also, could you submit an example through the bug reporter so we can test?

It could be related to this linear issue, but we need to confirm.

Thanks!

I can confirm that linear color space is causing the problem, exactly as described in the bug report you linked.

Should I submit a new bug report?

It shouldn’t be necessary to open a new case then. Beware that the case I mentioned is more about opaque colors showing incorrectly in the runtime when the project color space is linear. I am currently working on a fix for that. However, it will not fix the text border issue that is described in the following thread (also applies to uGUI):

Does this mean that it is not possible to show readable text with UI Elements?
What is the official suggested workaround on this? Is it possible to change the Panel Renderer color space?

Thank you

Hi,

I just meant that the fix for the case I mentioned won’t include a fix for the font issue. I did not mean that the text issue won’t be looked into. Font rendering in linear color space is a harder problem to solve. I recommend that you have a look at this interesting thread:

Unfortunately there is no “universal shader trick” that allows to compensate for blending taking place in linear color space, as @bgolus stated in that thread. The correction to apply depends on what the text will be blending with. For instance, when rendering, black text over a white background, applying a square root to the alpha may help recovering some thickness, but will also make white text over a black background look extra bold.

At this point in time (no custom shaders, no pre/post UIElements render events), your options are limited and the best is probably to try tweaking the font (e.g. family, thickness, alpha, color) based on the background.

In order to get the best universal results, text rendering needs to take place in the gamma color space. However there are also downsides to doing so, and some are highlighted here:

We are considering adding a “color space” setting to the panel itself, but it is too early to give details. In the meantime, please submit a bug report with a sample for the text and we’ll have a look at it. I find it a bit suspicious that some parts of the characters totally disappeared, and I would like to see if there is something else going on.

Thanks

@AlexandreT-unity
Thank you for the info, I’ll try changing the font settings (or the font entirely) to try and have a somewhat readable result.

Is there a way to show the rendered panels through a different camera / color space as of now? Or we will have to wait the parameter you mentioned? (if Unity happens to add it).

I submitted the bug as suggested, and I attached the repro scene here too.

I dread the idea to go back to canvases to do UI, it was so neat using uxml!

Thank you again

5429415–552714–UIBugReport.zip (163 KB)

The linear vs gamma issue shouldn’t affect UIElements text more than uGUI TextMeshPro text. However, after trying your project, it seems to be the case, so there is likely another issue to fix. We’ll investigate furthermore and let you know how it turns out.

Hi AlexandreT-unity, are there any news on this?
I noticed the gamma / linear color space bug has been addressed, but font rendering still is foggy for some reason.

Thank you

It hasn’t been fixed yet but I am told a fix is on the way. Here’s the link to the issue tracker:
https://issuetracker.unity3d.com/issues/uir-ui-elements-runtime-font-not-rendered-correctly-in-linear

Any news about this setting @AlexandreT-unity ?
It would help me in my current project since I need the UI to be rendered with gamma space without changing the global project setting