[5.2] Button Color Tint not working properly? -> BUG with linear lighting

Hi!

I’m having a bit of trouble setting up the color tinting for my spankin’ new button:

2309528--155598--tint.jpg

As you can see above, the background is a pure white image (FFFFFF) and the “Normal Color” of the button is a very dark gray (111111). I’d expected the colors to multiply, so the button ought to be the dark gray set in the “Normal Color”… instead I get this very light gray (as you can see behind O2 icon in the image above). What am I missing?

I’m using Unity 5.2.0f3

Thanks!

Looks like it’s the background of the scene view rather than a dark grey and for some reason your background is causing whatever’s behind to not render.

No it’s not that; the button is in the foreground and fully opaque. It’s just incidental that the color of the button ends up looking quite close to the editor background color. I’ve changed the color to a dark blue to better illustrate the problem:

As you can see, the button is a bright blue, but I’d expect it to be the deep blue color (as specified in the “Normal Color” field). Something is causing my button to turn out much brighter than intended. Given this:

Image Color = (1.0, 1.0, 1.0);
Normal Color = (0.0, 0.0, 0.4);

I was expecting the result of the tint to be the two colors multiplied, i.e.:

  1. Final Color = Image Color * Normal Color = (0.0, 0.0, 0.4)l

What it looks like I’m getting is more akin to something like:

  1. Final Color = (Image Color + Normal Color) / 2 = (0.5, 0.5, 0.7);

Older posts on the forum suggest that I should be getting 1) and I’d like to find out why I’m seeing 2) instead.

(Unfortunately, the docs don’t specify how the color tint operation is implemented)

1 Like

i’m having the same issue here, since 5.2.0f3, was fine in 5.1.x

somehow (img: #FFFFFF) * (btn.normal: #142A3A) = #4f7183

(the square icon button should be as dark blue as the toolbar it sits in. its much brighter somehow)

2309861--155612--buttoncolor.png

hmm can’t seem to reproduce the bug on it’s own to submit as a bug :S

EDIT:

the bug shows itself when in deferred rendering with color space set to linear.

submitted bug report with a scene included: case #730458

I’m also getting this in 5.2.1f1. I suspect linear colour space to be the main culprit, particularly as it is mentioned with regard to colour picking in the release notes of 5.2.

I’ve also sent a bug report with a simple repro project (Case 730457), hopefully not too redundant on top of the other one.

I believe it is only related to linear lighting, as my project uses forward rendering currently. Bug goes away when I switch to gamma. Thanks for reporting the bug!

Got a response from Unity QA:

Here’s the issue tracker link:

Great to hear! Fingers crossed there’ll be a fix soon!

Still occurring in 5.2.2. =(

can confirm in 5.2.2p1 :s

Still occurring with 5.3.0f4 (I don’t know if it was fixed in beta, but it’s broken in 5.3 release).

Apparently an email about this went missing in the ether a while ago. I noticed this on my FogBugz page for Case 730457 dated 16th Nov:

I guess if it still isn’t fixed, it means they haven’t pushed it through the patch pipeline yet.
Might be worth emailing bugs@unity3d.com with the case number to see what the situation is.

It will be in the first 5.3 patch and will also be in the last 5.2 patch.

3 Likes