x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Gamma/Tone Washing Out Image - How to Fix?

I have a city in a generic forward renderer with simple lighting: blue-ish ambient, a cubemap for some additional lighting, and a directional light for the sun. The scene looks fantastic.

I have the same scene setup in Unreal Engine. I tried using a solid sky light color and also a cubemap for sky light. I used these with a warm direct light representing the sun. I was highly disappointed with how washed out the color was and after a while I became convinced it has something to do with either the gamma correction in one of the core shaders OR it's a flaw in how the lighting is blended with the sample diffuse. I don't know exactly which. I tried completely commenting out the gamma correction step in GammaCorrection.usf and reloading the engine. It made no difference in the image. Can someone please tell me what's going on that's causing Unreal to compress and wash out the colors and how to fix it?

Below are two images. The first more vibrant and richer one is the generic forward renderer. This is the look I want.

The second image is the Unreal render. Note how flat the relative colors are.

alt text

alt text

ADDITIONAL NOTES: Changing the Exposure does not seem to effect the relative color curve or look other than shifting the total luminance of the image up or down. I played with Exposure and lighting intensities plenty to verify this. The problem has got to be the way the lighting itself is shaded or something to do with low level gamma correction or tone mapping in the core shaders.

Any help on this would be appreciated.

  • Posted on behalf of Jim Houx

Product Version: Not Selected
Tags:
forward.jpg (270.6 kB)
unreal.jpg (234.7 kB)
more ▼

asked May 15 '14 at 06:35 PM in Rendering

avatar image

CWeatherman
11 4 6 7

avatar image CWeatherman May 15 '14 at 07:17 PM

We figured out that the FilmPostProcess() function in TonemapCommon.usf only runs if you turn on one of the effects in the Film dropdown of Post Process Volume. But we also discovered that this function definitely shades the entire screen, which means it will only take the existing washed out image and run a color process on it. That means tone mapping is not the problem. The problem is deeper than that. It's either some kind of gamma shift that happens before the post process effects are run, or it's the way the lighting itself shades the geometry to generate the HDR image.

Still no idea here how to fix it.

avatar image Lovecraft_K ♦♦ STAFF May 15 '14 at 07:22 PM

Hey CWeatherman and Jim Houx -

There are some adjustments that can be done to the material that is applied to the mesh which can help bring out the saturation of color that you are looking for, but I want to check a few things as well. The image you are showing in the UE4 example above needs to have lighting built, does it still look as washed out once the lightmaps are built into the level? Also, what does your material look like, is it just the texture inputed into Base color? Also, what is your levels post process settings.

-Let me know

Eric Ketchum

Edited: Also check the texture's settings in the Texture Editor. Try it without having sRGB checked

avatar image CWeatherman May 15 '14 at 08:00 PM

Eric, I unchecked sRGB already. It was one of the first things I tried. It makes no difference.

Also the washout and color range issue shows up both with built and unbuilt lighting.

The material is extremely primitive. 0 (black) in the specular and the texture is wired directly into the Base color.

I will also point out that trying to exaggerate the diffuse texture in the material isn't solving the problem and won't actually be a proper fix. The problem is that Unreal isn't faithfully reproducing the color range when shown in the viewport. sRGB makes no difference, lighting makes no difference, Film effects don't fix it because they only try to post-fix/hide the real problem. The only thing I haven't figured out yet how to change is the gamma itself or the map from HDR to LDR -- they are my last hope.

avatar image CWeatherman May 16 '14 at 05:39 PM

Jim says: I have verified the culprit is either the tonemapper itself or one of the functions connected to it. Per Martin's direction, I turned off tonemapping and got hugely improved results even in the default scene. See the following images.

First image is with tonemapping enabled. Second image is tonemapping off.

alt text

alt text

When turning on tonemapping, the highlight on the table becomes grey instead of white. All the whites in general are lost and become grey. This means not only is their an overall loss of contrast, but the white point is incorrect.

The colors get desaturated reducing vibrance and depth.

This is a fundamental problem that needs to be addressed. Some people could make an argument that it results in a better mapped image -- but in reality it's less physically-accurate AND prevents the artist from getting extremely hot highlights and vibrant saturated colors. It really isn't beneficial in any way. The only seeming positive effect is that shadows get richer, but richer shadows should be setup properly with lighting adjustments, texture changes, or a simple post process color curve that only effects mid and dark tones. The tonemapper should not be responsible for darkening shadows.

