【TA100】 LDR and HDR

1. Basic concepts of LDR and HDR

1.HDR, LDR, dynamic range

● Dynamic Range = Maximum Brightness/Minimum Brightness
● HDR = High Dynamic Range
● LDR = Low Dynamic Range
● ToneMapping: Convert ultra-high dynamic range (HDR) to low dynamic range (HDR) on our daily display screens LDR) process
● Some little cheese:
○ Because the screen brightness (physical) produced by different manufacturers is actually not uniform, then when we talk about LDR, it is a value ranging from 0 to 1, corresponding to different screens The above is to match the minimum brightness (0) and maximum brightness (1) of the current screen.
○ The brightness difference in nature is very large. For example, the light intensity of a candle is about 15, while the intensity of sunlight is about 10w. The difference is very large, with a super high dynamic range.
○ The maximum brightness of the screens we use daily is accumulated through a series of experiences, so it will not harm the eyes when used. However, in nature, for example, when we look directly at the sun, it will actually cause damage to the eyes. of.

2.LDR and HDR

LDR
● 8-bit precision
○ Supplement for 8-bit precision: 8-bit = 28= 256 (0~255)
● Single channel 0-1
● Commonly used LDR image storage formats include jpg/png, etc.
● Color picking in commonly used DCC tools Detectors, general pictures, and computer screens are all LDR
○ For example, 0-255 (256) in the color picker

HDR
● Much higher than 8-bit accuracy
● Single channel can exceed 1
● Commonly used HDR image storage formats include hdr/tif/exr/raw, etc. (many of which are common camera formats)
● HDRI, real world

Supplement: How does the camera map HDR to LDR
● First, calculate the exposure value and map it to the range that the camera can sense
○ Affected by aperture, shutter, sensor sensitivity, etc.
● Then input this value as a linear value and store it in In the picture (usually raw format)
● After that, it will go through a change (LUT), through the process of white balance, color correction, tone mapping, and gamma correction, and the final result is baked into a LUT (the picture of the LUT in pbr is this process result)
● The LUT format of each camera manufacturer is different.

3. Why you need HDR

● LDR can only compress and present the colors in reality
○ HDR can have better colors, higher dynamic range and richer details.
○ It can effectively prevent overexposure of the picture. Colors with a brightness value exceeding 1 can also be expressed well. The pixel brightness becomes normal and the visual communication is more realistic. Only
Insert image description here
HDR with a value exceeding 1 will have bloom. Effect, high-quality bloom effect can reflect the rendering quality of the picture
Insert image description here

4. Some URLs where you can directly download HDR images

● http://www.hdrlabs.com/sibl/archive.html
● https://www.openfootage.net/hdri-panorama/

2. HDR in Unity

v 1.HDR settings in Camera

Insert image description here
● If turned on, the scene will be rendered into an HDR image buffer
● The next step is screen post-processing: Bloom and ToneMapping
● During the ToneMapping process, HDR will be converted into LDR
● The LDR image will be sent to the display

2.Lightmap HDR settings

Insert image description here
● Selecting High Quality will enable HDR lightmap support, selecting Normal Quality will switch to using RGBM encoding
● RGBM encoding: store the color in the RGB channel, and store the multiplier (M) in the Alpha channel

3. HDR settings of color picker

● If you add [HDR] in front of the color parameter of the Property, it will be marked as HDR
● If the color is set to HDR, then an Intensity slider will appear in the color picker to adjust the intensity
● Each time the slider increases by 1 , the light intensity provided is doubled.
Insert image description here
Insert image description here

4. Advantages and Disadvantages of HDR

● Advantages
○ Parts with brightness exceeding 1 in the picture will not be cut off, which increases the details of the bright parts and reduces the exposure
○ Reduces the sense of color scale in the dark parts of the picture
○ Better supports the bloom effect
● Disadvantages
○ The rendering speed is slow and needs to be updated Multiple graphics memory
○ Does not support hardware anti-aliasing
○ Some low-end mobile phones do not support it

3. HDR and Bloom

1. Bloom implementation process
● Bloom is used to express the effect of halo
● Bloom implementation process
○ Render the original image
○ Calculate the highlight pixels that exceed a certain threshold
○ Perform Gaussian blur on the highlight pixels
○ Then superimpose the halo and form the image
Insert image description here

● Bloom process in Unity
○ Later courses will introduce it in detail
○ Calculate the highlight pixels in the first step of down sample, then continue to do down sample and save it in rt. After reaching a certain number of times (controlled by parameters), then Step by step up scale back, in the process will add the previous rt, step by step up sample back to the original.
○ Concepts such as downsampling and upsampling are discussed here, which will be covered in subsequent bloom courses. Here are some reference links:
Insert image description here

4. HDR and ToneMapping

1. ToneMapping concept
● Previous review: LDR range is 0 to 1, HDR can exceed 1;
● Concept of ToneMapping:
○ If you want to express higher dynamic range colors on the display, you must convert HDR to LDR (this The process is ToneMapping), and this mapping relationship is tone mapping.
● The example below is a linear brightness mapping
Insert image description here
● But this does not conform to our understanding of the real world. Therefore, basically all mappings are ultimately implemented through an S-curve.

2.ACES curve

● Academy Color Encording System
● It is the most popular and widely used ToneMapping mapping curve
● Effect: the contrast is improved, and the details of dark and bright parts can be well preserved
● Then color adjustment will be carried out on this basis
Insert image description here

3. Other types of ToneMapping curves

Insert image description here

4.LUT(Lookup Table)

● Simple understanding: it is a filter. Through LUT, you can output one set of RGB values ​​to another set of RGB values, thereby changing the exposure and color of the picture. ● Unlike ToneMapping, LUT changes between LDRs
. ToneMapping transforms HDR.
● The LUT that adjusts the RGB three channels is called a 3D LUT
○ The formats are as follows.
Insert image description here
You can also find the corresponding position of the LUT in the post-processing filter section of UE4
Insert image description here

Guess you like

Origin blog.csdn.net/weixin_45810196/article/details/131110318