Page MenuHome

Fix T70807: Weight Paint Overlay XRay
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Mar 19 2020, 11:15 AM.

Details

Summary

Weight paint overlay was not working when XRay was turned on.

The Weight Paint overlay is rendered directly into the default
framebuffer with a depth equal test. This test fails as the depth won't match.
This patch will write also to the depth buffer.

Diff Detail

Repository
rB Blender
Branch
T70807 (branched from master)
Build Status
Buildable 7217
Build 7217: arc lint + arc unit

Event Timeline

Jeroen Bakker (jbakker) retitled this revision from Fix T70807: Weight Paint Overlay XRay/In Front to [WIP] Fix T70807: Weight Paint Overlay XRay/In Front.Mar 19 2020, 11:16 AM

Used wrong DrawState in previous patch

Jeroen Bakker (jbakker) retitled this revision from [WIP] Fix T70807: Weight Paint Overlay XRay/In Front to Fix T70807: Weight Paint Overlay XRay.Mar 19 2020, 11:54 AM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)

Merged with latest master

I don't know if we should commit this quick fix or go for a more in depth fix.

This proposed fix have ordering issue of faces with transparency.
I would propose to draw the mesh depth before doing the transparent pass.

source/blender/draw/engines/overlay/overlay_paint.c
42

This is a bit more tricky, the object can be transparent even in solid mode because of material alpha or object alpha.

Clément Foucault (fclem) requested changes to this revision.Mar 23 2020, 9:36 PM
This revision now requires changes to proceed.Mar 23 2020, 9:36 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Mar 24 2020, 8:12 AM

I don't know if we should commit this quick fix or go for a more in depth fix.

I will go for the in depth fix.

Jeroen Bakker (jbakker) marked an inline comment as done.
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
  • added a more indepth check to identify the blending mode
  • rebased with master

Moved the Wireframe mode check into paint_object_is_rendered_transparent

Clément Foucault (fclem) added inline comments.
source/blender/draw/engines/overlay/overlay_paint.c
176

you can reuse the same batch from DRW_cache_mesh_surface_weights_get to avoid creating more batches.

This revision is now accepted and ready to land.Mar 26 2020, 12:45 PM
This revision was automatically updated to reflect the committed changes.