diff options
Diffstat (limited to 'source')
-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; |