Multilayer EXR UDIMs display incorrectly #101320

Open
opened 2022-09-23 23:49:51 +02:00 by Michael Kowalski · 9 comments

Blender Version
Broken: since introduction of UDIM in 2.82

This issue was encountered when investigating #100452 (USD Alab v2 import errors)

The attached zip archive contains two blend files, which are identical except that they reference EXR and PNG UDIMs, respectively. alab_chair_exr_udim.blend, referencing the EXRs, displays incorrectly in the viewport (first image). alab_chair_png_udim.blend, referencing PNGs, displays correctly (second image).

image.png
image.png

blender_exr_udim_bug.zip

When the EXRs have multiple layers, even just 1, the problem occurs:

ok not ok - uses a single layer called 'rgb'
ok.png not-ok.png

Multilayer EXRs have a custom loading sequence and storage location inside the Image->rr (RenderResult) field.

That code is quite intertwined with the RenderLayer/RenderPass system. It's unclear why this was chosen for multi-layer images. Maybe because it was the system that knew how to select layers/passes already? In any case, it is not UDIM aware and I'm not sure if the RenderLayer/RenderPass system should be aware of them.

Since I don't have a full understanding of the history here a proper fix seems non trivial at first inspection.

**Blender Version** Broken: since introduction of UDIM in 2.82 This issue was encountered when investigating #100452 (USD Alab v2 import errors) The attached zip archive contains two blend files, which are identical except that they reference EXR and PNG UDIMs, respectively. `alab_chair_exr_udim.blend`, referencing the EXRs, displays incorrectly in the viewport (first image). `alab_chair_png_udim.blend`, referencing PNGs, displays correctly (second image). ![image.png](https://archive.blender.org/developer/F13561239/image.png) ![image.png](https://archive.blender.org/developer/F13561235/image.png) [blender_exr_udim_bug.zip](https://archive.blender.org/developer/F13561241/blender_exr_udim_bug.zip) When the EXRs have multiple layers, even just 1, the problem occurs: | ok | not ok - uses a single layer called 'rgb' | | -- | -- | | ![ok.png](https://archive.blender.org/developer/F13561308/ok.png) | ![not-ok.png](https://archive.blender.org/developer/F13561310/not-ok.png) | ---- Multilayer EXRs have a custom loading sequence and storage location inside the `Image->rr (RenderResult)` field. That code is quite intertwined with the RenderLayer/RenderPass system. It's unclear why this was chosen for multi-layer images. Maybe because it was the system that knew how to select layers/passes already? In any case, it is not UDIM aware and I'm not sure if the RenderLayer/RenderPass system should be aware of them. Since I don't have a full understanding of the history here a proper fix seems non trivial at first inspection.
Jesse Yurkovich was assigned by Michael Kowalski 2022-09-23 23:49:51 +02:00
Author
Member

Added subscriber: @makowalski

Added subscriber: @makowalski

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

Changed status from 'Needs Triage' to: 'Confirmed'
Jesse Yurkovich changed title from UDIM EXR textures display incorrectly to Multilayer EXR UDIMs display incorrectly 2022-09-24 03:39:22 +02:00
Jesse Yurkovich removed their assignment 2022-09-27 21:33:12 +02:00

Added subscriber: @deadpin

Added subscriber: @deadpin

Will place this up for grabs right now. This needs HQ insight to help fill in the history and decide how to proceed; will try to surface to them in the meantime.

Will place this up for grabs right now. This needs HQ insight to help fill in the history and decide how to proceed; will try to surface to them in the meantime.

Added subscriber: @NekoSilverfox

Added subscriber: @NekoSilverfox

Removed subscriber: @NekoSilverfox

Removed subscriber: @NekoSilverfox

Added subscriber: @brecht

Added subscriber: @brecht

That code is quite intertwined with the RenderLayer/RenderPass system. It's unclear why this was chosen for multi-layer images. Maybe because it was the system that knew how to select layers/passes already?

I expect it was just the quickest way to get something working at the time.

Since I don't have a full understanding of the history here a proper fix seems non trivial at first inspection.

A proper fix may indeed take some significant refactoring.

I think ideally UDIMs, layers/passes, views and even sequences should all be possible to combine in a single image datablock, and be orthogonal concepts. The image multilayer code outside of rendering should stop relying on RenderResult.

We already have a ListBase tiles and ListBase views in Image, I think we should also have a ListBase layers of ImageLayer, which contains a ListBase passes of ImagePass. These layer and pass lists can be populated from a file on disk, render result, and eventually manually created by the user. Views already work like this, and layers and pass populating and syncing could be done in all the same places.

Image buffers are currently stored in an image cache that has key (frame, view) , where frame is also abused as UDIM tile index. Instead the key should be (frame, view, tile, layer, pass).

> That code is quite intertwined with the RenderLayer/RenderPass system. It's unclear why this was chosen for multi-layer images. Maybe because it was the system that knew how to select layers/passes already? I expect it was just the quickest way to get something working at the time. > Since I don't have a full understanding of the history here a proper fix seems non trivial at first inspection. A proper fix may indeed take some significant refactoring. I think ideally UDIMs, layers/passes, views and even sequences should all be possible to combine in a single image datablock, and be orthogonal concepts. The image multilayer code outside of rendering should stop relying on `RenderResult`. We already have a `ListBase tiles` and `ListBase views` in `Image`, I think we should also have a `ListBase layers` of `ImageLayer`, which contains a `ListBase passes` of `ImagePass`. These layer and pass lists can be populated from a file on disk, render result, and eventually manually created by the user. Views already work like this, and layers and pass populating and syncing could be done in all the same places. Image buffers are currently stored in an image cache that has key `(frame, view)` , where `frame` is also abused as UDIM tile index. Instead the key should be `(frame, view, tile, layer, pass)`.

This also aligns with the plans for texture layers and baking, where we want to rely on multilayer images like this more. The idea there is to bake multiple passes to multilayer image datablocks. This datablock could then correspond to a single multilayer EXR file, but also e.g. separate PNG files for each pass. UDIM tiles, views and sequence frames are already separate image files in one image datablock so it's a natural extension to that.

This also aligns with the plans for texture layers and baking, where we want to rely on multilayer images like this more. The idea there is to bake multiple passes to multilayer image datablocks. This datablock could then correspond to a single multilayer EXR file, but also e.g. separate PNG files for each pass. UDIM tiles, views and sequence frames are already separate image files in one image datablock so it's a natural extension to that.
Bastien Montagne added
Type
Known Issue
and removed
Type
Report
labels 2023-02-10 12:08:49 +01:00
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
4 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#101320
No description provided.