diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-03-22 22:41:46 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-04-18 20:14:34 +0300 |
commit | 029b0df81aa116a3e29f405dc8902834242d5338 (patch) | |
tree | b14a14c4480b9ef826c5a786a479a49f0ca9291f /intern/cycles/util | |
parent | 41b3feea85cd8c323c1c5030f1ab0bc90438df4f (diff) |
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.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/transform.h | 15 |
1 files changed, 15 insertions, 0 deletions
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]); |