From d74b89aed0310bcead9e17a8100f69b9b1872313 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 11 Oct 2018 13:45:50 +1100 Subject: DRW: add ability to skip drawing vertices --- source/blender/draw/intern/draw_cache_impl.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/draw/intern/draw_cache_impl.h') diff --git a/source/blender/draw/intern/draw_cache_impl.h b/source/blender/draw/intern/draw_cache_impl.h index 1aaedd39c85..27272769ec6 100644 --- a/source/blender/draw/intern/draw_cache_impl.h +++ b/source/blender/draw/intern/draw_cache_impl.h @@ -178,9 +178,10 @@ void DRW_mesh_cache_uvedit( enum { VFLAG_VERTEX_ACTIVE = 1 << 0, VFLAG_VERTEX_SELECTED = 1 << 1, - VFLAG_FACE_ACTIVE = 1 << 2, - VFLAG_FACE_SELECTED = 1 << 3, - VFLAG_FACE_FREESTYLE = 1 << 4, + VFLAG_VERTEX_EXISTS = 1 << 2, + VFLAG_FACE_ACTIVE = 1 << 3, + VFLAG_FACE_SELECTED = 1 << 4, + VFLAG_FACE_FREESTYLE = 1 << 5, /* Beware to not go over 1 << 7 (it's a byte flag) * (see gpu_shader_edit_mesh_overlay_geom.glsl) */ }; -- cgit v1.2.3 From 03d0219d7ae5916500a45b157bd7a637310ef494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 12 Oct 2018 15:09:43 +0200 Subject: Edit Mesh: Refactor edit mesh drawing This decouple the vertex display from the face+edges. This is to reduce the number of triangles required to fix the edges artifacts (aliasing) and increase viewport reactivity when not actively navigating (ie. mouse scroll). Also it makes all vertices visible (not cut-off) even when navigating. However it makes the navigation drawing a bit slower because it has to render twice. Also add a depth bias to the wires to avoid depth fighting when previewing final mesh (modifiers applied). --- source/blender/draw/intern/draw_cache_impl.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/draw/intern/draw_cache_impl.h') diff --git a/source/blender/draw/intern/draw_cache_impl.h b/source/blender/draw/intern/draw_cache_impl.h index 27272769ec6..575670319d8 100644 --- a/source/blender/draw/intern/draw_cache_impl.h +++ b/source/blender/draw/intern/draw_cache_impl.h @@ -143,10 +143,12 @@ struct GPUBatch *DRW_mesh_batch_cache_get_fancy_edges(struct Mesh *me); struct GPUBatch *DRW_mesh_batch_cache_get_edge_detection(struct Mesh *me, bool *r_is_manifold); struct GPUBatch *DRW_mesh_batch_cache_get_overlay_triangles(struct Mesh *me); struct GPUBatch *DRW_mesh_batch_cache_get_overlay_triangles_nor(struct Mesh *me); +struct GPUBatch *DRW_mesh_batch_cache_get_overlay_verts(struct Mesh *me); struct GPUBatch *DRW_mesh_batch_cache_get_overlay_loose_edges(struct Mesh *me); struct GPUBatch *DRW_mesh_batch_cache_get_overlay_loose_edges_nor(struct Mesh *me); struct GPUBatch *DRW_mesh_batch_cache_get_overlay_loose_verts(struct Mesh *me); struct GPUBatch *DRW_mesh_batch_cache_get_overlay_facedots(struct Mesh *me); +struct GPUTexture *DRW_mesh_batch_cache_get_overlay_data_tex(struct Mesh *me); /* edit-mesh selection (use generic function for faces) */ struct GPUBatch *DRW_mesh_batch_cache_get_facedots_with_select_id(struct Mesh *me, uint select_id_offset); struct GPUBatch *DRW_mesh_batch_cache_get_edges_with_select_id(struct Mesh *me, uint select_id_offset); -- cgit v1.2.3