Compositing: viewer node doesn't correctly preview 'set alpha' output #83353

Closed
opened 2020-12-03 09:46:24 +01:00 by Tomasz Kaye · 18 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce RTX 2060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 442.23
Graphics card: Radeon RX550/550 Series ATI Technologies Inc. 4.5.13596 Core Profile Context 20.11.3 27.20.11027.5002

Blender Version
Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-12-09 08:14, hash: 3a23f18e02

Short description of error

See screenshot below. Expected result: the circled viewer shows the cube silhouette in red. Instead we see solid red output
image.png

When the output of the set alpha node is connected to the composite node the viewer does display the expected result.
image.png

set_alpha_bug.blend

**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce RTX 2060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 442.23 Graphics card: Radeon RX550/550 Series ATI Technologies Inc. 4.5.13596 Core Profile Context 20.11.3 27.20.11027.5002 **Blender Version** Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-12-09 08:14, hash: `3a23f18e02` **Short description of error** See screenshot below. Expected result: the circled viewer shows the cube silhouette in red. Instead we see solid red output ![image.png](https://archive.blender.org/developer/F9429282/image.png) When the output of the set alpha node is connected to the composite node the viewer does display the expected result. ![image.png](https://archive.blender.org/developer/F9429298/image.png) [set_alpha_bug.blend](https://archive.blender.org/developer/F9429309/set_alpha_bug.blend)
Author

Added subscriber: @info-27

Added subscriber: @info-27
Tomasz Kaye changed title from Compositing: viewer node doesn't correctly preview image to Compositing: viewer node doesn't correctly preview 'set alpha' output 2020-12-03 09:48:04 +01:00

Added subscriber: @rjg

Added subscriber: @rjg

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

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

I can't reproduce this is the release version of 2.91.0 and you seem to be using a pre-release from 2020-10-15. Please download the release version and check if you can still reproduce the problem.

I can't reproduce this is the release version of 2.91.0 and you seem to be using a pre-release from 2020-10-15. Please download the release version and check if you can still reproduce the problem.
Author

I opened the test file in version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: 0f45cab862. I get the same result as in the opening post.

I opened the test file in version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: `0f45cab862`. I get the same result as in the opening post.

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'

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

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

Added subscriber: @iss

Added subscriber: @iss

I can reproduce getting solid red image in both cases. I would suspect though that this is because I am using slightly buggy GPU driver. So I am not sure if this is bug in Blender.

I can reproduce getting solid red image in both cases. I would suspect though that this is because I am using slightly buggy GPU driver. So I am not sure if this is bug in Blender.

This issue was referenced by 9dbea1db66

This issue was referenced by 9dbea1db66da5e277e8279811d66096751f38d29
Member

Added subscriber: @temeddix

Added subscriber: @temeddix
Member

I have the same problem. The problem lies in not only the viewer node but also image editor. It doesn't show the alpha correctly.
I'll attach the file that describes the problem. Hit render and you'll see what I mean.

icon.blend

To Summarize (2.91):

Way to see the composited result Does it show alpha correctly?
Backdrop O
Viewer Node X
Image Editor (showing viewer node) X
Saved Image File (with the 'save as' operator) O

Screenshot:
capture.png

Saved Image:
icon.png

I have the same problem. The problem lies in not only the viewer node but also image editor. It doesn't show the alpha correctly. I'll attach the file that describes the problem. Hit render and you'll see what I mean. [icon.blend](https://archive.blender.org/developer/F9578158/icon.blend) To Summarize (2.91): | Way to see the composited result | Does it show alpha correctly? | | --- | ---| | Backdrop | O | | Viewer Node | X | | Image Editor (showing viewer node) | X | | Saved Image File (with the 'save as' operator) | O | Screenshot: ![capture.png](https://archive.blender.org/developer/F9578776/capture.png) Saved Image: ![icon.png](https://archive.blender.org/developer/F9578777/icon.png)

The way Set Alpha works should be addressed by 9dbea1db66. Together with D10110 applied or manually replacing the old Set Alpha with the new one gives correct results for both the project from the original report and @temeddix.

I believe this can be closed as resolved, but I would suggest @info-27 and @temeddix to test Blender 2.93/2.92 once the patch D10110 has landed and see if this fixes the issue for you as well.

The way *Set Alpha* works should be addressed by 9dbea1db66. Together with [D10110](https://archive.blender.org/developer/D10110) applied or manually replacing the old *Set Alpha* with the new one gives correct results for both the project from the original report and @temeddix. I believe this can be closed as resolved, but I would suggest @info-27 and @temeddix to test Blender 2.93/2.92 once the patch [D10110](https://archive.blender.org/developer/D10110) has landed and see if this fixes the issue for you as well.
Member

I've done some tests and it seems the problem still remains in 2.92.
Using 'Replace Alpha' option in the new 'Set Alpha' node still makes the image editor show the wrong alpha.
Backdrop alpha was fine in 2.91, but now it's not in 2.92. It became broken.

Summarize(2.92):

Way to see the composited result Does it show alpha correctly?
Backdrop X
Viewer Node X
Image Editor (showing viewer node) X
Saved Image File (with the 'save as' operator) O

Screenshot:
icon.png

Saved Image File:
untitled.png

I've done some tests and it seems the problem still remains in 2.92. Using 'Replace Alpha' option in the new 'Set Alpha' node still makes the image editor show the wrong alpha. Backdrop alpha was fine in 2.91, but now it's not in 2.92. It became broken. Summarize(2.92): | Way to see the composited result | Does it show alpha correctly? | | --- | ---| | Backdrop | X | | Viewer Node | X | | Image Editor (showing viewer node) | X | | Saved Image File (with the 'save as' operator) | O | Screenshot: ![icon.png](https://archive.blender.org/developer/F9578768/icon.png) Saved Image File: ![untitled.png](https://archive.blender.org/developer/F9578770/untitled.png)

Based on your description and the tests on my own system the node behaves correct. The output from the RGB Curve node's color socket has RGB values greater zero in the areas where the result is supposed to be transparent. When the Set Alpha node is used with mode Replace, this only modifies the values in the alpha channel. Keep in mind the compositor is using premultiplied alpha, meaning that the output of Set Alpha in the outer area now have fully transparent but emissive pixels similar to a candle flame. That is the case because the pixels have alpha set to zero, but RGB value that aren't zero. Consequently you still see color displayed in the output despite the alpha being zero as this is not a screen-referred / straight alpha workflow in Blender. You will still see the "expected" result when exporting to a format like PNG though, which uses doesn't support premultiplied alpha and uses straight alpha instead.

What you actually want is to mask the outer pixels, so the RGB values need to be set to zero as well. That is why you need to use the Apply Mask mode for Set Alpha. This also sets the RGB values to zero, masking them out.

Based on your description and the tests on my own system the node behaves correct. The output from the *RGB Curve* node's color socket has RGB values greater zero in the areas where the result is supposed to be transparent. When the *Set Alpha* node is used with mode *Replace*, this only modifies the values in the alpha channel. Keep in mind the compositor is using premultiplied alpha, meaning that the output of *Set Alpha* in the outer area now have fully transparent but emissive pixels similar to a candle flame. That is the case because the pixels have alpha set to zero, but RGB value that aren't zero. Consequently you still see color displayed in the output despite the alpha being zero as this is not a screen-referred / straight alpha workflow in Blender. You will still see the "expected" result when exporting to a format like PNG though, which uses doesn't support premultiplied alpha and uses straight alpha instead. What you actually want is to mask the outer pixels, so the RGB values need to be set to zero as well. That is why you need to use the *Apply Mask* mode for *Set Alpha*. This also sets the RGB values to zero, masking them out.

@info-27 @iss This is also the case for your original post. When I said that I couldn't reproduce, I should've specified that I always get a completely red square. As explained above this is the expected result when the alpha is just replaced (Replace was the mode that the old node always used).

@info-27 @iss This is also the case for your original post. When I said that I couldn't reproduce, I should've specified that I always get a completely red square. As explained above this is the expected result when the alpha is just replaced (*Replace* was the mode that the old node always used).

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Robert Guetzkow self-assigned this 2021-01-14 16:25:38 +01:00

@info-27 Should the viewer node incorrectly display the background as transparent when it actually isn't please let us know and I can reopen the ticket.

@info-27 Should the viewer node incorrectly display the background as transparent when it actually isn't please let us know and I can reopen the ticket.
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#83353
No description provided.