Texture painting - Erase alpha creates dark halo around alpha #80745

Closed
opened 2020-09-13 15:26:38 +02:00 by Daniel Bystedt · 9 comments
Member

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 442.59

Blender Version
Broken: version: 2.91.0 Alpha, branch: master, commit date: 2020-09-11 09:14, hash: 1b6dd42803
Worked: 2.91.0 Alpha, Hash 4ccd5bf5c6, date 2020-09-09 10:38

Likely caused by D8234: Use DrawManager for Image/UV Editor

Short description of error
When painting texture in the image editor and then erasing alpha, there is a dark halo around the pixels where alpha was erased.

Exact steps for others to reproduce the error

  1. Create a new image in the image editor
  2. enter paint mode
  3. paint colors in the image
  4. Change [brush settings > blend] to [erase alpha]
  5. Erase alpha on the image with the brush
  6. Start sampling the pixel values. The sampled colors appear "correct", but the pixel values on the displayed pixels look incorrect (i.e. too dark)

image.png

texture painting and alpha sample line.mp4

debug_D8234_texture_paint_erase_alpha_v001.blend

**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 442.59 **Blender Version** Broken: version: 2.91.0 Alpha, branch: master, commit date: 2020-09-11 09:14, hash: `1b6dd42803` Worked: 2.91.0 Alpha, Hash 4ccd5bf5c658, date 2020-09-09 10:38 Likely caused by [D8234: Use DrawManager for Image/UV Editor](https://archive.blender.org/developer/D8234) **Short description of error** When painting texture in the image editor and then erasing alpha, there is a dark halo around the pixels where alpha was erased. **Exact steps for others to reproduce the error** 1. Create a new image in the image editor 2. enter paint mode 3. paint colors in the image 4. Change [brush settings > blend] to [erase alpha] 5. Erase alpha on the image with the brush 6. Start sampling the pixel values. The sampled colors appear "correct", but the pixel values on the displayed pixels look incorrect (i.e. too dark) ![image.png](https://archive.blender.org/developer/F8872533/image.png) [texture painting and alpha sample line.mp4](https://archive.blender.org/developer/F8872536/texture_painting_and_alpha_sample_line.mp4) [debug_D8234_texture_paint_erase_alpha_v001.blend](https://archive.blender.org/developer/F8872532/debug_D8234_texture_paint_erase_alpha_v001.blend)
Author
Member

Added subscriber: @DanielBystedt

Added subscriber: @DanielBystedt
Author
Member

Added subscribers: @fclem, @Jeroen-Bakker

Added subscribers: @fclem, @Jeroen-Bakker
Author
Member

Jeroen Bakker messaged me on blender.chat and asked me to test the new submit D8234: Use DrawManager for Image/UV Editor, so I'm pinging @Jeroen-Bakker and @fclem to this bug report

Jeroen Bakker messaged me on blender.chat and asked me to test the new submit [D8234: Use DrawManager for Image/UV Editor](https://archive.blender.org/developer/D8234), so I'm pinging @Jeroen-Bakker and @fclem to this bug report
Member

Added subscriber: @brecht

Added subscriber: @brecht
Member

Hmm this seems to be a functional change. Blender 2.91 properly display pure emissive colors by default, these are colors where the RGB values are set, and Alpha is set to 0.0. But users might not expect this and have no way to control it.

Solutions

  1. Add an option (image flag) to display pure emissive colors in the UV/image editor. By default this is off, as tools expect this.
  2. Add addition channel modes to the UV/Image editor. But that seems to be cluttering the interface
    Color (emissive) Color + Alpha (emissive)
    ** Per channel (emmisive)
  3. A combination of the two solutions where the emissive channel modes are only there when the image flag is set to pure emissive.
  4. Add a space property to display pure emissive colors.
  5. Remove the support of pure emissive colors until ....

Personally I would suggest option 4 to be the best short term solution. The problem with the first solution is that when working on multi layer files (oir render results) the option would still be different based on the layer. On user perspective they might need to switch between the modes, but at least they have full control to what they want to see.

In order to support pure emissive colors from the ground up would need additional brush parameters and be sure that the compositors doesn't add artifacts.

@brecht do you have any suggestion?

Hmm this seems to be a functional change. Blender 2.91 properly display pure emissive colors by default, these are colors where the RGB values are set, and Alpha is set to 0.0. But users might not expect this and have no way to control it. **Solutions** 1. Add an option (image flag) to display pure emissive colors in the UV/image editor. By default this is off, as tools expect this. 2. Add addition channel modes to the UV/Image editor. But that seems to be cluttering the interface **Color (emissive)** Color + Alpha (emissive) ** Per channel (emmisive) 3. A combination of the two solutions where the emissive channel modes are only there when the image flag is set to pure emissive. 4. Add a space property to display pure emissive colors. 5. Remove the support of pure emissive colors until .... Personally I would suggest option 4 to be the best short term solution. The problem with the first solution is that when working on multi layer files (oir render results) the option would still be different based on the layer. On user perspective they might need to switch between the modes, but at least they have full control to what they want to see. In order to support pure emissive colors from the ground up would need additional brush parameters and be sure that the compositors doesn't add artifacts. @brecht do you have any suggestion?
Jeroen Bakker self-assigned this 2020-09-14 08:38:17 +02:00

This issue was referenced by f492c8d488

This issue was referenced by f492c8d488b7eb2166ca894e10a8128a1678a885

The image in the example .blend has byte colors. By convention, in Blender such images are always unpremultiplied and can not contain pure emissive colors. Only float images can, which use the premultiplied alpha convention.

So, to me it seems the image editor is not correctly drawing the image based on its alpha convention.

We should not add an option, especially not an option that is disabled by default. We really should be showing renders correct by default.

The image in the example .blend has byte colors. By convention, in Blender such images are always unpremultiplied and can not contain pure emissive colors. Only float images can, which use the premultiplied alpha convention. So, to me it seems the image editor is not correctly drawing the image based on its alpha convention. We should not add an option, especially not an option that is disabled by default. We really should be showing renders correct by default.
Member

The fox for #80746 also fixed this one. In the end it was an error in the shader logic. I reverted the option.

The fox for #80746 also fixed this one. In the end it was an error in the shader logic. I reverted the option.
Member

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

Changed status from 'Needs Triage' to: 'Resolved'
Thomas Dinges added this to the 2.91 milestone 2023-02-08 16:20:31 +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#80745
No description provided.