First render of barbershop appears different #92416

Closed
opened 2021-10-22 18:43:00 +02:00 by William Leeson · 13 comments
Member
  1. Load the barbershop scene
  2. hit F12 to render
  3. save the image
  4. hit F12 to render again
  5. save the image
  6. now compare the 2 they are different
CPU_barbarshop.png CPU_barbarshop.png
1. Load the barbershop scene 2. hit F12 to render 3. save the image 4. hit F12 to render again 5. save the image 6. now compare the 2 they are different |![CPU_barbarshop.png](https://archive.blender.org/developer/F11391501/CPU_barbarshop.png)|![CPU_barbarshop.png](https://archive.blender.org/developer/F11391544/CPU_barbarshop.png)| | -- | -- |
Author
Member

Added subscriber: @leesonw

Added subscriber: @leesonw
Member

Added subscriber: @Alaska

Added subscriber: @Alaska
Member

I can reproduce this issue in Blender versions:
2.80
2.81
2.82
2.83
2.90
2.91
2.92
2.93
3.0

2.79 is the first version of Blender that doesn't show this issue.

However, rendering the scene once, then saving it, resolves the issue for every future time you open the file.

I can reproduce this issue in Blender versions: 2.80 2.81 2.82 2.83 2.90 2.91 2.92 2.93 3.0 2.79 is the first version of Blender that doesn't show this issue. However, rendering the scene once, then saving it, resolves the issue for every future time you open the file.

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Contributor

Added subscriber: @Raimund58

Added subscriber: @Raimund58
Contributor

Funny thing, I always thought it was a known issue and never reported it.

Funny thing, I always thought it was a known issue and never reported it.
Member

Added subscribers: @brecht, @LukasStockner

Added subscribers: @brecht, @LukasStockner
Lukas Stockner self-assigned this 2022-10-19 01:33:51 +02:00
Member

The problem here is related to some textures' colorspace setting.

In particular, some textures are set to sRGB EOTF, which the default Blender color config doesn't recognize. Therefore, IMB_colormanagement_check_file_config clears the colorspace property, assuming that it will be filled back in when the ImBuf is acquired the first time.

However, Cycles queries the image's colorspace in intern/cycles/blender/shader.cpp before the image is ever loaded, so it gets the empty value back. Later, the image is loaded (when BlenderImageLoader::load_metadata queries its size), so for the second render the colorspace is now initialized and everything works.

A simple fix is to call b_image.size() in add_node (in shader.cpp) before getting the colorspace so that it's initialized. I don't think this comes with performance concerns, since we would trigger an image load later anyways. @brecht, do you have a better idea?

The problem here is related to some textures' colorspace setting. In particular, some textures are set to `sRGB EOTF`, which the default Blender color config doesn't recognize. Therefore, `IMB_colormanagement_check_file_config` clears the colorspace property, assuming that it will be filled back in when the `ImBuf` is acquired the first time. However, Cycles queries the image's colorspace in `intern/cycles/blender/shader.cpp` before the image is ever loaded, so it gets the empty value back. Later, the image is loaded (when `BlenderImageLoader::load_metadata` queries its size), so for the second render the colorspace is now initialized and everything works. A simple fix is to call `b_image.size()` in `add_node` (in `shader.cpp`) before getting the colorspace so that it's initialized. I don't think this comes with performance concerns, since we would trigger an image load later anyways. @brecht, do you have a better idea?

We don't want to load images early, it should be done later and multi-threaded. We may also end up optimizing out the shader node using the image and not need to load it at all.

Could we set metadata.colorspace in BlenderImageLoader::load_metadata, for cases where the colorspace was not known earlier?

We don't want to load images early, it should be done later and multi-threaded. We may also end up optimizing out the shader node using the image and not need to load it at all. Could we set `metadata.colorspace` in `BlenderImageLoader::load_metadata`, for cases where the colorspace was not known earlier?

This issue was referenced by 1c27cc5529

This issue was referenced by 1c27cc55294a88a9472c8a4f7727fce4ebce6f30

This issue was referenced by 15b2b53b87

This issue was referenced by 15b2b53b87ab088e4869dfb0af991c9eb2be2d68

This issue was referenced by cacfaaa9a5

This issue was referenced by cacfaaa9a5114752daca709a19e85bb0ee5c26d3
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#92416
No description provided.