I took a look in the PostProcessTonemap.usf file and found the line that calls the tonemapping function as well as the color grading function. I tried bypassing both of them and for some reason the tonemapper still takes effect. Could someone direct me on specifically what to change in the shader file to disable the tonemapper completely? I don't know why my edits aren't taking effect.

tonemap.jpg (48.3 kB)
no-tonemap.jpg (50.2 kB)
avatar image CWeatherman May 16 '14 at 07:16 PM

Jim says: Ok I guess I was just confused about the edits I was making. They're definitely taking effect. I'm working on an improved color mapping now that gets a more linear-esque color curve to keep strong contrast but still map everything into LDR properly.

avatar image Hyperloop May 18 '14 at 01:52 PM

Is there a solution to this that doesn't involve code? I'm having a heck of a time with it as well.

avatar image CWeatherman May 19 '14 at 02:25 PM

@Hyperloop, no there isn't a solution that doesn't involve code. If you look at my answer down below, there's an explanation about a way to do it.

avatar image SilverNeon Mar 13 '15 at 12:14 PM

This is a serious issue, In testing it myself I have not found Tonemapper to be the problem, I enabled Tonemapper in editor mode and its enabled by default in game mode. However the moment I press play theirs a darkening that takes place that's making me angry. I don't know what this darkening is but you can see it by pressing G and then G again, their is some quick fading transmission that happens often making things darker that is separate from Tonemapper.

This engine started out so well but the more I use it the more I am getting angry with it, I don't want another Unity 3d....

Isn't their a button that makes the Editor View settings the same as the game? Why does the editor launch with all these preset lighting conditions that are only suitable for certain games?

avatar image SilverNeon Mar 12 '15 at 01:37 PM

Alright so after some testing by having all my EDITOR post process effects activated and disabling the post process on my CAMERA and my post process VOLUME in the world outliner, I now have the exact same views in G mode and editor mode.

However I have found that their are hidden post process effects somewhere else, This is evident when I disable the tonemapper, eye adaptation and another....I am not sure what object is responsible for this yet.

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

Sorry for double post. but I got a solution to the tone mapper. Check it out ! https://forums.unrealengine.com/showthread.php?140851-Dissable-Color-Grading-and-Tone-mapper-completly-or-!

Also I wonder if there is a sweet spot for setting up color grading and tone mapper to where we can get a default non tone mapper look and feel. so that we can still use the tone mapper in specific cases ! Has anyone actually attempted that here? playing with the post process settings in search for the sweet spot?

more ▼

answered Mar 29 '17 at 03:44 PM

avatar image

Tuxmask75
57 5 7 11

(comments are locked)
10|2000 characters needed characters left

Figured it out. Disabling the tonemapper is as simple as passing the Linear Color out of the tonemap shader. I did that like this: OutColor = float4(LinearColor.rgb, LuminanceForPostProcessAA);

in PostProcessTonemap.usf.

But that wasn't the only problem. I also had to uncheck the sRGB checkbox on every single texture in the scene because everything was super dark without the tonemapper until I unchecked that box. Here's what the image looks like now. The colors are far closer to the original tonal range in the source texture. Brights blow out nicely and the high tones have their original contrast.

alt text

fixed.jpg (251.5 kB)
more ▼

answered May 16 '14 at 10:06 PM

avatar image

CWeatherman
11 4 6 7

avatar image Bushey Sep 22 '16 at 02:22 PM

Hi, I'm having tone map issues too - where does the PostProcessTonemap.usf live, as I can't find it.

Many thanks

(comments are locked)
10|2000 characters needed characters left

I'd guess the generic forward renderer didn't do lighting properly in linear space, or didn't use a tonemapper at all. The tonemapper causes some loss of contrast because it maps a large HDR range to a small LDR range, that's a necessary evil.

You can disable the tonemapper with a show flag, and then it will use the simple gamma correction path.

Can you combat it with the contrast settings in PP, or increase the contrast in your lighting (less ambient so shadows are darker, more directional).

more ▼

answered May 15 '14 at 07:49 PM

avatar image

DanielW STAFF
1.9k 31 10 71

avatar image CWeatherman May 15 '14 at 07:52 PM

Can you explain how to do this "show flag" to disable the tonemapper?

avatar image DanielW STAFF May 15 '14 at 10:34 PM

On the editor viewport, Show->PostProcessing->Tonemapper. It's useful to see what the affect of the tonemapper is, how much the range compression is affecting your final look.

