Compositor: Glare Node artifact in OpenEXR file with half float color depth #84167

Closed
opened 2020-12-27 06:10:12 +01:00 by 炎臻 · 9 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 980/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89

Blender Version
Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-12-26 22:50, hash: 7916c59304
Worked: Unknow


Short description of error

Extremely black shows up in the result after applying Glare node.
Below is an OpenEXR file viewed in blender render result with half float color depth and Glare effect:
Viewed from build-in render result.png Glare effect worked in the purple circle and looks fine.
But the actual file which saved as PNG has artifact:ArifactResult.png


Exact steps for others to reproduce the error

{icon fa-plus} Here is a zip containing the OpenEXR file above and a reproducible blender file I built up.
{F9531547}filelist.png The 4026.exr is the file which gets artifact after saving as a PNG and 0001Full Float.exr ,0001Half Float.exr are two files rendered from the "RepoduceScene.blend".
The RepoduceScene.blend:RepoduceSceneThumb.png Then they three are composited in CompositingGlareNode.blend:CompositingGlareNodeThumb.png In my practice,with OpenEXR format and half float color depth,I found the artifact occurs where the scene is extremely bright.In the reproducible scene a point light with 500MW is lighting the cube from an angle.
And if the color depth is set to full float the artifact is gone:CompositingGlareNodeFullFloat.png I don't know whether this is a limitation of color depth and color space conversion or a bug.
While the repoduced EXR files gets artifact in viewer,original one(4026.exr) only gets artifact after it is saved as another format (in my case:PNG,JPEG,JPEG,BMP)),the render result viewer in blender shows fine:CompositingGlareNodeOriginalOne.png

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 980/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89 **Blender Version** Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-12-26 22:50, hash: `7916c59304` Worked: Unknow --- ## Short description of error Extremely black shows up in the result after applying __Glare node__. Below is an OpenEXR file viewed in blender __render result__ with __half float__ color depth and Glare effect: ![Viewed from build-in render result.png](https://archive.blender.org/developer/F9531498/Viewed_from_build-in_render_result.png) Glare effect worked in the purple circle and looks fine. But the actual file which saved as PNG has artifact:![ArifactResult.png](https://archive.blender.org/developer/F9531513/ArifactResult.png) --- ## Exact steps for others to reproduce the error {icon fa-plus} Here is a zip containing the OpenEXR file above and a reproducible blender file I built up. {[F9531547](https://archive.blender.org/developer/F9531547/DataPackedup.7z)}![filelist.png](https://archive.blender.org/developer/F9531569/filelist.png) The __4026.exr__ is the file which gets artifact after saving as a PNG and __0001Full Float.exr__ ,__0001Half Float.exr__ are two files rendered from the "RepoduceScene.blend". The __RepoduceScene.blend__:![RepoduceSceneThumb.png](https://archive.blender.org/developer/F9531605/RepoduceSceneThumb.png) Then they three are composited in __CompositingGlareNode.blend__:![CompositingGlareNodeThumb.png](https://archive.blender.org/developer/F9531630/CompositingGlareNodeThumb.png) In my practice,with OpenEXR format and __half float__ color depth,I found the artifact occurs where the scene is extremely bright.In the reproducible scene a point light with 500MW is lighting the cube from an angle. And if the color depth is set to __full float__ the artifact is gone:![CompositingGlareNodeFullFloat.png](https://archive.blender.org/developer/F9531639/CompositingGlareNodeFullFloat.png) I don't know whether this is a limitation of color depth and color space conversion or a bug. While the repoduced EXR files gets artifact in viewer,original one(__4026.exr__) only gets artifact after it is saved as another format (in my case:PNG,JPEG,JPEG,BMP)),the render result viewer in blender shows fine:![CompositingGlareNodeOriginalOne.png](https://archive.blender.org/developer/F9531655/CompositingGlareNodeOriginalOne.png)
Author

Added subscriber: @PrettyFireNOI7

Added subscriber: @PrettyFireNOI7

Added subscribers: @Sergey, @rjg

