Constants
Functions
from https://64.github.io/tonemapping/ reinhard on RGB oversaturates colors
luminance coefficients from Rec. 709. https://en.wikipedia.org/wiki/Rec._709
PBR Neutral tone mapping https://github.com/KhronosGroup/ToneMapping/blob/main/PBR_Neutral/pbrNeutral.glsl Adapted under Apache 2.0, per https://github.com/KhronosGroup/ToneMapping/tree/main/LICENSES
Source: Advanced VR Rendering, GDC 2015, Alex Vlachos, Valve, Slide 49 https://media.steampowered.com/apps/valve/2015/Alex_Vlachos_Advanced_VR_Rendering_GDC2015.pdf
This is an incredibly crude approximation of the inverse of the tone mapping function. We assume here that there’s a simple linear relationship between the input and output which is not true at all, but useful to at least preserve the overall luminance of colors when sampling from an already tonemapped image. (e.g. for transmissive materials when HDR is off)
Increase color saturation of the given color data. :param color: expected sRGB primaries input :param saturationAmount: expected 0-1 range with 1=neutral, 0=no saturation. – ref[2] [4]