Cycles: Baking to an externally loaded image fails to update the image buffer results in Cycle's Rendered Viewport Shading #98063

Open
opened 2022-05-12 03:17:03 +02:00 by yonghao lv · 11 comments

System Information
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2080 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.59

Blender Version
Broken: version: 3.3.0, 2.93
Worked: probably never

Short description of error
Baking to an externally loaded image will not changed the baked image as displayed in the Viewport Shading's Rendered Mode.
The newly baked image buffer is shown correctly in the image editor and (EEVEE's) Material Preview, but wrong in Cycles's render view.

Exact steps for others to reproduce the error

  • Open the attached .blend file.
  • Open the attached baked image in the image texture node.
  • Use it to bake any type of pass to the loaded image.
  • Observe that the image looks unchanged in the Rendered View by connecting the image texture node to the material output.
    #98063.blend
    suzzane-bake.png
    2022-05-12 09-12-20.mp4
**System Information** Operating system: Windows-10-10.0.22000-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 2080 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.59 **Blender Version** Broken: version: 3.3.0, 2.93 Worked: probably never **Short description of error** Baking to an externally loaded image will not changed the baked image as displayed in the Viewport Shading's Rendered Mode. The newly baked image buffer is shown correctly in the image editor and (EEVEE's) Material Preview, but wrong in Cycles's render view. **Exact steps for others to reproduce the error** - Open the attached .blend file. - Open the attached baked image in the image texture node. - Use it to bake any type of pass to the loaded image. - Observe that the image looks unchanged in the Rendered View by connecting the image texture node to the material output. [#98063.blend](https://archive.blender.org/developer/F13071842/T98063.blend) ![suzzane-bake.png](https://archive.blender.org/developer/F13071843/suzzane-bake.png) [2022-05-12 09-12-20.mp4](https://archive.blender.org/developer/F13069791/2022-05-12_09-12-20.mp4)
Author

Added subscriber: @1029910278

Added subscriber: @1029910278
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Can not reproduce this in recent 3.3 build
I'm using baked texture of suzzane to bake normal image of cube.
Can you repro with attached file?
Is it possible for you to upload your .blend file with packed textures?
#98025-2.blend

Can not reproduce this in recent 3.3 build I'm using baked texture of suzzane to bake normal image of cube. Can you repro with attached file? Is it possible for you to upload your .blend file with packed textures? [#98025-2.blend](https://archive.blender.org/developer/F13070317/T98025-2.blend)
Author

seems that it won't change the view if this image is loading external. When testing the package image, I have the same result with you

seems that it won't change the view if this image is loading external. When testing the package image, I have the same result with you
Author

the image rewrite after baking show correctly in the image editor, but wrong in the render view
image.png
when I tried to save it, it said
image.png

the image rewrite after baking show correctly in the image editor, but wrong in the render view ![image.png](https://archive.blender.org/developer/F13070836/image.png) when I tried to save it, it said ![image.png](https://archive.blender.org/developer/F13070835/image.png)
Member

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'
Pratik Borhade changed title from bake normal to an existing image fail( will not clear the baked image) to Cycles: Bake to an existing baked image fail in render view 2022-05-13 06:00:33 +02:00
Evan Wilson changed title from Cycles: Bake to an existing baked image fail in render view to Cycles: Baking to an externally loaded image fails to update the image buffer results in Cycle's Rendered Viewport Shading 2022-05-13 09:36:41 +02:00
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

I had a difficult time understanding this issue, so I went ahead and altered some of the grammar. Let me know if you feel my changes are inaccurate, and of course feel free to make changes yourselves as you see fit. =)

(using python api to new image to fail on baking normal, emit is find)

@1029910278 in order to better track issues individually, please report the issue with baking to images created via the python API separately if you haven't already.
Thank you =)

I had a difficult time understanding this issue, so I went ahead and altered some of the grammar. Let me know if you feel my changes are inaccurate, and of course feel free to make changes yourselves as you see fit. =) >(using python api to new image to fail on baking normal, emit is find) @1029910278 in order to better track issues individually, please report the issue with baking to images created via the python API separately if you haven't already. Thank you =)
Philipp Oeser removed the
Interest
Render & Cycles
label 2023-02-09 14:03:50 +01:00
Member

Hm, the issue here is that Cycles considers the image to be loaded and doesn't react to the update flag.

Baking triggers DEG_id_tag_update on the Image datablock through bake_targets_refresh, but BlenderSync::sync_recalc doesn't do anything for BL::Image updates.

In theory, we could react to updates and flag the image to be reloaded. However, there are two complications with this:

  • There's no straightforward BL::Image to ImageManager::Image mapping, this would require additional logic
  • BL::Image also gets updated when e.g. performing texture drawing, but currently viewport rendering doesn't show unsaved image modifications anyways so this would cause unnecessary reloads (unless we also change that by checking b_image.is_dirty() when deciding between BlenderImageLoader vs. Cycles' native loader).

Personally, I'd say this feels like enough of a corner case that it's not worth adding special logic for it, and we should treat is as a known limitation. @brecht, any opinions here?

Hm, the issue here is that Cycles considers the image to be loaded and doesn't react to the update flag. Baking triggers `DEG_id_tag_update` on the Image datablock through `bake_targets_refresh`, but `BlenderSync::sync_recalc` doesn't do anything for `BL::Image` updates. In theory, we could react to updates and flag the image to be reloaded. However, there are two complications with this: - There's no straightforward `BL::Image` to `ImageManager::Image` mapping, this would require additional logic - `BL::Image` also gets updated when e.g. performing texture drawing, but currently viewport rendering doesn't show unsaved image modifications anyways so this would cause unnecessary reloads (unless we also change that by checking `b_image.is_dirty()` when deciding between `BlenderImageLoader` vs. Cycles' native loader). Personally, I'd say this feels like enough of a corner case that it's not worth adding special logic for it, and we should treat is as a known limitation. @brecht, any opinions here?
Brecht Van Lommel added
Priority
Low
Type
Known Issue
and removed
Priority
Normal
Type
Bug
labels 2024-03-08 16:43:52 +01:00

Indeed the whole synchronization with images is limited currently, and can be considered a known issue. Hopefully in the future there will be some kind of dependency graph tracking of images in Blender, that we can hook Cycles into.

Indeed the whole synchronization with images is limited currently, and can be considered a known issue. Hopefully in the future there will be some kind of dependency graph tracking of images in Blender, that we can hook Cycles into.
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
5 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#98063
No description provided.