A sample I whipped up for XNA info, based on code I developed for my own project. Walks through the basics of setting up an HDR pipeline (rendering, luminance calculation, bloom, exposure adjustement, tone mapping). Also demonstrates how to use LogLuv encoding so that fp16 surfaces don’t have to be used, which makes the implementation practical for the Xbox 360.
Is the last line in the ToneMap function incorrect?
e.g.
return fLumCompressed * vColor;
should really be:
return fLumCompressed * vColor / fLumPixel;
This corresponds to what I’ve seen in papers on HDR, and looks correct.
Yes what you have there is correct, it should be divided by the pixel luminance.