Home Technical Talk

186 grey instead of 128 grey got any tips for authoring textures this way?

polycount sponsor
Offline / Send Message
malcolm polycount sponsor
Hi guys, we're currently learning about the whole gamma correct pipeline for UE4 and how you should author your textures at 186 grey in Photoshop to give the lighting engine better more physical values to work with so it can absorb and bounce light correctly.

I'm referencing these two pages in case anyone is wondering.
http://filmicgames.com/archives/299
For the Epic link scroll down to Making Lighting Noticeable
https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/Lightmass/index.html

While the concept makes sense, the problem is this is really hard, it's hard to look at a texture in Photoshop and make it really bright, it feels perceptually wrong, or maybe because I've been making textures darker for 15 years now.

Either way, does anyone have a suggestion on how do this less painfully, right now we're taking the swatch approach and using those values as guidelines, but I still find it pretty tough and can't do it by eye without the help of the swatch.

My workflow:
1. Make my texture as normal.
2. Make a small swatch on the top layer with the average imminence I'm aiming for.
3. Make an adjustment layer to desat the image temporarily.
4. Put a curves or levels node under the swatch and desat and adjust until my texture's main colour matches the swatch by zooming out and squinting at it.
5. Make sure to account for dirt and grime being darker than the swatch so don't brighten the darkest pixels to match the swatch, but rather the actual part of the texture that is the majority of the material.
6. Then look at my texture and say damn that's bright and feel uncomfortable.

Questions:
1. The Order 1886 has really dark textures, so did they not use the 186 grey midpoint? As I thought they were the most physically correct game out there.
2. Is there a way in Photoshop to set the midpoint grey to actually be darker or something so it tricks me into making my textures brighter without having to think about it so much.
3. What is a good way to measure how much contrast should be in an image, or are we saying there is no such thing as contrast anymore, all you care about is how bright a "material" is in your texture. So grey paint 186, dirt on that paint, some other chart value, white spatter chunks on top of that some other chart value?
 


