Page MenuHome

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

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)

Event Timeline

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

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?

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 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