Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-14 12:22:07 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-14 12:22:07 +0300
commitbe967c0b3c7ed898a061519b86aec1df7aa2c088 (patch)
tree03871610dbc8b8dc88985c1d3ee74b19d36a67d4 /intern
parent20421ef9528c562a39b92e18d3e1f858df228953 (diff)
Fix T64578: Cycles clamps HDR colors for 16bit integer image with colorspace
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/render/image.cpp9
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;
+ }
}
}