log average and HDR luminance computation

Started by
4 comments, last by ClementLuminy 17 years ago
Hello ! I'm investigating HDR rendering, and i do not understand why in the HDRPipeline sample of the DX sdk, and in nearly every other paper i have read, the use the Log Average of the luminance value ... I'have read somewhere that it's because luminance is a "Logarithmic value" ... but it do not really help me that much ! So, if anybody can explain me in a simple way, why do we use the log.... Thanks a lot !!!
Advertisement
I suppose I should try and answer this given I wrote that sample code [smile]

To be completely honest I don't know why the logarithm is used, especially given it's reversed in the exp() call.

Have you read Reinhard's original paper? I stuck to his model when implementing - I had a quick scan read now, but I didn't see any obvious explanation. Maybe reading through it will reveal something better..

Sorry I can't help any further! I'll push this over to GP&T as the regulars there are a smart bunch and might be able to explain it better [grin]

Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

OK !

Thanks you jack ...

and just to know, have you ever try to use the simple luminance and not the log luminance ?

Does the result is good ??

Thanks again !

Clement
Quote:Original post by ClementLuminy
have you ever try to use the simple luminance and not the log luminance ?
I experimented with a lot of variations whilst developing that sample code - but the final one was about as good as I found.

There are a lot of much better tonemapping operators out there and in general computer graphics Reinhard's original operator isn't really used anymore. A lot of the ones I read about used histograms which are difficult to implement...

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Quote:Original post by ClementLuminy
I'm investigating HDR rendering, and i do not understand why in the HDRPipeline sample of the DX sdk, and in nearly every other paper i have read, the use the Log Average of the luminance value ...

I'have read somewhere that it's because luminance is a "Logarithmic value" ... but it do not really help me that much !


There are simple and complex answers to that.

Here's the simplest explanation I could come up with :

The fact is that when you sum luminance values, since we're talking HDR images, there are points in the image that are very very much more luminous than the rest of the image (point light, spot, sun, specular highlights and so on). These very much more luminous points will be given a much bigger weight than anything else in your image, resulting in you overestimating the overall "key" of the image which in turn results in a very dark final image.

If you look at the logarithmic curve, you can see that the order of luminance is still preserved but that at the same time very high numbers get more and more compressed as they get higher. This is frequently used as a trick to represent very high variations that could not be represented on the same linear curve, as in population variations (that tend to be exponential), or stock market variations.

You need to realize though that it wouldn't work if :
- small variations in the high intensities were as important as small variations in the low intensities. Fortunately they are not. If you get a high intensity source, your eye or the camera will adapt to reduce the overall amount of lighting that you perceive by X, reducing at the same time the importance of small variations by a factor of X.
- there were no big variations in the image, all the values are approximately near a central value. As your eyes can distinguish contrast more than absolute intensity, you may need to find other ways to restitute the same amount of contrast (probably a topic in itself).
- there are a few very dark spots (compared to the rest of the image), and since the logarithmic curves gets to infinity as the luminance value tends to zero, you run the risk of giving too much weights to dark spots, resulting in an overbright image. One of the solution is to cut the logarithmic curve beyong a certain point. Pure black points are clamped to a positive luminance.

Now all this is arguable, but that should probably answer your question anyway.

LeGreg
Whoa !!
That's an anwser !!

Thanks a lot it was pretty clear and really help me !

I hope it will also help other people !

Thanks again !!

Clement

This topic is closed to new replies.

Advertisement