diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-24 11:13:38 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-24 11:13:38 +0300 |
commit | be32168eb4909445c6250089db01fa3fa50c5589 (patch) | |
tree | eeac8103c6e1d36d37720b3e33147657d3e37789 /source/blender/draw/engines/workbench | |
parent | aa1b77dccbda5b57f857d27ed8f7d46544c82503 (diff) |
DRW: support clipping for object outlines (unselected)
Diffstat (limited to 'source/blender/draw/engines/workbench')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_deferred.c | 6 | ||||
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_forward.c | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c b/source/blender/draw/engines/workbench/workbench_deferred.c index 68f93a51425..ac473dbdf7d 100644 --- a/source/blender/draw/engines/workbench/workbench_deferred.c +++ b/source/blender/draw/engines/workbench/workbench_deferred.c @@ -753,7 +753,11 @@ static WORKBENCH_MaterialData *get_or_create_material_data( DRW_shgroup_stencil_mask(material->shgrp, (ob->dtx & OB_DRAWXRAY) ? 0x00 : 0xFF); DRW_shgroup_uniform_int(material->shgrp, "object_id", &material->object_id, 1); workbench_material_shgroup_uniform(wpd, material->shgrp, material, ob, true, true, interp); - + if (wpd->world_clip_planes) { + const DRWContextState *draw_ctx = DRW_context_state_get(); + RegionView3D *rv3d = draw_ctx->rv3d; + DRW_shgroup_world_clip_planes_from_rv3d(material->shgrp, rv3d); + } BLI_ghash_insert(wpd->material_hash, POINTER_FROM_UINT(hash), material); } return material; diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c index c8f3a9a7bff..66ee25c0d82 100644 --- a/source/blender/draw/engines/workbench/workbench_forward.c +++ b/source/blender/draw/engines/workbench/workbench_forward.c @@ -202,6 +202,11 @@ static WORKBENCH_MaterialData *get_or_create_material_data( } material->object_id = engine_object_data->object_id; DRW_shgroup_uniform_int(material->shgrp_object_outline, "object_id", &material->object_id, 1); + if (wpd->world_clip_planes) { + const DRWContextState *draw_ctx = DRW_context_state_get(); + RegionView3D *rv3d = draw_ctx->rv3d; + DRW_shgroup_world_clip_planes_from_rv3d(material->shgrp_object_outline, rv3d); + } BLI_ghash_insert(wpd->material_hash, POINTER_FROM_UINT(hash), material); } return material; |