|
|
|
|
@ -2,6 +2,7 @@ |
|
|
|
|
// SPDX-FileCopyrightText: 2023 Xaver Hugl <xaver.hugl@gmail.com> |
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later |
|
|
|
|
#include "colormanagement.glsl" |
|
|
|
|
|
|
|
|
|
precision highp float; |
|
|
|
|
precision highp sampler2D; |
|
|
|
|
precision highp sampler3D; |
|
|
|
|
@ -28,6 +29,8 @@ uniform sampler3D Csampler; |
|
|
|
|
uniform int Asize; |
|
|
|
|
uniform sampler2D Asampler; |
|
|
|
|
|
|
|
|
|
uniform float referenceLuminance; |
|
|
|
|
|
|
|
|
|
vec3 sample1DLut(in vec3 srcColor, in sampler2D lut, in int lutSize) { |
|
|
|
|
float lutOffset = 0.5 / float(lutSize); |
|
|
|
|
float lutScale = 1.0 - lutOffset * 2.0; |
|
|
|
|
@ -40,7 +43,7 @@ vec3 sample1DLut(in vec3 srcColor, in sampler2D lut, in int lutSize) { |
|
|
|
|
void main() |
|
|
|
|
{ |
|
|
|
|
vec4 tex = texture(src, texcoord0); |
|
|
|
|
tex = encodingToNits(tex, sourceNamedTransferFunction); |
|
|
|
|
tex = encodingToNits(tex, sourceNamedTransferFunction,referenceLuminance); |
|
|
|
|
tex.rgb /= max(tex.a, 0.001); |
|
|
|
|
tex.rgb /= referenceLuminance; |
|
|
|
|
tex.rgb = (toXYZD50 * vec4(tex.rgb, 1.0)).rgb; |
|
|
|
|
|