Fix T68782: false occlusion in selecting vertices and edges with objects in any wire view
This commit is contained in:
@@ -151,12 +151,11 @@ static void draw_select_id_edit_mesh(SELECTID_StorageList *stl,
|
|||||||
|
|
||||||
BM_mesh_elem_table_ensure(em->bm, BM_VERT | BM_EDGE | BM_FACE);
|
BM_mesh_elem_table_ensure(em->bm, BM_VERT | BM_EDGE | BM_FACE);
|
||||||
|
|
||||||
struct GPUBatch *geom_faces;
|
|
||||||
DRWShadingGroup *face_shgrp;
|
|
||||||
if (select_mode & SCE_SELECT_FACE) {
|
if (select_mode & SCE_SELECT_FACE) {
|
||||||
geom_faces = DRW_mesh_batch_cache_get_triangles_with_select_id(me);
|
struct GPUBatch *geom_faces = DRW_mesh_batch_cache_get_triangles_with_select_id(me);
|
||||||
face_shgrp = DRW_shgroup_create_sub(stl->g_data->shgrp_face_flat);
|
DRWShadingGroup *face_shgrp = DRW_shgroup_create_sub(stl->g_data->shgrp_face_flat);
|
||||||
DRW_shgroup_uniform_int_copy(face_shgrp, "offset", *(int *)&initial_offset);
|
DRW_shgroup_uniform_int_copy(face_shgrp, "offset", *(int *)&initial_offset);
|
||||||
|
DRW_shgroup_call_no_cull(face_shgrp, geom_faces, ob);
|
||||||
|
|
||||||
if (draw_facedot) {
|
if (draw_facedot) {
|
||||||
struct GPUBatch *geom_facedots = DRW_mesh_batch_cache_get_facedots_with_select_id(me);
|
struct GPUBatch *geom_facedots = DRW_mesh_batch_cache_get_facedots_with_select_id(me);
|
||||||
@@ -165,11 +164,13 @@ static void draw_select_id_edit_mesh(SELECTID_StorageList *stl,
|
|||||||
*r_face_offset = initial_offset + em->bm->totface;
|
*r_face_offset = initial_offset + em->bm->totface;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
geom_faces = DRW_mesh_batch_cache_get_surface(me);
|
if (ob->dt >= OB_SOLID) {
|
||||||
face_shgrp = stl->g_data->shgrp_face_unif;
|
struct GPUBatch *geom_faces = DRW_mesh_batch_cache_get_surface(me);
|
||||||
|
DRWShadingGroup *face_shgrp = stl->g_data->shgrp_face_unif;
|
||||||
|
DRW_shgroup_call_no_cull(face_shgrp, geom_faces, ob);
|
||||||
|
}
|
||||||
*r_face_offset = initial_offset;
|
*r_face_offset = initial_offset;
|
||||||
}
|
}
|
||||||
DRW_shgroup_call_no_cull(face_shgrp, geom_faces, ob);
|
|
||||||
|
|
||||||
/* Unlike faces, only draw edges if edge select mode. */
|
/* Unlike faces, only draw edges if edge select mode. */
|
||||||
if (select_mode & SCE_SELECT_EDGE) {
|
if (select_mode & SCE_SELECT_EDGE) {
|
||||||
|
|||||||
@@ -204,14 +204,14 @@ static void select_cache_populate(void *vedata, Object *ob)
|
|||||||
/* The object indices have already been drawn. Fill depth pass.
|
/* The object indices have already been drawn. Fill depth pass.
|
||||||
* Opti: Most of the time this depth pass is not used. */
|
* Opti: Most of the time this depth pass is not used. */
|
||||||
struct Mesh *me = ob->data;
|
struct Mesh *me = ob->data;
|
||||||
struct GPUBatch *geom_faces;
|
|
||||||
if (e_data.context.select_mode & SCE_SELECT_FACE) {
|
if (e_data.context.select_mode & SCE_SELECT_FACE) {
|
||||||
geom_faces = DRW_mesh_batch_cache_get_triangles_with_select_id(me);
|
struct GPUBatch *geom_faces = DRW_mesh_batch_cache_get_triangles_with_select_id(me);
|
||||||
}
|
|
||||||
else {
|
|
||||||
geom_faces = DRW_mesh_batch_cache_get_surface(me);
|
|
||||||
}
|
|
||||||
DRW_shgroup_call_obmat(stl->g_data->shgrp_depth_only, geom_faces, ob->obmat);
|
DRW_shgroup_call_obmat(stl->g_data->shgrp_depth_only, geom_faces, ob->obmat);
|
||||||
|
}
|
||||||
|
else if (ob->dt >= OB_SOLID) {
|
||||||
|
struct GPUBatch *geom_faces = DRW_mesh_batch_cache_get_surface(me);
|
||||||
|
DRW_shgroup_call_obmat(stl->g_data->shgrp_depth_only, geom_faces, ob->obmat);
|
||||||
|
}
|
||||||
|
|
||||||
if (e_data.context.select_mode & SCE_SELECT_EDGE) {
|
if (e_data.context.select_mode & SCE_SELECT_EDGE) {
|
||||||
struct GPUBatch *geom_edges = DRW_mesh_batch_cache_get_edges_with_select_id(me);
|
struct GPUBatch *geom_edges = DRW_mesh_batch_cache_get_edges_with_select_id(me);
|
||||||
|
|||||||
Reference in New Issue
Block a user