EyeAdaption

回想去电影院看电影。进入影厅,常常摸黑走到自己的座位上,但过了一段时间,却又能很容易看到周围的环境,譬如朋友买的饮料。电影结束灯亮起来时,又瞬间看清了影厅的环境。

从明亮的环境到昏暗的环境,人眼慢慢适应昏暗的环境,逐渐看清昏暗里的事物,和从昏暗的环境到明暗的环境,瞬间看清明暗里的事物。这就是人眼适应。

In ocular physiology, adaptation is the ability of the eye to ajust to various levels of darkness and light - Adaptation(eye) - wikipedia

在眼睛生理学中,适应是眼睛适应各种不同层次明暗的能力

EyeAdaption可以分为Dark AdaptationLight Adaptation, 分别是指从明到暗与从暗到明的适应过程。从生物学层面分析,人眼感受光线的范围很大,但在任意时刻只能感受相对小的范围。 感官组织cones和rods对光线的不同适应能力,导致人眼适应昏暗的时间比适应明亮的时间要长很多(Adaptation(eye) - wikipedia,Dark Adaptation)。

Visual Response to Darkness

EyeAdaption In game

Exposure Calculation

In Krzysztof Narkowicz Automatic exposure - knarkowicz blog:

Standard approach to automatic exposure is to compute scene’s geometric mean of luminance(log2 average) and map it to some “key value”:

Exposure Calculation

Then we multiply all pixels by exposure, add tone mapping, color grading and gama.

自动曝光的Exposure计算

自动曝光的标准方法是计算画面的对数明度的几何平均值L,通过[Lmin,Lmax]限制L的范围,通过KeyValue映射为Exposure,然后画面以Exposure系数曝光。

Temporal Adaptation

In Krzysztof Narkowicz Automatic exposure - knarkowicz blog:

Temporal Adaptation

时间适应

在由明到暗或者暗到明的过程中,exposure的数值是在一段时间内是动态变化的。为了模拟Dark AdaptationLight adaptation,需要通过时间差来过度exposure数值变化。

Auto Exposure Mathematic Model

  • Auto Exposure

  • Exposure Calculation

  • cache old luminance

  • Temporal Adaptation

  • Average Luminance

其中,KeyValue的默认值常设置为0.18(Middle gray - wikipedia); speed的取值在从明到暗或暗到明的过程中取值不一样,一般从明到暗的数值会比从暗到明的数值小。

EyeAdaptation in UE4

Eye Adaptation in UE4

Eye Adaptation in UE4中,当相机进入椅子的阴影时,画面的明度缓缓的发生变化。当相机从阴影中出来,画面的明度较快的恢复到之前的明暗度。

Reference