Maniphest T80745

Texture painting - Erase alpha creates dark halo around alpha
Closed, ResolvedBUG

Assigned To
Jeroen Bakker (jbakker)
Authored By
Daniel Bystedt (dbystedt)
Sep 13 2020, 3:26 PM
Tags
  • BF Blender (2.91)
  • EEVEE & Viewport
  • Sculpt, Paint & Texture
Subscribers
Brecht Van Lommel (brecht)
Clément Foucault (fclem)
Daniel Bystedt (dbystedt)
Jeroen Bakker (jbakker)

Description

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: rB1b6dd42803df
Worked: 2.91.0 Alpha, Hash 4ccd5bf5c658, 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)

Revisions and Commits

rB Blender

Related Objects

Mentioned In
T80746: Image blur in compositor creates halo from alpha
Mentioned Here
T80746: Image blur in compositor creates halo from alpha
rB4ccd5bf5c658: Fix T80626: Crash adding custom-data layers after reloading the file
D8234: Use DrawManager for Image/UV Editor

Event Timeline

Daniel Bystedt (dbystedt) created this task.Sep 13 2020, 3:26 PM
Daniel Bystedt (dbystedt) added subscribers: Clément Foucault (fclem), Jeroen Bakker (jbakker).Sep 13 2020, 3:32 PM

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 (jbakker) and @Clément Foucault (fclem) to this bug report

Jeroen Bakker (jbakker) added a subscriber: Brecht Van Lommel (brecht).EditedSep 14 2020, 8:25 AM

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 Van Lommel (brecht) do you have any suggestion?

Jeroen Bakker (jbakker) claimed this task.Sep 14 2020, 8:36 AM
Jeroen Bakker (jbakker) mentioned this in T80746: Image blur in compositor creates halo from alpha.
Jeroen Bakker (jbakker) changed the subtype of this task from "Report" to "Bug".
Jeroen Bakker (jbakker) edited projects, added BF Blender (2.91), EEVEE & Viewport, Sculpt, Paint & Texture; removed BF Blender.
Jeroen Bakker (jbakker) added a commit: rBf492c8d488b7: Image Editor: Make Rendering of Pure Emissive Colors Optional.Sep 15 2020, 1:45 PM
Brecht Van Lommel (brecht) added a comment.Sep 15 2020, 2:23 PM

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.

Jeroen Bakker (jbakker) added a comment.Sep 15 2020, 2:34 PM

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

Jeroen Bakker (jbakker) closed this task as Resolved.Sep 15 2020, 2:34 PM