diff options
-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; + } } } |