I am trying to understand the details of the tone mapping formulas in filmic v4, to see if I can get some “inspiration”, and I have some observations that would like to get confirmed by the experts.
First of all I would like to understand the behavior of the tone mapping curve alone. I might come back to the saturation and hue control in another post…
Let’s put aside the highlights reconstruction, and consider the simplest version with channel-by-channel tone mapping (
filmic_split_v2). For simplicity, let’s initially see what happens to the mid-grey point, step-by-step.
The black and white points are defined in EV values with respect to mid-grey. That is, a “white relative exposure” of +5EV means
white = 32 * mid-grey. Right?
For a symmetric dynamic range (
black_exposure = -white_exposure), the log conversion maps the linear values in the following way:
log(black) = 0
log(mid-grey) = 0.5
log(white) = 1
Next, the spline function maps log values back to the linear domain:
out = spline(log(in)).
spline(log(black)) = 0
spline(log(mid-grey)) = pow(mid-grey, 1/hardness)
spline(log(white)) = 1
That is, the black and white points are mapped to 0 and 1 respectively, and the mid-grey point is mapped to mid-grey raised to the
1/hardness power. Am I right?
Here is a typical example of tone-mapping curve wit a slight contrast and a symmetric dynamic range:
The plot in the UI shows the log-to-linear mapping of the spline curve, but does not include the final power function, controlled by the “hardness” parameter.
I find it interesting to look at the
linear-in -> linear-out curve as well, that is the result of the full chain
out = pow(spline(log(in)), hardness), so I modified the UI to plot this:
Here is the same, but with the horizontal/vertical scales going from 0 to 0.25 to zoom on the region around and below mid-grey. The mid-grey point is also marked in the plot:
One can see that the tone-mapping curve is steeper than the diagonal line below mid-grey, and is flatter than the diagonal at the mid-grey point. That is, the contrast in the mid-tones is lowered, even if the contrast parameter is > 1. I have played a bit with the various parameters, and as far as I can see this is always the case, except for very high values of the contrast… is this intentional?
I was also trying to achieve a “neutral” rendering in which the shadows and mid-tones are left unchanged and only the highlights are compressed. This would correspond to a curve that lies on the diagonal up to the mid-grey point (or higher), and then bends down to compress the highlights. However, I have not found any combination of parameters that behaves like this.
Setting both the contrast and the hardness to 1 (that is, a flat spline curve that maps mid-grey to mid-grey without an additional power function at the end), I obtain instead a curve that severely clips the dark end:
Is there a way to achieve “neutral shadows” with filmic V4?
@aurelienpierre I hope you find the time to read this rather long post…