Gamma? sRGB? Don't know the terms, but my colors are weeeeeeird.

Hey guys! Firstly, I’m pretty new to Unreal and very far from being a programmer, so bear with me being a bit clueless and probably calling things by wrong terms. :wink:

Anyway: I am having a general problem in UE, primarily in the material editor, and I am unaware if it is simply me that has my settings set up wrong, or if this happens for everyone. Basically, it SEEMS like everything in the editor is being run through a gamma filter or something, and I cannot for the love of me find where I would go about changing it. It’s a big problem for generated gradients which I tend to use a lot of, but the color picker is a big problem too - I just want to be able to use the standard colors, not the sRGB ones which tend to look washed out and are generally way too light. If I ever want a dark color I have to set the slider so close to black it is almost silly. Just to reiterate, this is a problem affecting me while working; making materials and whatnot, I am not talking about while I’m in play-mode.

I’ve whipped up an approximation of the problem here.

I really hope it’s just me being a newb and have missed something obvious. Any advice is very appreciated.

This is because Unreal Engine allows you to edit in linear space, but most computer monitors are set to correct to gamma space. Basically, in order for a medium grayscale value to appear on a monitor, you only need a small amount of light. Then the brighter you want the monitor, the more difficult it becomes to show brighter values. Around 0.2 is the real value for a medium gray. Most monitors use the sRGB gamma space which raises all colors to a power of approximately 2.21. This becomes especially critical when you’re designing very dark materials or linear gradients.

Textures will import with sRGB checked on so they should appear with the correct gamma. But if you generate a gradient in the engine, you need to gamma-correct it manually, either by raising it to a power of 2.21, or for a cheaper alternative, multiplying it by itself/raising to a power of 2, which uses far less instructions.

Haha, this was actually a significant problem for me! I released a shader to the marketplace that didn’t perform the right gamma correction, and the video was all wrong. Didn’t figure this out until the last second! Whoops! It’s not just a newb mistake, a lot of people don’t know this.

1 Like

They also have an sRGB checkbox in the color picker so you don’t need to guess.

Thanks for the replies and elaborations, guys. Glad to hear I’m not the only one that has had the problem. It sadly doesn’t sound like there is a way to simply disable it - your suggestions all say to work around it. I’m aware that there is an sRGB checkbox and that I can tweak the gradients, but I was hoping there was a way not having to do any of that at all. My background is in Photoshop, so I’m used to a more “what you see is what you get” approach. I’m sure there are good reasons for things working like they do in UE, this approach just seem incredibly counterproductive to me so far, and seems like the kind of thing you’d want a way to potentially disable or toggle off.

The advantages are huge, but they are mostly technical and boring. In sort, the visual quality and realism is vastly increased with little performance impact. Textures, lighting, and frame buffers all benefit from the use of linear space. http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html

For materials, if you want good values for creating something realistic, look at PBR charts.

It can get messy and confusing, but it would be even more confusing of the engine worked in or had an sRGB mode.

1 Like

You should not have any problems with the gradients and such, Unless you are authoring them in a colour space that is not sRGB.
Most textures should be sRGB to take advantage of the mapping, Unless you need the values for use in a calculation(roughness, metalness, Etc); Where you would use linear to preserve the values.

There is a check box in UE4 in the texture to denot if it is sRGB/linear.

All you should have to do is author it however you want in PS, Then convert it to sRGB or linear (unless it is already in that colour space) based on its usage.

I believe the sRGB check box for the colour picker is to show you what it would be if used for linear/sRGB.

“cambridge in colour” has some good articles talking about colour spaces, Adobe should also have some tutorials/articles/docs about this.

HTH

Edit: The example you provide is probably due to differing colour spaces, More info is needed to help with that.
Info such as: Colour space it is in, the exported colour space, the texture settings in UE4, how you are using it in UE4.