Added subscribers: @Sergey, @rjg

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

I can reproduce the behavior. The issue appears to be that your file produces values that exceed the range of half-float which is +/- 65.504 (IEEE 754). The maximum RGB value in the 0001Full Float.exr file is 40852116.0. It seems that the floating point arithmetics result in -nan instead of nan, which produces pure black instead of white in the image.

This is quite an edge case. Perhaps COM_GlareStreaksOperation.cpp or parts of the pipeline that process the results could handle this better, but this may be seen different by the VFX module owner @sergey.

I can reproduce the behavior. The issue appears to be that your file produces values that exceed the range of half-float which is +/- 65.504 (IEEE 754). The maximum RGB value in the `0001Full Float.exr` file is 40852116.0. It seems that the floating point arithmetics result in -nan instead of nan, which produces pure black instead of white in the image. This is ~~quite~~ an edge case. Perhaps `COM_GlareStreaksOperation.cpp` or parts of the pipeline that process the results could handle this better, but this may be seen different by the VFX module owner @sergey.
Author

In #84167#1085343, @rjg wrote:
I can reproduce the behavior. The issue appears to be that your file produces values that exceed the range of half-float which is +/- 65.504 (IEEE 754). The maximum RGB value in the 0001Full Float.exr file is 40852116.0. It seems that the floating point arithmetics result in -nan instead of nan, which produces pure black instead of white in the image.

This is quite an edge case. Perhaps COM_GlareStreaksOperation.cpp or parts of the pipeline that process the results could handle this better, but this may be seen different by the VFX module owner @sergey.

Thank you.I understand it's an edge case and I had replaced the original file with Full Float EXR to fix the black area.
While as described(file 4026.exr ),I wonder why when viewing in Blender render viewer it "looks" correct but black shows up after saving to another format(like PNG).I think it would be less confusing if the render viewer has the matching result with the saved file.

> In #84167#1085343, @rjg wrote: > I can reproduce the behavior. The issue appears to be that your file produces values that exceed the range of half-float which is +/- 65.504 (IEEE 754). The maximum RGB value in the `0001Full Float.exr` file is 40852116.0. It seems that the floating point arithmetics result in -nan instead of nan, which produces pure black instead of white in the image. > > This is quite an edge case. Perhaps `COM_GlareStreaksOperation.cpp` or parts of the pipeline that process the results could handle this better, but this may be seen different by the VFX module owner @sergey. Thank you.I understand it's an edge case and I had replaced the original file with __Full Float EXR__ to fix the black area. While as described(file __4026.exr__ ),I wonder why when viewing in Blender render viewer it "looks" correct but black shows up after saving to another format(like PNG).I think it would be less confusing if the render viewer has the matching result with the saved file.
Sergey Sharybin self-assigned this 2021-01-11 16:16:36 +01:00

To me it seems that root of the problem is the glare node producing nan. Compositor shouldn't give nan numbers, as they cause all sort of issues. Full float EXR might be OK for your need, but in general nan will ruing someone's day eventually.

Will check on this issue deeper in a bit.

To me it seems that root of the problem is the glare node producing nan. Compositor shouldn't give nan numbers, as they cause all sort of issues. Full float EXR might be OK for your need, but in general nan will ruing someone's day eventually. Will check on this issue deeper in a bit.

This issue was referenced by 53bd58993e

This issue was referenced by 53bd58993e2f6d35452242762402c20343d6eef3

Have a deeper look and seems that to fix the root cause here we'd need to fix the half-float EXR saving.

Fix for this is coming shortly. After the fix the "bad" EXR images are to be re-saved though.

The Glare node might have some overflow issues, but so far with the given files i didn't see Glare to give nan/inf pixels.

Have a deeper look and seems that to fix the root cause here we'd need to fix the half-float EXR saving. Fix for this is coming shortly. After the fix the "bad" EXR images are to be re-saved though. The Glare node might have some overflow issues, but so far with the given files i didn't see Glare to give nan/inf pixels.

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'

Changed status from 'Needs Developer To Reproduce' 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
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#84167
No description provided.