Page MenuHome

T73434: Improve Weight Paint Overlay Drawing.
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Aug 9 2021, 11:56 AM.

Details

Summary

Master multiplied the weight paint on top of the rendered image. This
reduced readability.

This patch removes the multiplication for weight painting and adds a
hint of the geometry below the overlay.

Diff Detail

Repository
rB Blender

Event Timeline

Jeroen Bakker (jbakker) requested review of this revision.Aug 9 2021, 11:56 AM
Jeroen Bakker (jbakker) created this revision.


Life changing.

Why not make this an option (can be on by default), since there are times where it's useful to see the shading while weight painting, otherwise you can't see it's shape and bad deformations/distortion isn't as visible.

Simple before/after example, full reply here: T73434#1204210

Jeroen Bakker (jbakker) updated this revision to Diff 40676.EditedAug 13 2021, 2:26 PM
  • Show a hint of the geometry underneath the weight paint overlay.

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) added inline comments.
source/blender/draw/engines/overlay/shaders/paint_weight_frag.glsl
3

Need to find a better name for this.
It is the factor between showing a hint of the geometry (0.0) and the weight color (1.0).

71

Find better name.

Not sure if this effect is desirable, but I would do something like this in the vertex shader:

/* Saturate the weight to give a hint of the geometry behind the weights. */
vec3 view_normal = normalize(normal_object_to_view(nor));
vec3 light_dir = normalize(vec3(0.0, 0.5, 0.86602));
color_fac = max(dot(view_normal, light_dir), 0.0);
color_fac = 0.1 + (0.9 * color_fac);

This has the following effects:

  • The shades gradient simulates a light coming from a slightly upper angle instead of from the front, which integrates easier with other studiolights and matcaps. It also avoids accentuating shape contours too much.
  • Prevents completely dark areas and reduces the contrast of the gradient, introducing less distortion into the actual color data.

Current Patch:

Proposed:

  • Added arbitrary light to show a hint of the geometry.

I added the arbitrary light with some small adjustments so the light is also visible from the inside of the mesh.

I think it looks ok now.
I also found that there are artifacts when using this overlay in combination with wireframes. They were already there in the previous version, so it is probably better to fix that separately in D12235

Campbell Barton (campbellbarton) requested changes to this revision.EditedAug 17 2021, 8:03 AM

This looks like a good default. Although I think it should be possible not to have shading at all, wire-frame + weight paint has been shade-less for a long time, something I think could be kept as a way to see weights without any lighting (perhaps when lighting is set to "flat" too).


Previous it was possible to mix ambient occlusion for example, now the underlying shading can't be used at all. Personally I'm less worried about this, just noting it as something users might reasonably want.

If this comes up multiplying over existing shading could be made into an option.

This revision now requires changes to proceed.Aug 17 2021, 8:03 AM
  • In wireframe shading mode don't add fake shading to be consistent with master.
This revision is now accepted and ready to land.Aug 17 2021, 4:45 PM