Inaccurate results when saving MaterialIDs to OpenEXR and loading them back into Blender #53381
Labels
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#53381
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Windows 7, 64 bit, Quadro 4000
Blender Version
Broken: 2.79 and following
Worked: unknown
Short description of error
I have a demo scene with around 3000 different MaterialIDs. When rendering the MaterialID pass and saving it out to OpenEXR Multilayer, and then read back in the file, the IDs between a Float (Half) and Float (Full) image are different. It seems like there are rounding errors. We did not notice such behavior when using a lower number of different IDs so far. I'm not sure if this really is a bug or a technical limitation, but I thought that Float (Half) should be able to store 65536 different IDs per channel no problem.
Exact steps for others to reproduce the error
Download the .blend file. Open it and hit F12 to render. Now, the image nodes should read the rendered EXR files back in. In the Image Editor, hold down the Mouse Button to see the Material Index Values. When previewing the floatHalf one, you'll notice that uneven indicies are mostly missing. The floatFull offers all of them.
blend file:
PassIndexProblem.blend
Changed status to: 'Open'
Added subscriber: @RainerTrummer
Added subscriber: @zeauro
I can confirm the problem on ubuntu 16.04 with 2.79 and master
f2842ac
.Float(Half) is storing uneven number until 2045. There is one cube corresponding to 2046. Then, 2 cubes corresponding to 2048,2050, 2052, etc...
Added subscriber: @brecht
Half floats can store maximum 65536, but definitely not all integers in between. I think we should always store ID passes with full float precision, regardless if the half float option is used.
See also "precision limitations on integer values" here:
https://en.wikipedia.org/wiki/Half-precision_floating-point_format
An extra problem in this .blend is that it's using a file output node, and that currently doesn't have a way to specify the channel output type (XYZ, RGB, ..), so we can't auto detect it. It would be good to add that, but regardless, best not to try saving IDs as half float. When saving a multilayer EXR directly from the render we can detect it though.
Changed status from 'Open' to: 'Archived'