Improved Adaptation and Tone mapping after first open test

< News
7 May 2020

One of the feedback points we have received after the first open playtest of Enlisted was “too much light when looking from inside the building outside, it blinds you”, or “reflections from the ground can blind you”. 

We have tried to improve this situation. So let us discuss the core of the problem and ways to solve it.

Dynamic range perceived by the human eye (and the range in which the game can render) is much higher than the typical LDR monitor range (0 - 1 range, 256 shades of each color channel). 

The process of HDR to LDR conversion on a monitor is called tone mapping.

Though it is technically possible to display an image of any dynamic range (from 0 to infinity) in the range of 0 to 1, this means losing some details in brightness, color and contrast (for example).

The goal of tone mapping is to obtain a perceptual match between a real scene and a displayed image even though the display device is not able to reproduce the full range of luminance values.

So ‘good’ tone mapping has to display maximum details, meaning retention of good contrast whilst simultaneously rendering the most comfortable and realistic picture for the human eye. There are many ways to do it, but mostly it all comes to using the right exposure value for a specific spot - being it photography, filmmaking or other picture related content creation (Exposure (photography)).

Besides, our eye also has its limits in dynamic range recognition, though higher than typical monitor range. When standing in bright sunlight, you will not see details in shadows - like those in the unlit interiors. Or if we are exiting a dark building, we need time to adjust to bright light before we start seeing properly (Eye adaptation).

Naturally, a game needs to be comfortable, so we can not allow ourselves to simulate light adaptation within an hour, as in real life. But still, some usage of adaptation is considered a reasonable compromise between quality of picture and the amount of detail we really get. 

One method used in photography is a local tone mapping operator (like here). It allows for maximum contrast while preserving details. Unfortunately, this method is of little use for a dynamic picture (like a movie or game) since it is based on finding areas of different brightness and results in blinking, dark and light halo and other unpleasant artefacts when the camera moves. 

This is why games usually utilize dynamic adaptation of the whole picture. Automatic adaptation has been used quite for some time in video games (about two decades) and techniques used are pretty similar. 

In short, the game gets the average (or median) HDR brightness of the picture and tries to set up such exposure values to keep this brightness fixed in certain scenes. 

The Dagor Engine uses a brightness pixel histogram, allowing it to use not the average, but the median or a specific percentile value, solving the issue of adapting to small but very bright areas like bulbs, reflections or sparks. 

After we got our first open test feedback, we tried to find a way to improve that comfort further. The first test was based on the Battle of Moscow campaign in the autumn-winter setting of Volokolamsk location. 

That map meant: 

  • Snow (bright and white). Adaptation to it resulted in making its color greyish and dull, which is rather unpleasant as we tend to perceive snow as being white. Also it made looking into buildings from the outside too dark with no details. 

  • A lot of reflecting mud. Mud is dark itself, but light specular makes it appear bright and shiny with glancing angles. Adaptation didn’t work as a lot of mud usually still does not reflect anything. 

  • Dark wooden houses. Adaptation makes them dull-grey. Which is not bad as they look nice, but it makes snow and sky in windows appear blindingly bright. Naturally, the game would benefit if we do not focus our adaptation on a house interior only and allow the player to see more details outside where most of the action is.

In order to improve game behavior in those difficult areas, we decided to use the following: instead of automatic adaptation to the brightness level of the final picture, the use of adaptation to the level of light in the scene (actually, we use a weighted average approach of both techniques). Adaptation to the light amount is closer in its effect to the photography approach and the way we perceive the world. 

Naturally, in real life eyes can adapt to snow or black coal - if we keep looking only at them. But in the game - or in a good photo - we prefer to see coal black and snow white. In fact if we also factor in albedo (the color) of the surface being lit, we can improve the picture.

Snow from the adaptation standpoint becomes less bright (as the amount of light falling on it is not higher than falling on the dark mud), meaning the whole scene is considered less bright, making snow whiter - but details in shadows more clear. 

Black mud ‘becomes brighter’ (again, from an adaptation standpoint), but the specular from it does not blind out the picture (and mud itself starts to look darker). Dark wooden interiors will be more shadowed, but sky and snow in a window will also not blind the player.

Now (snow whiter, shadows are brighter) Was

Black mud "becomes" more bright, meaning less blinding reflections and better contrast of the mud itself

Now (mud is darker, reflections are less blinding)  Was

Dark wooden interiors will look darker, but snow and sky in the window will not blind you

Now (interiors darker, outside light does not blind) Was

Now Was

We hope our players will like those improvements!