Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I found two ways of doing tone mapping (first, second):

//Ld - this part of the code is the same for both versions
float lum = dot(rgb, vec3(0.2126f, 0.7152f, 0.0722f));
float L = (scale / averageLum) * lum;
float Ld = (L * (1.0 + L / lumwhite2)) / (1.0 + L);
//first
vec3 xyY = RGBtoxyY(rgb);
xyY.z *= Ld;
rgb = xyYtoRGB(xyY);
//second
rgb = (rgb / lum) * Ld;

For an example pixel data above equations produces different results. Which way is correct ?

share|improve this question

closed as not a real question by Nicol Bolas, bummzack, Josh Petrie, Sean Middleditch, Byte56 Apr 8 '13 at 3:47

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
What is being asked here? –  Shotgun Ninja Apr 5 '13 at 20:53
2  
Which way looks better, go with that =) –  Patrick Hughes Apr 5 '13 at 21:23
1  
Background on what tone mapping is and what your goal is would be helpful. –  Tim Holt Apr 5 '13 at 21:34

1 Answer 1

up vote 5 down vote accepted

With tone mapping, there is no "correct" answer. You're trying to reduce an HDR image to an LDR one that somehow visually represents the luminance range present in the original, which is very subjective. Choosing a tone mapping equation is a matter of aesthetic judgement, not physics.

By the way, if you're interested in tone mapping, I would recommend also looking at the equation presented in John Hable's talk, Uncharted 2 HDR Lighting (slide 140 has the equation I'm talking about).

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.