Commit: cacfaaa9a5114752daca709a19e85bb0ee5c26d3 Author: Lukas Stockner Date: Tue Nov 8 22:05:20 2022 +0100 Branches: master https://developer.blender.org/rBcacfaaa9a5114752daca709a19e85bb0ee5c26d3
Fix T92416: First render with unknown image colorspace looks different The issue here was that the Barbershop benchmark scene was saved with a custom OCIO config, which leads to some textures having a unknown colorspace when loading with a default installation. This is automatically fixed by Blender during image loading, but since Cycles queried the colorspace before actually loading the image, it didn't get the updated value in the first render. To fix this, just re-query the colorspace after the image is loaded. Note that non-packed images still get treated as raw data if the colorspace is unknown, but this is at least consistent and doesn't magically change when you press F12 a second time. Differential Revision: https://developer.blender.org/D16427 =================================================================== M intern/cycles/blender/image.cpp =================================================================== diff --git a/intern/cycles/blender/image.cpp b/intern/cycles/blender/image.cpp index aea79ad60ad..ecea06fb1cd 100644 --- a/intern/cycles/blender/image.cpp +++ b/intern/cycles/blender/image.cpp @@ -72,6 +72,11 @@ bool BlenderImageLoader::load_metadata(const ImageDeviceFeatures &, ImageMetaDat metadata.colorspace = u_colorspace_raw; } else { + /* In some cases (e.g. T94135), the colorspace setting in Blender gets updated as part of the + * metadata queries in this function, so update the colorspace setting here. */ + PointerRNA colorspace_ptr = b_image.colorspace_settings().ptr; + metadata.colorspace = get_enum_identifier(colorspace_ptr, "name"); + if (metadata.channels == 1) { metadata.type = IMAGE_DATA_TYPE_BYTE; } _______________________________________________ Bf-blender-cvs mailing list [email protected] List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
