|
|
|
|
@ -13,12 +13,12 @@ void main() |
|
|
|
|
tex = adjustSaturation(tex); |
|
|
|
|
|
|
|
|
|
// to preserve perceptual contrast, apply the inversion in gamma 2.2 space |
|
|
|
|
tex = nitsToEncoding(tex, gamma22_EOTF, destinationReferenceLuminance); |
|
|
|
|
tex = nitsToEncoding(tex, gamma22_EOTF, 0.0, destinationReferenceLuminance); |
|
|
|
|
tex.rgb /= max(0.001, tex.a); |
|
|
|
|
tex.rgb = vec3(1.0) - tex.rgb; |
|
|
|
|
tex *= modulation; |
|
|
|
|
tex.rgb *= tex.a; |
|
|
|
|
tex = encodingToNits(tex, gamma22_EOTF, destinationReferenceLuminance); |
|
|
|
|
tex = encodingToNits(tex, gamma22_EOTF, 0.0, destinationReferenceLuminance); |
|
|
|
|
|
|
|
|
|
gl_FragColor = nitsToDestinationEncoding(tex); |
|
|
|
|
} |
|
|
|
|
|