I am looking to create a CTL that allows the use of DLOG within an ACES pipeline. I have looked at a few DCTL’s and adapted them to CTL, my results don’t seem right. Is anyone able to check and advise?
float dlog_to_lin(input varying float in) {
float out;
if ( in <= 0.14 )
{
out = (in - 0.0929) / 6.025;
}
else
{
out = (pow(10, 3.89616 * in - 2.27752) - 0.0108) / 0.9892;
}
return out;
}
const float xyz_to_acesAP0[3][3] = {{1.0498110175, 0.0, -0.0000974845},
{-0.4959030231, 1.3733130458, 0.0982400361},
{0.0, 0.0, 0.9912520182} };
void main
( input varying float rIn,
input varying float gIn,
input varying float bIn,
input varying float aIn,
output varying float rOut,
output varying float gOut,
output varying float bOut,
output varying float aOut
)
{
float rgb[3];
rgb[0] = dlog_to_lin(rIn);
rgb[1] = dlog_to_lin(gIn);
rgb[2] = dlog_to_lin(gIn);
float ACES[3] = mult_f3_f33(rgb, xyz_to_acesAP0);
rOut = ACES[0];
gOut = ACES[1];
bOut = ACES[2];
aOut = aIn;
}