diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-03-10 18:38:26 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-03-10 18:56:27 +0300 |
commit | eb20250d2a51cb6152c086a7f42194b95b67d9fd (patch) | |
tree | 3958a5a2702bdbbafe524ee2f9626ed224c814b3 /intern/opencolorio | |
parent | 1e7b2d0bc6d1f9346d8ffb0a86c02d661737ed31 (diff) |
Fix wrong white point of Linear ACES in config reading and the bundled config
The Blender/Cycles XYZ color space has a D65 white point instead of E, and
this was not correctly accounted for both in the OpenColor config reading code
and the bundled config.
This meant that since the OpenColorIO v2 upgrade, the Linear ACES color space
was not working correctly, and other OpenColorIO configs defining
aces_interchange were not interpreted correctly.
Diffstat (limited to 'intern/opencolorio')
-rw-r--r-- | intern/opencolorio/ocio_impl.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/intern/opencolorio/ocio_impl.cc b/intern/opencolorio/ocio_impl.cc index c4d7a0c4fe9..146d5d1a5a7 100644 --- a/intern/opencolorio/ocio_impl.cc +++ b/intern/opencolorio/ocio_impl.cc @@ -326,7 +326,8 @@ void OCIOImpl::configGetXYZtoRGB(OCIO_ConstConfigRcPtr *config_, float xyz_to_rg { ConstConfigRcPtr config = (*(ConstConfigRcPtr *)config_); - /* Default to ITU-BT.709 in case no appropriate transform found. */ + /* Default to ITU-BT.709 in case no appropriate transform found. + * Note XYZ is defined here as having a D65 white point. */ memcpy(xyz_to_rgb, OCIO_XYZ_TO_LINEAR_SRGB, sizeof(OCIO_XYZ_TO_LINEAR_SRGB)); /* Get from OpenColorO config if it has the required roles. */ @@ -336,12 +337,15 @@ void OCIOImpl::configGetXYZtoRGB(OCIO_ConstConfigRcPtr *config_, float xyz_to_rg if (config->hasRole("aces_interchange")) { /* Standard OpenColorIO role, defined as ACES2065-1. */ - const float xyz_to_aces[3][3] = {{1.0498110175f, -0.4959030231f, 0.0f}, - {0.0f, 1.3733130458f, 0.0f}, - {-0.0000974845f, 0.0982400361f, 0.9912520182f}}; + const float xyz_E_to_aces[3][3] = {{1.0498110175f, -0.4959030231f, 0.0f}, + {0.0f, 1.3733130458f, 0.0f}, + {-0.0000974845f, 0.0982400361f, 0.9912520182f}}; + const float xyz_D65_to_E[3][3] = { + {1.0521111f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 0.9184170f}}; + float aces_to_rgb[3][3]; if (to_scene_linear_matrix(config, "aces_interchange", aces_to_rgb)) { - mul_m3_m3m3(xyz_to_rgb, aces_to_rgb, xyz_to_aces); + mul_m3_series(xyz_to_rgb, aces_to_rgb, xyz_E_to_aces, xyz_D65_to_E); } } else if (config->hasRole("XYZ")) { |