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.