Home Unreal Engine

[Textures] ~ Texture Sample and final output are much brighter than the original image

triangle
Offline / Send Message
Steamy_Steve triangle
I'm getting this:

[SUBSTANCE DESIGNER]



[UNREAL ENGINE 4.22.3]





As you can see, once imported into the shader the texture gets washed out, it's super bright, and I have absolutely no idea why.
Only now I'm noticing how much this thing is affecting my textures, all of them, forcing me more than once to overcompensate by lowering the original brightness by a substantial notch (hence the many critiques when showing my SD screenshots here on polycount).

I've searched around and it seems it has to do with linear/sRGB colour maps being automatically compressed and manipulated by UE4 for the sake of gamma correction.
I said I don't know why this happens because I've already tried re-exporting this texture both in sRGB and linear, ticking/unticking the sRGB option in UE4's texture editor and changing the texture sampler's type accordingly.
No difference.
Or maybe I'm doing it wrong?

Some details.
When I export from Substance Designer I just save the "2D View" into a PNG format; after setting the output node's colour space to linear/sRGB, of course.
The colour depth, as you can see from the first screenshots, is set to 16bits.

I get no warning/error messages from UE4, while importing the maps; beside the sampler type changing to normal map, ça va sans dire.

Some solutions suggested changing from sRGB to linear (or viceversa) should fix it, others mentioned manually chaning parameters inside some UE4's files.
Others aired the cheap trick of multiplying the colour texture node by a low vector value to just darken it.

A more somehow synched, automated workflow would be much appreciated, though.
What options shoud I tick/untick in Substance Designer and Unreal Engine, to get a colour consistency between the two?

Thank you.


[UPDATE 2019.07.17]
So, my investigation on the matter revealed that 16bits PNGs are an issue, for UE4.
Just changing the export format to TGA solved the problem.
Actually, the problem is still quite there, for me, because 16bits TGA textures take twice the size and thus are not very handy to move around through the Internet (not with my upload speed).
Also, the same problem can be solved by lowering the bit depth of PNGs to 8. To me this is a no-no, heightmaps don't work well in 8bits (ask World Machine users!!).
Soooo....alternatives?

This is how the same (wannabe) palm trunk looks with TGA textures (and a bit of tuning as an afterthought).


Replies

  • leleuxart
    Offline / Send Message
    leleuxart polycounter lvl 12
    PNGs have their own gamma correction, so you need to do the inverse in the texture properties in the editor to counteract it again. 

    It might only be an issue with exporting from Designer/Painter to PNG(since that's where I first encountered it myself as well), so try exporting to Targa then resaving it as a PNG from Photoshop or something. Or, do the inverse gamma correction in Designer before exporting. 
  • Steamy_Steve
    Offline / Send Message
    Steamy_Steve triangle
    leleuxart said:
    PNGs have their own gamma correction, so you need to do the inverse in the texture properties in the editor to counteract it again. 

    It might only be an issue with exporting from Designer/Painter to PNG(since that's where I first encountered it myself as well), so try exporting to Targa then resaving it as a PNG from Photoshop or something. Or, do the inverse gamma correction in Designer before exporting. 
    Any specific number, and possibly *detailed procedure*, for the gamma correction in SD?
    As I said, TGA works great and I would have no complaints if not for the size of the resulting files. PNG would be more convenient....if I'll manage to make it work.
    Of course I could export in TGA and pass the maps through Photoshop for a quick PNG compression, but I have a penchant for efficient workflows and that would be an awful extra step.

    Yes, I can be inconceivably annoying, I'm sure many Polycount's habitués would be happy to agree.
    Thank you in advance for your patience.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    From sRGB to linear -> x^2.2    
    From linear to sRGB -> x^0.4545
  • Steamy_Steve
    Offline / Send Message
    Steamy_Steve triangle
    Obscura said:
    From sRGB to linear -> x^2.2    
    From linear to sRGB -> x^0.4545
    We're talking about powers of the maps, right?
    Like [map] -> [power] -> [shader channel]....?
    And in UE4, right?

    Also, why from sRGB to linear (or viceversa)?!
    If I save the map as sRGB, and then set the sampler as sRGB, I should get the appropriate result. Why not?
    Same with linear-to-linear.
    And why does the same procedure with 8bit PNGs work flawlessly?!
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Yes, in the ue4 material editor. It looks like the png export applies pre exposure on the texture, so when its imported with srgb on, it basically has double srgb and to compensate that, you apply the linear space curve in the material. If you don't want to put the power nodes in the material, you could also simply disable srgb on these textures and then it would work correctly. 

    Normally I use tga because of how alpha channel works with that, but after seeing your post, i tried to see if what you said happens to me too using png. And it did happen. Weird enough, based on my initial tests, it seems like it only happens to colored content (not on grayscale ones). But I'm not 100% sure about this yet, maybe this last statement isn't true.
  • Steamy_Steve
    Offline / Send Message
    Steamy_Steve triangle
    Obscura said:
    [....] If you don't want to put the power nodes in the material, you could also simply disable srgb on these textures and then it would work correctly. 

    Normally I use tga because of how alpha channel works with that, but after seeing your post, i tried to see if what you said happens to me too using png. And it did happen. Weird enough, based on my initial tests, it seems like it only happens to colored content (not on grayscale ones). But I'm not 100% sure about this yet, maybe this last statement isn't true.
    Well, I did try with sRGB on and off, and I got the issue in both cases.
    Did you actually try disabling sRGB in SD *and* in UE4?
    Maybe *I* made a mistake during one of the steps and simply re-imported the same textures....? I dont know, but I think I did everything correct.

    Anyway, the answer to your doubt is *yes*, this thing affects other maps too.
    When I first test maps, I always export them separately (not packed into RGB channels), so I have single greyscale (actually RGB) maps, and....yep, I noticed they're brighter too. Which means packed maps would be affected too.
    I can only guess that 16bit PNGs are the issue, it almost looks like UE4 interprets the 16bit values on a 8bit scale, resulting in numbers that exceed the 0-1 scope. Pretty much what happens when you plug any texture into a multiply node and set the multiplier to 2+.
    Obviously it's not that simple, but sure it's odd how only 16bit PNGs are affected.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    If it would exceed the 0-1 range,you would get a lot of value clipping. srgb/linear is just a falloff, it doesn't extend value range.Thanks for the info about the grayscale ones though. Looks like png export is total crap.
  • Steamy_Steve
    Offline / Send Message
    Steamy_Steve triangle
    @Obscura
    Sorry to furtherly bother you, I forgot to ask you in my previous reply: what about the alpha channel in TGA textures?
    Is there something special about it? =o
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    PNG uses transparency for alpha, while targa uses a regular grayscale channel.
  • Steamy_Steve
    Offline / Send Message
    Steamy_Steve triangle
    Obscura said:
    PNG uses transparency for alpha, while targa uses a regular grayscale channel.
    When you say "PNG uses transparency" you mean one bit per pixel? Like it's either visible or not, no inbetween values?
    While TGA uses actual 16bit grescale values....?
  • zachagreg
    Offline / Send Message
    zachagreg ngon master
    So PNG opening it up in PS you will see that the actual color image will have transparent pixels, where as a targa will have fully opaque pixels with a grayscale alpha channel that masks that fully opaque data.
Sign In or Register to comment.