From 029b0df81aa116a3e29f405dc8902834242d5338 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 22 Mar 2022 20:41:46 +0100 Subject: Fix Cycles blackbody shader not taking into account OpenColorIO config Keep the existing Rec.709 fit and convert to other colorspace if needed, it seems accurate enough in practice, and keeps the same performance for the default case. --- intern/cycles/util/transform.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'intern/cycles/util') diff --git a/intern/cycles/util/transform.h b/intern/cycles/util/transform.h index 371dbb0f4aa..477272f0ba6 100644 --- a/intern/cycles/util/transform.h +++ b/intern/cycles/util/transform.h @@ -285,6 +285,21 @@ ccl_device_inline bool operator!=(const Transform &A, const Transform &B) return !(A == B); } +ccl_device_inline bool transform_equal_threshold(const Transform &A, + const Transform &B, + const float threshold) +{ + for (int x = 0; x < 3; x++) { + for (int y = 0; y < 4; y++) { + if (fabsf(A[x][y] - B[x][y]) > threshold) { + return false; + } + } + } + + return true; +} + ccl_device_inline float3 transform_get_column(const Transform *t, int column) { return make_float3(t->x[column], t->y[column], t->z[column]); -- cgit v1.2.3