tone_mapping: add dynamic knee point adaptation tuning
Based on how close the target knee point is towards the 'extreme' values (min/max knee), we raise the adaptation strength dynamically. Significantly improves visual appearance of very bright/dark scenes, especially the sulphur pools clip.
Merge request reports
Activity
@haasn Hi! I'm currently looking through this implementation as i want to learn more about HDR->HDR tone mappings. It looks to me like this snippet has a flaw:
pl_smoothstep(max_knee, def_knee, target)
Shouldn't this bepl_smoothstep(def_knee, max_knee, target)
instead? Greets..@toxie No. The intent is to have a "bathtub curve", which goes to
0
at the lower and upper bounds, but has a value of1
atdef_knee
.pl_smoothstep(max_knee, def_knee, target)
is a function that is0
whentarget
is close tomax_knee
, and smoothly goes towards1
astarget
moves towardsdef_knee
.Keep in mind that
smoothstep(A, B, x)
is valid forA > B
, and in this case basically horizontally mirrors the overall shape of the curve.@haasn Thanks a lot for the clarification, i guess i'm stuck too much in the GPU world, where smoothstep() has that case undefined (according to spec at least).
@toxie huh, indeed it is - that's strange, given that the pseudocode they provide for the specification would works fine for
edge1 < edge0
also. In fact, that's exactly the code we use..