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:
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c6
-rw-r--r--source/blender/editors/space_view3d/view3d_draw_legacy.c22
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c2
3 files changed, 9 insertions, 21 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 0d5240d8e86..a428b60643d 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -703,7 +703,6 @@ void ED_view3d_draw_depth(
Scene *scene = DEG_get_evaluated_scene(depsgraph);
RegionView3D *rv3d = ar->regiondata;
- short zbuf = v3d->zbuf;
short flag = v3d->flag;
float glalphaclip = U.glalphaclip;
int obcenter_dia = U.obcenter_dia;
@@ -727,7 +726,6 @@ void ED_view3d_draw_depth(
/* get surface depth without bias */
rv3d->rflag |= RV3D_ZOFFSET_DISABLED;
- v3d->zbuf = true;
GPU_depth_test(true);
DRW_draw_depth_loop(depsgraph, ar, v3d);
@@ -737,8 +735,8 @@ void ED_view3d_draw_depth(
}
rv3d->rflag &= ~RV3D_ZOFFSET_DISABLED;
- v3d->zbuf = zbuf;
- if (!v3d->zbuf) GPU_depth_test(false);
+ /* Reset default for UI */
+ GPU_depth_test(false);
U.glalphaclip = glalphaclip;
v3d->flag = flag;
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index 06cdba3f537..cfeb199de15 100644
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@ -210,7 +210,9 @@ static void backdrawview3d(
}
#endif
+#if 0 /* v3d->zbuf deprecated */
if (v3d->drawtype > OB_WIRE) v3d->zbuf = true;
+#endif
/* dithering and AA break color coding, so disable */
glDisable(GL_DITHER);
@@ -249,14 +251,8 @@ static void backdrawview3d(
GPU_scissor(ar->winrct.xmin, ar->winrct.ymin, BLI_rcti_size_x(&ar->winrct), BLI_rcti_size_y(&ar->winrct));
GPU_clear_color(0.0, 0.0, 0.0, 0.0);
- if (v3d->zbuf) {
- GPU_depth_test(true);
- GPU_clear(GPU_COLOR_BIT | GPU_DEPTH_BIT);
- }
- else {
- GPU_clear(GPU_COLOR_BIT);
- GPU_depth_test(false);
- }
+ GPU_depth_test(true);
+ GPU_clear(GPU_COLOR_BIT | GPU_DEPTH_BIT);
if (rv3d->rflag & RV3D_CLIPPING)
ED_view3d_clipping_set(rv3d);
@@ -273,7 +269,6 @@ static void backdrawview3d(
v3d->flag &= ~V3D_INVALID_BACKBUF;
G.f &= ~G_BACKBUFSEL;
- v3d->zbuf = false;
GPU_depth_test(false);
glEnable(GL_DITHER);
@@ -684,7 +679,7 @@ static void view3d_draw_bgpic(Scene *scene, Depsgraph *depsgraph,
ibuf = ibuf->mipmap[mip - 1];
}
- if (v3d->zbuf) GPU_depth_test(false);
+ GPU_depth_test(false);
glDepthMask(GL_FALSE);
GPU_blend(true);
@@ -718,7 +713,7 @@ static void view3d_draw_bgpic(Scene *scene, Depsgraph *depsgraph,
GPU_blend(false);
glDepthMask(GL_TRUE);
- if (v3d->zbuf) GPU_depth_test(true);
+ GPU_depth_test(true);
if (freeibuf)
IMB_freeImBuf(freeibuf);
@@ -878,22 +873,19 @@ void ED_view3d_draw_depth_gpencil(
Depsgraph *depsgraph, Scene *scene, ARegion *ar, View3D *v3d)
{
ViewLayer *view_layer = DEG_get_evaluated_view_layer(depsgraph);
- bool zbuf = v3d->zbuf;
/* Setup view matrix. */
ED_view3d_draw_setup_view(NULL, depsgraph, scene, ar, v3d, NULL, NULL, NULL);
GPU_clear(GPU_DEPTH_BIT);
- v3d->zbuf = true;
GPU_depth_test(true);
if (v3d->flag2 & V3D_SHOW_GPENCIL) {
ED_gpencil_draw_view3d(NULL, scene, view_layer, depsgraph, v3d, ar, true);
}
- v3d->zbuf = zbuf;
- if (!zbuf) GPU_depth_test(false);
+ GPU_depth_test(false);
}
/* *********************** customdata **************** */
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index aad2ac7284f..c9e915a6415 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -1004,7 +1004,6 @@ int view3d_opengl_select(
ED_view3d_draw_setup_view(vc->win, depsgraph, scene, ar, v3d, vc->rv3d->viewmat, NULL, &rect);
if (v3d->drawtype > OB_WIRE) {
- v3d->zbuf = true;
GPU_depth_test(true);
}
@@ -1050,7 +1049,6 @@ int view3d_opengl_select(
ED_view3d_draw_setup_view(vc->win, depsgraph, scene, ar, v3d, vc->rv3d->viewmat, NULL, NULL);
if (v3d->drawtype > OB_WIRE) {
- v3d->zbuf = 0;
GPU_depth_test(false);
}