Problems with sRGB and washed out textures

This is a problem I’ve been having for a looong time, and I’ve never found a proper solution. I’ve found many, many people discussing it and claiming solutions, but none of them have worked for me.
Basically, textures get their gamma screwed up and look awful when I use them inside UE4.
No matter what file format or number of bits I use, the images come out wrong in UE4.
As a point of reference, here’s the base model as seen in Substance Painter, and the base color texture map. The model looks the same inside Marmoset Toolbag as well, so this isn’t just an issue of Painter misrepresenting things. This is how things basically should look inside UE4, and UE4 is the only one screwing things up.

If I export my textures as TGAs, then something goes wrong either with the compression or the gamma correction inside UE4, I’m not sure which. Basically I get a bunch of artifacts from the color range appearing to be reduced. It’s hard to describe, and I don’t have images for this example, but it basically looks like what you would expect to happen if the bits were reduced. The weird thing here though is that it should, in theory, be using the same 8-bits in UE4 and other software, but it looks fine in other software.
Using TGA is less than ideal anyway, because I’m not utilizing alphas, and TGAs have a larger file size.
Because of this, I opted to use PNGs instead, but this introduced other problems. I’ll lead this off by saying that I’m using UE4 4.16, which supposedly fixes issues with 16-bit textures. But I’ve tested this with both 16-bit and 8-bit PNGs anyway.
So… when an 8-bit PNG is used in UE4, it starts out looking washed out, because the sRGB setting is activated and doubling down on the gamma correction, raising it too high.
Here’s an image of what it looks like.

All you have to do is disable sRGB to fix this right? It looks fine inside the texture editor if you do this.
In fact, if I use 16-bit PNGs, then sRGB starts out disabled by default, and everything looks fine.
But then if I attempt to actually use it inside a material, the material seems to force sRGB on again, and screws everything up. Here’s an image.

As you can see, the texture base in the bottom left looks just as it should, but the actual node on the right is washed out, as is the final render of the model on the upper left.
For some reason, a gamma correction is being applied inside the material, and I can’t figure out how to stop it from doing this.
I can perform an additional manual gamma correction on the node to reverse the effect, by applying a Power of 2.2 to it, but this shouldn’t be necessary. Here’s an image with that correction applied.

It looks roughly as it did in Substance Painter now.
Here’s where it gets even more messed up, though. If you’ll go back to the prior image of the material in which everything is washed out, you may notice that the roughness map is actually washed out as well.
You’ll also see that the roughness has not been manually corrected by me in the above image, but still appears to be rendering just fine.
To prove that the roughness is in fact being wrongly gamma corrected and washed out, just like the base color, here’s a side-by-side comparison between the UE4 roughness and the Painter roughness.

The roughness is far brighter than it should be in UE4. Now to prove that it is actually rendering the roughness fine in spite of this, here’s what happens if I try to manually gamma correct it to match Painter.

It becomes far too shiny.
Now, here’s proof that the roughness map itself actually does look the way it should after correcting it, despite rendering incorrectly.

So this means that UE4 is applying some kind of correction to the roughness before final rendering so that it works fine despite appearances, but not to the base color.
The normal map is actually in the same boat as roughness. It looks fine in the texture editor, looks botched up inside the material editor, but renders just fine in spite of that.
I’ve tried it in the latest version 4.22.3, and the same issue is there as well. So this isn’t a bug they fixed later.
Does anyone have an idea of what is going wrong here, and how to fix it? Doing it manually technically works, but I’m working on this as an asset to distribute, and I can’t help but think that this won’t have a consistent result between various configurations and engine versions, on top of it seeming like an ugly band-aid solution.

1 Like

Concerning the diffuse:

Is there a reason why you are using a linear color 16 bit texture for diffuse? You seem to have SRGB unchecked for the diffuse texture which is turning it to “Linear color” that adjusts the gamma internally, this is why you are re-gamma correcting it by 2.2 to get the correct colors.

I imported your jpg texture into unreal, it came in looking fine with the default SRGB checked for diffuse.

  • In general though I found using 8 bits across the board for all textures to be enough for almost all scenarios save a few.
3 Likes

I feel like I’m going crazy. I’ve been having this issue for years, and just today while investigating this problem I ONE HUNDRED PERCENT tested this as both 8-bit and 16-bit, with and without sRGB checked. I’m dead certain about that.
Yet after reading that I decided to triple-check and went back to setting it as an 8-bit PNG with sRGB checked, and it suddenly works. Just works :confused:
I even opened a new project to test it again under the assumption I might have changed something else in between without realizing it. But same thing. Just works.
What even is reality…
This does at least mean that they never fixed 16-bit textures, which they claimed to have done back in version 4.15 AGES ago.

2 Likes

Had the same issue, my 3D modeller exported again all textures in 8bit instead of 16 and tadaam it works! For the washed-out 16 bit, the settings were sRGB false and compression mode Default. For the corrected 8 bit it imported already with sRGB true and compression mode Default. I also tried switching on and off sRGB or changing Sampler Type in the Material itself on the Texture node but none of these worked only re-importing 8-bit Textures and Create Material of those new ones.

3 Likes

(post deleted by author)

3 Likes

Thanks lot. Change Diffuse map to 8 bit works.

2 Likes

Thank you for this!
Solved my issue with colours displaying totally differently in the viewport vs the inspector.