diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-14 12:22:07 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-14 12:22:07 +0300 |
commit | be967c0b3c7ed898a061519b86aec1df7aa2c088 (patch) | |
tree | 03871610dbc8b8dc88985c1d3ee74b19d36a67d4 /intern | |
parent | 20421ef9528c562a39b92e18d3e1f858df228953 (diff) |
Fix T64578: Cycles clamps HDR colors for 16bit integer image with colorspace
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/render/image.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp index 9f2a5e57d42..cf1c5fbb446 100644 --- a/intern/cycles/render/image.cpp +++ b/intern/cycles/render/image.cpp @@ -186,6 +186,15 @@ void ImageManager::metadata_detect_colorspace(ImageMetaData &metadata, const cha * due to quantization in common cases. */ metadata.compress_as_srgb = (metadata.type == IMAGE_DATA_TYPE_BYTE || metadata.type == IMAGE_DATA_TYPE_BYTE4); + + /* If colorspace conversion needed, use half instead of short so we can + * represent HDR values that might result from conversion. */ + if (metadata.type == IMAGE_DATA_TYPE_USHORT) { + metadata.type = IMAGE_DATA_TYPE_HALF; + } + else if (metadata.type == IMAGE_DATA_TYPE_USHORT4) { + metadata.type = IMAGE_DATA_TYPE_HALF4; + } } } |