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
This commit is contained in:
parent
1677ddb7ee
commit
cacfaaa9a5
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user