I'm reading the paper by Erik Reinhard et al. called "Photographic Tone Reproduction for Digital Images", it's also here:
http://www.cs.utah.edu/~reinhard/cdrom/
There is this equation #4:
Ld(x,y) = L(x,y)(1 + L(x,y)/L_white^2) / (1 + L(x,y))
"[If] L_white value is set to the maximum luminance in the scene L_max..."
There is also a source code by the authors and various implementations online.
My question is, there is one variant of the formula above which I cannot understand how and what it was derived from. Take a look for instance at Luxrender source code:
http://src.luxrender.net/lux/rev/f48943145d29#l3.77
scale[i] = ( post_scale * (1.0f + lum*recip_Y_white2) / (1.0f + lum) ); //* maxDisplayY;
There are new variables "pre_scale", "post_scale" and "burn" which the paper does not mention. They also compute L_white (= Y_white) very differently:
const float Y_white = pre_scale * alpha * burn;
Please, can anyone explain to me how to derive such algorithm? I assume it's based on the paper but I don't see how...