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>2019-12-10 17:18:16 +0300
committerJeroen Bakker <jeroen@blender.org>2019-12-11 18:58:14 +0300
commit7878adf49cfff6ccbb18203f21c6355a518b34db (patch)
tree8f54eacad26647c6bd6db0b665ea4ff8063ab2ec /source/blender/editors/space_view3d
parent61e0e936441828c148b701c9a942d2ab6d9fe3a9 (diff)
DrawManager: Disable Clipping in material/rendered mode
Viewport: Disable Clipping For EEVEE and External Renderers Currently it is possible that, when using viewport clipping, the display and tools communicate different information to the user then the renderer does. The reason is that the renderer does not support viewport clipping. Both EEVEE and Cycles do not support it. This patch will disable the clipping in all the tools and drawing code when the viewport drawing mode is `Material Preview` or `Rendered`. This patch introduces a `RV3D_CLIPPING_ENABLED` util that checks if clipping is enabled for the given `rv3d` and `v3d`. Also in places where it was needed we added the `ViewContext` as a carrier for the `View3D` and `RegionView3D`. There are a few areas in the tooling (select, projection painting) that still needs to be tackled after this patch. Reviewed By: fclem Differential Revision: https://developer.blender.org/D6047
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_draw_legacy.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 6235f994272..061977d0c91 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -796,7 +796,7 @@ void ED_view3d_draw_depth(Depsgraph *depsgraph, ARegion *ar, View3D *v3d, bool a
GPU_clear(GPU_DEPTH_BIT);
- if (rv3d->rflag & RV3D_CLIPPING) {
+ if (RV3D_CLIPPING_ENABLED(v3d, rv3d)) {
ED_view3d_clipping_set(rv3d);
}
/* get surface depth without bias */
@@ -817,7 +817,7 @@ void ED_view3d_draw_depth(Depsgraph *depsgraph, ARegion *ar, View3D *v3d, bool a
WM_draw_region_viewport_unbind(ar);
- if (rv3d->rflag & RV3D_CLIPPING) {
+ if (RV3D_CLIPPING_ENABLED(v3d, rv3d)) {
ED_view3d_clipping_disable();
}
rv3d->rflag &= ~RV3D_ZOFFSET_DISABLED;
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index 17b575cedae..38cb5ad8651 100644
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@ -228,7 +228,7 @@ void ED_view3d_backbuf_depth_validate(ViewContext *vc)
if (obact_eval && ((obact_eval->base_flag & BASE_VISIBLE_DEPSGRAPH) != 0)) {
GPUViewport *viewport = WM_draw_region_get_viewport(ar, 0);
- DRW_draw_depth_object(vc->ar, viewport, obact_eval);
+ DRW_draw_depth_object(vc->ar, vc->v3d, viewport, obact_eval);
}
vc->v3d->flag &= ~V3D_INVALID_BACKBUF;
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index d7f7e96ba08..8b4012d6547 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -1099,7 +1099,7 @@ int view3d_opengl_select(ViewContext *vc,
GPU_depth_test(true);
}
- if (vc->rv3d->rflag & RV3D_CLIPPING) {
+ if (RV3D_CLIPPING_ENABLED(vc->v3d, vc->rv3d)) {
ED_view3d_clipping_set(vc->rv3d);
}
@@ -1167,7 +1167,7 @@ int view3d_opengl_select(ViewContext *vc,
GPU_depth_test(false);
}
- if (vc->rv3d->rflag & RV3D_CLIPPING) {
+ if (RV3D_CLIPPING_ENABLED(v3d, vc->rv3d)) {
ED_view3d_clipping_disable();
}