How to find an article to make HDR ?

Started by
6 comments, last by theScore 6 years, 7 months ago

Hi !

Do you know a good article which explains how to make HDR ? ( on internet or in a book )

Especially, how have to be the colors values in the pass before the tone mapping pass.

 

Advertisement
16 minutes ago, theScore said:

Hi !

Do you know a good article which explains how to make HDR ? ( on internet or in a book )

Especially, how have to be the colors values in the pass before the tone mapping pass.

 

What do you mean make HDR ? This does not make much sense as a question :)

Are you talking about turning on the HDR capability of modern UHD TVs ( and available with windows 10 creator update )

Are you talking about implementing a PBR  pipeline ?

The color before the tone mapping can be whatever you want, it is past the tone mapping, when you map the content to what the output expect that is important.

Before the Tonemapping, you usually store linear colors in an unclamp float format (like R11G11B10_FLOAT ), the color space primaries are either REC709/SRGB traditionally or REC2020 for the new HDR TVs with value from 0 to whatever you accumulate their.

After the tone mapping, you need to scale down things to the range the monitor accept, either it be [0..1] or [0..10000nits], with the proper encoding, SRGB or ST2084 for the display to be correct.

By HDR, I mean the technique used with directx or opengl to enhance colors beauty for 3D rendering.

I heard that HDR stores colors much higher values than a 256 range, so you know can I get these values which at the origin are between 0.0 and 1.0 or 0 and 255 ?

Yes, so does not make sense afterall :)

There is only two things to get the basics.

 

One, render to a surface that can represent values above one, like r11g11b11_float or r16g16b16a16_float.

Second, Apply tonemapping to compress the range back to 1 the simplest be "rgb/(rgb+1)"

 

That is all ! Then to looks good is all in details, pbr materials to looks good under various lighting condition and plausible, the choice of a brdf (usually ggx in game)and to be energy conservative, and do not screw up colorspace( albedo are srgb to be linearize, lighting in linear space, display go back to gammaspace srgb)

Thanks for your advices :)

But I have few questions :

What do you mean by srgb to linearize ?

What do you mean by linear space for lighting ?

The third part between the parenthesises  : "display go back to gammaspace srgb"


And can you explain me what is the "rgb/rgb+1" in the phrase : "Apply tonemapping to compress the range back to 1 the simplest be "rgb/(rgb+1)"

What is it used for ? ( for the prvious question)

Human eyes are more sensitive to low luminance, because of that, images are stored in gamma space or sRGB to give them enough bits in the dark area ( a 50% gray at 128 in your texture is in fact only 18% luminance in linear space). It means that when you read your albedo, you first need to convert it back to linear space, it is as simple as using a format for your texture view : DXGI_FORMAT_BC7_UNORM_SRGB versus DXGI_FORMAT_BC7_UNORM. The GPU will do the conversion for you, this is step one.

Step two, you are in linear space, and it is the correct one to accumulate lighting information ( also the proper space to do alpha blending ).

Step three if you were in a LDR pipeline ( so not our case ), the rendertarget is also a sRGB variant and the GPU do the opposite conversion for you. BUT, you want to do HDR, it means you do not have a sRGB variant format and that step is of your responsibility later !

Last step, now it is time to display your final image, you have linear space values in the range [0..infinity] and they need to map to [0..1] in gamma space, it is what your display understand. This is in two sub steps, first, the tone mapping pass, the formula rgb/(rgb+1) is called a tonemap operator. if you plot the curve, you will see the result is a compressed range of [0..infinity] scaled back to [0..1], it is what we need. Second substep, take the [0..1] range that is still in linear space to gamma space, either by applying the sRGB formula yourself or using a sRGB format variant to let the GPU do it fort you.

 

 

Ok thanks !

I understand that gamma space is the space for LDR screens, but to what corresponds "linear space" ?

This topic is closed to new replies.

Advertisement