Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2020-03-23 12:17:36 +0300
committerJeroen Bakker <jeroen@blender.org>2020-03-23 16:03:39 +0300
commit0b116a84c9380166337722f5d5b3e255e19951b8 (patch)
treef4a84f34d625a20d27838d6308a1b103caafe597 /source/blender/draw/engines/overlay/overlay_paint.c
parent6a5bd812b569d5fe1f09bd5610ce9d0c119f1a21 (diff)
Fix T74923: Weight Painting Overlay Invisible for In Front Objects
For In Front Objects we need to use the in front depth buffer. This patch will use the in front depth buffer and also makes sure that it is filled with the center pixel depth. Reviewed By: fclem Differential Revision: https://developer.blender.org/D7216
Diffstat (limited to 'source/blender/draw/engines/overlay/overlay_paint.c')
-rw-r--r--source/blender/draw/engines/overlay/overlay_paint.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_paint.c b/source/blender/draw/engines/overlay/overlay_paint.c
index e88a69b695e..bb0b124f2ae 100644
--- a/source/blender/draw/engines/overlay/overlay_paint.c
+++ b/source/blender/draw/engines/overlay/overlay_paint.c
@@ -28,6 +28,15 @@
#include "overlay_private.h"
+void OVERLAY_paint_init(OVERLAY_Data *vedata)
+{
+ OVERLAY_StorageList *stl = vedata->stl;
+ OVERLAY_PrivateData *pd = stl->pd;
+ const DRWContextState *draw_ctx = DRW_context_state_get();
+
+ pd->painting.in_front = draw_ctx->obact && (draw_ctx->obact->dtx & OB_DRAWXRAY);
+}
+
void OVERLAY_paint_cache_init(OVERLAY_Data *vedata)
{
const DRWContextState *draw_ctx = DRW_context_state_get();
@@ -194,12 +203,15 @@ void OVERLAY_paint_weight_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_paint_draw(OVERLAY_Data *vedata)
{
+ OVERLAY_StorageList *stl = vedata->stl;
+ OVERLAY_PrivateData *pd = stl->pd;
+
OVERLAY_PassList *psl = vedata->psl;
DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get();
if (DRW_state_is_fbo()) {
/* Pain overlay needs final color because of multiply blend mode. */
- GPU_framebuffer_bind(dfbl->default_fb);
+ GPU_framebuffer_bind(pd->painting.in_front ? dfbl->in_front_fb : dfbl->default_fb);
}
if (psl->paint_color_ps) {