/* ********************************************* */ // // ACES IDT DCTL for 10-bit Filmic Pro Logv3 on iPhone 12 and higher in Davinci Resolve 17.4.6 // // Version: 1.0 / 2022_03_04 // This IDT was written by Philipp Hoyer but is free to use and edit in any possible way /* ********************************************* */ // // Camera : iPhone 12 & Filmic Pro Log v3 // Output : H.256, 10 Bit // Illuminant : Tested only under Daylight(D55) // /* ********************************************* */ /* vec3 u = exp2((inVec / 0.125) - 8.f) vec3 x = vec3(1.1612159730893894) vec3 y = vec3(0.6090138106343165) vec3 outVec = pow(u, mix(x, y, t: inVec)) */ DEFINE_ACES_PARAM(IS_PARAMETRIC_ACES_TRANSFORM: 0); __DEVICE__ float logv3_to_linear(float in) { float outvalue; float u = _exp2f((in / .125f) - 8.f); float x = 1.1612159730893894f; float y = 0.6090138106343165f; outvalue = _powf(u, (x * (1.f-in) + y * in)); return outvalue; } __DEVICE__ float3 transform(int p_Width, int p_Height, int p_X, int p_Y, float p_R, float p_G, float p_B) { float3 rgb = {p_R, p_G, p_B}; const float mtx[9] = {0.6788911506598102f,0.15886842237789234f,0.16224042703562752f, 0.04557083087232135f,0.8607127720474108f,0.0937163970408747f, -0.0004857103518124508f,0.025060195735059528f,0.9754255145687619f}; rgb.x = logv3_to_linear(rgb.x); rgb.y = logv3_to_linear(rgb.y); rgb.z = logv3_to_linear(rgb.z); float r2 = rgb.x * mtx[0] + rgb.y * mtx[1] + rgb.z * mtx[2]; float g2 = rgb.x * mtx[3] + rgb.y * mtx[4] + rgb.z * mtx[5]; float b2 = rgb.x * mtx[6] + rgb.y * mtx[7] + rgb.z * mtx[8]; return make_float3(r2, g2, b2); }