Replies

  • Farfarer
    Generally there are settings these days in the engine to gamma correct the textures, so you shouldn't need to do this.

    Ticking the sRGB checkbox in the texture properties should mean the texture is sampled correctly (you generally only want colour textures to have this ticked because you want everything else to come through as linear).
  • Farfarer
    You could always throw a Curves adjustment layer on top of everything, with an input of 127/output of 186?

  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    We're using UE4 so everything is corrected for us with the sRGB tick box for albedo textures. But on top of that we now also have to use mid grey of 186, unless we've totally misinterpreted the Epic documentation. I don't think so though.

    Also we've tested that in fact whatever colour you make in Photoshop will get into unreal exactly if you have the sRGB tickbox turned on. So everything is 1:1, we're just being asked to make textures much brighter than we're used to.

    Also I don't get how this 186 grey works with a macbeth chart, those values look much darker than 186 average luminance when taking photos and removing lighting information under ideal conditions.

    I just tried your curve idea, that's nifty, I'm going to show this to our CG Sup and see what he thinks.
  • Scruples
    Offline / Send Message
    Scruples polycounter lvl 10
    Bake the textures in 8-bit 2.2 gamma (most 3d packages can) or 16-bit and then change the gamma in photoshop, or else you're just stretching the existing information. About your concerns, making the texture brighter isn't to make it more noticeable it's to linearize the data so the same amount of information exists on all parts of the image to reduce banding. The game engine will darken the texture so it displays correctly. If you want to preview in a regular color space you can apply the inverse gamma curve which is 0.454545

    httpiimgurcom0pCZDqkpng

  • malcolm
    Offline / Send Message
    malcolm polycount sponsor

    Hello guys, the game engine does not darken anything. Unreal 4 is 1:1 between Photoshop and in game, if you make any colour in Photoshop it gets into Unreal exactly how you see it. You can test this by importing the texture as sRGB on and then switching the viewport to base colour mode and sampling the colour. If you make 186 grey in Photoshop it will still be 186 grey in UE4. If you make 128 grey in Photoshop it will still be 128 grey in UE4. Values don't shift around just because it's gamma correct, not in Unreal 4 anyways.


    What've we've been asked to do is now use 186 grey as our midpoint in Photoshop which makes textures quite bright and washed out looking. When they get into game they look exactly the same because everything is 1:1 in UE4.


    I guess what I'm struggling with is that the textures don't look good when they're this bright in Photoshop or Unreal (or I'm not used to looking at them) so I was wondering if anyone has gone through this process already and had any suggestions or findings from their own tests or work projects because when I look at other games like the Order 1886 their albedo average luminance is nowhere near 186 grey.

  • Scruples
  • almighty_gir
    Offline / Send Message
    almighty_gir ngon master
    what? this is all rubbish...

    using 186 grey as your mid-point is if you want to try to author your texture in a linear format, in photoshop, which is almost impossible. the "best" way to do it, is to use a curve adjustment as farfarer pointed out. just make sure your top layer is that curve adjustment and anything you do beneath it will correspond. that way you *should* get a realtime visual update of a linear texture... even though all the colours you pick will be in sRGB space. which is proper fucked.

    the other solution is to not use photoshop, and find something that lets you texture in a linear workspace. i believe Krita lets you choose which colour space you want to work in, and the Substance tools all work in linear space for grayscale textures.

    https://userbase.kde.org/Krita/Manual/ColorManagement

    [quote]
    Hello guys, the game engine does not darken anything. Unreal 4 is 1:1 between Photoshop and in game, if you make any colour in Photoshop it gets into Unreal exactly how you see it. You can test this by importing the texture as sRGB on and then switching the viewport to base colour mode and sampling the colour. If you make 186 grey in Photoshop it will still be 186 grey in UE4. If you make 128 grey in Photoshop it will still be 128 grey in UE4. Values don't shift around just because it's gamma correct, not in Unreal 4 anyways.
    [/quote]

    putting it simply: you're painting your texture in a software that has a curve applied to it by default. and while what you say is true, if a texture is set to linear in UE4 then all values will be taken "as is" (ie: unreal won't apply any curve to the values it's given), you've painted those values WITH a curve. and unless you're some kind of weird genius, i highly doubt you'd be able to tell me what photoshop value you need to get 0.25, or 0.3, etc. essentially, your workflow is fine as long as you know all the predefined values you're using and you're only planning to use flat values across areas of your texture, as soon as you start painting dynamically and switching values, everything goes a bit messy.

    So you're better off just texturing with 128 as your mid point and telling UE4 that it's an sRGB texture... if you're texturing in photoshop.
  • Beddall
    Offline / Send Message
    Beddall polycounter lvl 6
    Hey,

    Sorry for bringing this thread back, but I've been having trouble with this recently. 
    I'm trying to author colour overlay maps that get overlaid on top of a base colour via a Overlay Node in UE4 material editor. The trouble I'm having is that UE4 Overlay node does in fact seem to use 186 grey as the midpoint. 
    Anyone else have any experience of this and want to share some tips / workflow?

    cheers

  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    Hey thanks for bringing this thread back I had forgotten about it. I did a lot of research and found answers to my question, but forgot to post back here.

    So first, Beddall, yes we had that same problem at work with the overlay method you are talking about. There is a fix for it, but I don't know what it is. One of our tech artists fixed it so 127 grey in Photoshop looks how you would expect it in Unreal 4 with an overlay. He said it costs more fps than using Unreal's default method, but for us it's a must have for making macro textures for rocks.

    As for my original question we got it wrong at our studio at first, hence my original question and confusion. After some research I was able to confirm in Unreal 4 whatever you author the texture at in Photoshop is what you will see the texture at in Unreal.

    Basically you don't have to do anything, the shader uses 186 as a mid point, but the textures don't. So, as an artist turn sRGB on for albedo textures and don't worry about anything else, just make art. The part that misled me at first is that I was instructed to author my textures brighter assuming 186 was mid grey in Photoshop. This is FALSE, 127 is still mid grey in Photoshop when working with Unreal 4 and probably most other gamma correct engines. Like I said we were misled for a bit and told we now need to author black plastic at a light grey value, again, this was false and made our game look like junk and also didn't make sense technically.

    To close the loop I reached out to John Hable of Naughty Dog/Uncharted fame and he agreed that in Photoshop 127 is the mid point of an albedo texture, so don't make things brighter just because you are working with a gamma correct rendering engine.
Sign In or Register to comment.