ACES IDT for DLOG

I am trying to create an CTL to use DLOG in an ACES pipeline. I have modified some DCTLS that I have found on the internet, though my results don’t look quite 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;
}

Duplicate post. See this post to contribute to the conversation: CTL Transformation DLOG to ACES

Locking this thread.