diff options
author | Jeroen Bakker <jbakker> | 2020-05-11 16:15:26 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2020-05-12 08:58:37 +0300 |
commit | 24140444f2fb92292f93abbb472613d6cf7700a9 (patch) | |
tree | 6639e7d35cdad9f142101c59b399744fff38fd37 | |
parent | eaa21df5051c23ca0f3e7624be5f0bb86c891e08 (diff) |
Fix T75556: Select Emitter Object via Hair
{rB3685347b4172} introduced a conservative depth rendering for
selection. The conservative depth rendering assumed that all geometry
are triangle based. Hair is lined base.
This patch will use a normal depth shader for rendering hair.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D7661
-rw-r--r-- | source/blender/draw/engines/basic/basic_engine.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/draw/engines/basic/basic_engine.c b/source/blender/draw/engines/basic/basic_engine.c index 799359098fe..ab53f7025c0 100644 --- a/source/blender/draw/engines/basic/basic_engine.c +++ b/source/blender/draw/engines/basic/basic_engine.c @@ -79,6 +79,7 @@ static struct { typedef struct BASIC_PrivateData { DRWShadingGroup *depth_shgrp[2]; DRWShadingGroup *depth_shgrp_cull[2]; + DRWShadingGroup *depth_hair_shgrp[2]; } BASIC_PrivateData; /* Transient data */ /* Functions */ @@ -137,6 +138,9 @@ static void basic_cache_init(void *vedata) DRW_shgroup_uniform_vec2(grp, "sizeViewport", DRW_viewport_size_get(), 1); DRW_shgroup_uniform_vec2(grp, "sizeViewportInv", DRW_viewport_invert_size_get(), 1); + stl->g_data->depth_hair_shgrp[i] = grp = DRW_shgroup_create(sh_data->depth, + psl->depth_pass[i]); + state |= DRW_STATE_CULL_BACK; DRW_PASS_CREATE(psl->depth_pass_cull[i], state | clip_state | infront_state); stl->g_data->depth_shgrp_cull[i] = grp = DRW_shgroup_create(sh, psl->depth_pass_cull[i]); @@ -167,7 +171,7 @@ static void basic_cache_populate(void *vedata, Object *ob) const int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as; if (draw_as == PART_DRAW_PATH) { struct GPUBatch *hairs = DRW_cache_particles_get_hair(ob, psys, NULL); - DRW_shgroup_call(stl->g_data->depth_shgrp[do_in_front], hairs, NULL); + DRW_shgroup_call(stl->g_data->depth_hair_shgrp[do_in_front], hairs, NULL); } } } |