avatar image CWeatherman May 15 '14 at 08:04 PM

Daniel: some additional comments:

From the color grading page in the docs: "Note that bright colors become gradually brighter but much less than dark ones. Black remains black and there is a mostly linear part of the curve that is a bit steeper than the non tone-mapped curve would be. That results in some contrast enhancing."

There is a discrepancy in that the docs are indicating color grading should cause contrast enhancing but you're saying it can cause contrast lost. Which statement is the true one?

The problem can't be combatted with PP because that's simply a hack retro-fix to the poor color rendition on the buffer. Additionally, changing lighting parameters will have no useful effect because the issue is on a flat plane in a heavily varied texture. The problem is relative color metric of the aerial image on a flat surface.

avatar image DanielW STAFF May 15 '14 at 10:45 PM

There is a discrepancy in that the docs are indicating color grading should cause contrast enhancing but you're saying it can cause contrast lost. Which statement is the true one?

They are both true, in different areas. The doc is talking about the 'toe' at the dark end of the tonemapper, which increases contrast slightly in the darks. I'm talking about the generally more noticeable compression of bright colors which reduces contrast. Bright colors also get desaturated as they approach 1.

Additionally, changing lighting parameters will have no useful effect because the issue is on a flat plane in a heavily varied texture. The problem is relative color metric of the aerial image on a flat surface.

I see that now, and that is part of the problem. Material descriptions need to be surface properties, things like diffuse reflectance (this is what you plug into base color). You are plugging a final lit image (photograph) into Base Color, which is effectively tonemapping the image twice, since the camera tonemapped when it captured the photo (conversion from linear HDR lighting to gamma LDR). To reproduce the same result as the image, you would have to know the underlying diffuse colors of the materials captured in the photo.

So that's the theory part of it. Obviously you want to make something work and you have an already tonemapped photo, not the raw diffuse colors of the scene that you would want. What you can do is try to undo the camera's tonemapping with contrast and brightness operations in the BaseColor of your material.

avatar image CWeatherman May 15 '14 at 10:51 PM

The photo doesn't have to be evaluated as a photo. You are choosing to think of it that way. In reality, it can be viewed as a simple texture with colors in linear space. And clearly the transformation happening in Unreal is distorting that space. The fact that it's a photograph is irrelevant.

avatar image DanielW STAFF May 16 '14 at 08:59 PM

It really does. A tonemapping operation has been applied to the image by the camera which captured it. You can't expect to treat a tonemapped image as diffuse reflectance and then tonemap it again and get the same result as the original tonemapped image.

avatar image CWeatherman May 16 '14 at 09:00 PM

Please read my updated comment above. As you can see, whites are grey thanks to the Tonemapper even in the default scene. This is incorrect.

avatar image Traggey Apr 15 '16 at 01:22 PM

This issue is really screwing me over aswell, I'm working on a pixel art game where I NEED PURE BRIGHTS.

I have a moon and lightning bolts in the sky and for some reason, they turn out grey instead of pure white, so I started googling around and found this issue, I tried going to show>PP>tonemapping, turned that off and now my picture looks perfect in the editor, but obviously as soon as the game starts running again I get the crappy greyed out colours, and my shadows are also becoming darker, which I simply do not want. I want to be able to 100 % accurately display the colours that I have drawn in my pixel art but aslong as I can not turn off this blasted tonemapping that won't happen.

I have made a post processing volume and tried turning it off there, none of the options change anything at all, the only way this far has been to turn it off via the viewports show menu as mentioned above, sadly this does not solve anything for in-game use.

What the bloody hell am I supposed to do about this? The tonemapping is messing up my colours making everything look washed out and boring.

See for yourself, you can not honestly tell me that this isn't screwing up my art.

alt text

avatar image rickdlol May 25 '16 at 12:59 PM

That looks fantastic! (sorry for providing no useful feedback!)

avatar image DolphinTaco Dec 26 '16 at 10:36 AM

Has anyone found a solution to this? Tempted to switch over to Unity to see if anything is better over there.

avatar image Hyperloop Dec 26 '16 at 05:25 PM

Having worked extensively in both engines, that would definitely be throwing the baby out with the bath water.

avatar image Tuxmask75 Mar 28 '17 at 05:24 AM

I'm also working on a game with pixel art and need the colors to be accurate, anything new in 4.15.1 that would help?

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question