Color Confusion..

So can somebody please explain this to me … if I create a color picker in some inspector and I set the emit color of a material and this color picker to the exact same settings ( hex string or rgb ) they are not the same shade , maybe the hue is the same but not the value.

This whole +1.+2,-1,-2 stuff of the emit settings is not very user friendly from a coding point of view… what is happening when you click these? I can see what they do but i dont know the maths behind it which makes it very difficult to control or set via code. Also now that i see this difference in inspector color picker and this emit version im not sure if I can use such a color picker to feed the emit color value. Has this got something to do with it being HDR with a bigger range? Then how do I create a color picker like that myself in a inspector?

sample difference :

They’re not the exact same settings. Your HDR color has an intensity of 2.4, whereas your non-HDR color has an intensity of 0.

This is a convenience feature that shows the color with -2, -1, 0, +1, and +2 intensity from its current value.

The intensity (or brightness) of the color is simply how high the values are for the RGB channels. For example, if you had a grey scale color (only one channel), the intensity would range from 0 to 1, where 0 is black, and 1 is pure white. HDR allows you to go above 1 which allows you to capture more detailed color data in a scene. This extra data can’t be displayed on a monitor as a color because monitors cap out at 1, so it just displays as white (or similarly maxed out colors). You can also go below 0 in HDR and have negative color strength. Similarly, monitors can only display this color as black.

Edit: It looks like in 2018 they modified the intensity slider so that it acts as if a normal color (non HDR range) is always intensity 0. Under the hood the above is still happening, Unity is just rescaling the values.

You can add an HDR space color picker to your own inspectors using the ColorUsage attribute. https://docs.unity3d.com/ScriptReference/ColorUsageAttribute.html

thanks @Madgvox for the detailed reply. Obviously the left color picker the intensity is not something you can control , there is no slider for it.

I thought as much but when you click these options the intensity slider ( and value ) does not change in the inspector…?

thanks again

unless it is not updating the slider value because the buttons represent a different variable which is added to the current intensity internally : intensity + additional intensity = final intensity

It is still rather poor that there is no representation of final intensity then to the user … even if it was just a label in the inspector it would make thing much more obvious to users

I’m not sure what version you’re on, but in my 2018 version clicking the buttons immediately updates the slider value. They don’t represent a different variable.

@Madgvox

Unity 2018 2.2.f1 HDRP pipeline…

It could have to do with using th HDRP pipeline. I already found other weird changes , like the shader having the property “_EmissionColor” which works outside of HDRP , but does not work when using the pipeline. The shader variable is still there , you can see it if you select the shader . There is an additional property named “EmissiveColor” that does work with this pipeline… weird stuff , im sure the slider not updating is another weird thing like this

If that’s the case then I’m assuming that it’s the usual weirdness resulting from a dramatic breaking change to the engine, combined with it being a preview version and not a release version.

1 Like

What exactly changed in the switch from brightness to intensity in 2018? My HDR colors are totally broken in 2018.2.17f1 after updating from 2017.4.2f2. Details: HDR colors broken in shaders after updating project from Unity 2017.4.2f2 to Unity 2018.2.17f1