HDR high-Dynamic Range illumination Rendering

Source: Internet
Author: User

1. What is HDR?

HDR is short for High-dynamic range. In real-time rendering, it is called high-Dynamic Range illumination rendering. It is an image ing technology that expresses the brightness range beyond the display's performance.

2 Why HDR?

Normally, the display can display pixels with RGB components between (0,255), that is, the backbuffer format that we finally present on the display is only r8g8b8 at most, each channel is 8 bits, in this way, the brightness and contrast are very limited. If we directly render the back buffer for the final display, a lot of details will be lost for scenes with a large contrast between light and shade, and the bright part will be completely white, the dark part is black again.

HDR rendering technology is designed to solve this problem. Based on the contrast between the light and shade of the scenario, It maps the non-linear tonemapping of HDR high-dynamic illumination to the LDR low-dynamic illumination range that the display can display, we try our best to save the contrast between light and shade to make the final rendering effect more realistic.

3. How to Implement HDR?

HDR is generally divided into the following steps,

1) render the entire scene to a floating point texture using RTT.

2) Use tone mapping to map the HDR floating point texture to the backbuffer of LDR.

The key step is how to perform tone mapping. The following describes two tone mapping algorithms.

Brightness is used in algorithms. The brightness of each pixel is calculated by L = 0.27r + 0.62g + 0.06b.

4 tone mapping algorithm 1

The basic principle is to linearly map the brightness to the range of (0, 1). The formula is as follows:

L indicates the brightness of the current pixel, and Lmax and Lmin indicate the maximum and minimum brightness of the image, respectively.

5 tone mapping algorithm 2:

1) calculate the average brightness using the following formula.

2) use the following formula to calculate the scaling factor.

L (x, y) indicates the brightness of the current pixel. The key is a constant. The size of the key determines the overall brightness and brightness of the ing scenario. Generally, the value is 0.18. Assume that the full black of the LDR surface (Computer Display) is 0, the full White is 1, and there are 9 Transitional gray scales between 0 and 1, and the gray scale value of the 6th grid in the middle is 0.18, the average brightness of the HDR scenario is mapped to 6th cells, which indicates that the average brightness of the LDR is equal to that of the HDR. of course, you can use different key values according to the scenario. The larger the key value, the more white the final result.

3) Calculate the final color value of the current pixel.

Here, color (X, Y) is the color value of the current pixel.

This algorithm is used in the hdrpipeline sample in direct SDK. Of course, in addition to tone mapping, the bloom post-processing is added to the sample to achieve the halo effect.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.