[Bf-blender-cvs] [480ff89bf7c] master: Fix T75311, T75310: Edit Weight Paint Overlay Render Artifacts

Jeroen Bakker noreply at git.blender.org
Mon Apr 6 10:28:41 CEST 2020


Commit: 480ff89bf7cfb1f9ffd5ce66fbd5c65288ef04c0
Author: Jeroen Bakker
Date:   Mon Apr 6 10:21:29 2020 +0200
Branches: master
https://developer.blender.org/rB480ff89bf7cfb1f9ffd5ce66fbd5c65288ef04c0

Fix T75311, T75310: Edit Weight Paint Overlay Render Artifacts

During recent refactoring of the edit weight overlay we moved a
assignment before it was valid. Making everything one frame off what
resulted in a flashing frame during TAA, not drawing the overlay until a
second action happened, making overlays too bright.

The reason whas that the painting overlay wasn't initialized in the
first sample, but the draw passes and groups were filled. Resulting in
rendering the overlay twice or not at all.

This change moves the assignment to where it is valid.

===================================================================

M	source/blender/draw/engines/overlay/overlay_engine.c

===================================================================

diff --git a/source/blender/draw/engines/overlay/overlay_engine.c b/source/blender/draw/engines/overlay/overlay_engine.c
index 19b0fa5e12b..207637fa131 100644
--- a/source/blender/draw/engines/overlay/overlay_engine.c
+++ b/source/blender/draw/engines/overlay/overlay_engine.c
@@ -106,11 +106,12 @@ static void OVERLAY_cache_init(void *vedata)
   OVERLAY_Data *data = vedata;
   OVERLAY_StorageList *stl = data->stl;
   OVERLAY_PrivateData *pd = stl->pd;
-  const bool draw_edit_weights = (pd->edit_mesh.flag & V3D_OVERLAY_EDIT_WEIGHT);
 
   switch (pd->ctx_mode) {
     case CTX_MODE_EDIT_MESH:
       OVERLAY_edit_mesh_cache_init(vedata);
+      /* `pd->edit_mesh.flag` is valid after calling `OVERLAY_edit_mesh_cache_init`. */
+      const bool draw_edit_weights = (pd->edit_mesh.flag & V3D_OVERLAY_EDIT_WEIGHT);
       if (draw_edit_weights) {
         OVERLAY_paint_cache_init(vedata);
       }



More information about the Bf-blender-cvs mailing list