I am using a tonemapper in our project and a friend of mine asked if I could provide him with a plot of the tonemapper used (different functions are implemented). I tried in MATLAB to copy the tone-mapper function and use luma values from -5 to 5.0 to feed to the function, but the resulting plot is nothing like a classic tonemap function plot as I happen to see around. The function is totally correct, but am I missing something stupid that must be taken into account when trying to plot them?

  • 1
    \$\begingroup\$ You asking for help without showing code nor results, seriously? Are you sure thats even gamedev topic? \$\endgroup\$
    – Kromster
    Aug 15, 2014 at 19:22
  • \$\begingroup\$ @KromStern I can show results, but they're clearly wrong as I can show code, but is nothing more than what I described. What's the problem with this, isn't posting such code redundant? Also, it is a quite general question, to post generalized code it means to post three lines of MATLAB code. About the question about the "on-topicness" of the post, well, I figured that as HDR is used a lot in games, plotting something useful to the understanding of the tone mapping process could be related. \$\endgroup\$ Aug 15, 2014 at 19:41

1 Answer 1


Luma values should always be positive. You might be confusing it with log-luminance. A lot of these plots are shown with a log scale for the x axis. On a log scale you can see the characteristic "S curve", while on a scale whose x axis is linear luminance, it doesn't look like an S.

For example, my favorite tone curve is Jim Hejl's curve as reported by John Hable, used in Infamous Second Son and probably other games. Here's what the curve looks like in linear space (i.e. just graphing the equation on that slide):

enter image description here

Here's what it looks like if I convert the x-axis to a log scale (in other words, replace x by 2^x in the equation, so that x is now the log2 of luminance):

enter image description here

Now that looks more like the S-curve that I guess you were probably looking for. Here are the equations on Desmos if you want to play around with them.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .