HDR

Posted by Xingyu Wang on October 4, 2020

High dynamic range(HDR)

The idea of HDR is do not clamp color values to the range of [0.0, 1.0] until the final result.

HDR Off, looks uncomfortable, many details are lost

HDR On


Implementation

When texture is initialized with normalized fixed-point color format, the value will be clamped to the range of [0.0, 1.0] in OpenGL.

In order to have a color buffer that exceed this limit, the format should be specified as floating point framebuffer such as GL_RGBA32F.

32 in GL_RGBA32F means 32 bits for one color channel. The default size of 8 bits per channel.

This demo uses GL_RGBA16F, since 16 bits is enough for this demo.

Tone Mapping

Tone mapping maps color values to the range of [0.0, 1.0] which is low dynamic range(LDR). This demo uses Reinhard tone mapping.


Resource

https://learnopengl.com/Advanced-Lighting/HDR