Cycles: Use half storage for 16bit files (e.g. 16bit pngs) as well.
authorThomas Dinges <blender@dingto.org>
Sun, 14 Aug 2016 20:22:21 +0000 (22:22 +0200)
committerThomas Dinges <blender@dingto.org>
Sun, 14 Aug 2016 20:24:29 +0000 (22:24 +0200)
Note: This only works for textures loaded from disk via OIIO, not packed textures. That's still a ToDo.

intern/cycles/render/image.cpp

index 24543601ef9bacc2ea8ac4b4bc330860857a859d..fae50f4ea5e2801f74b76c264fdbdf51364adfba 100644 (file)
@@ -176,7 +176,9 @@ ImageManager::ImageDataType ImageManager::get_image_metadata(const string& filen
                        }
 
                        /* check if it's half float */
-                       if(spec.format == TypeDesc::HALF)
+                       if(spec.format == TypeDesc::HALF ||
+                          spec.format == TypeDesc::USHORT ||
+                          spec.format == TypeDesc::SHORT)
                                is_half = true;
 
                        channels = spec.nchannels;