diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-02-04 03:13:51 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-02-05 17:02:15 +0300 |
commit | 86193d25dbe5470a465dd91655c6aeaabab19b21 (patch) | |
tree | 9be350eeb300a08be68c1cdcaf59ea48f5724dcb /source/blender/draw/intern/draw_cache_impl.h | |
parent | f3f2602c88d866db6052ed03bbec1c9da4183e57 (diff) |
Edit Mesh: Refactor Edit cage drawing to use old style drawing
This is work in progress. Look is not final.
This align data VBO data structure used for edti cage drawing to the one
use for normal drawing.
We no longer use barycentric coords to draw the lines an just rasterize
line primitives for edge drawing. This is a bit slower than using the
previous fast method but faster than the "correct" (edge artifact free)
method. This also make the code way simpler.
This also makes it possible to reuse possible and normal vbos used for
shading if the edit cage matches the
This also touches the UV batch code to share as much render data as
possible. The code also prepare for edit cage "modified" drawing cage (with
modifier applied) but is not enabled since selection and operators does not
work with modified cage yet.
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl.h')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl.h | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl.h b/source/blender/draw/intern/draw_cache_impl.h index d6d244c81d0..ee91245fb1a 100644 --- a/source/blender/draw/intern/draw_cache_impl.h +++ b/source/blender/draw/intern/draw_cache_impl.h @@ -114,12 +114,9 @@ struct GPUBatch *DRW_mesh_batch_cache_get_surface_vertpaint(struct Mesh *me); struct GPUBatch *DRW_mesh_batch_cache_get_surface_weights(struct Mesh *me); /* edit-mesh drawing */ struct GPUBatch *DRW_mesh_batch_cache_get_edit_triangles(struct Mesh *me); -struct GPUBatch *DRW_mesh_batch_cache_get_edit_triangles_nor(struct Mesh *me); -struct GPUBatch *DRW_mesh_batch_cache_get_edit_triangles_lnor(struct Mesh *me); struct GPUBatch *DRW_mesh_batch_cache_get_edit_vertices(struct Mesh *me); -struct GPUBatch *DRW_mesh_batch_cache_get_edit_loose_edges(struct Mesh *me); -struct GPUBatch *DRW_mesh_batch_cache_get_edit_loose_edges_nor(struct Mesh *me); -struct GPUBatch *DRW_mesh_batch_cache_get_edit_loose_verts(struct Mesh *me); +struct GPUBatch *DRW_mesh_batch_cache_get_edit_edges(struct Mesh *me); +struct GPUBatch *DRW_mesh_batch_cache_get_edit_lnors(struct Mesh *me); struct GPUBatch *DRW_mesh_batch_cache_get_edit_facedots(struct Mesh *me); /* edit-mesh selection */ struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_select_id(struct Mesh *me); @@ -142,25 +139,27 @@ struct GPUBatch *DRW_mesh_batch_cache_get_uv_edges(struct Mesh *me); void DRW_mesh_cache_sculpt_coords_ensure(struct Mesh *me); /* Edit mesh bitflags (is this the right place?) */ - enum { - VFLAG_VERTEX_ACTIVE = 1 << 0, - VFLAG_VERTEX_SELECTED = 1 << 1, - VFLAG_VERTEX_EXISTS = 1 << 2, - VFLAG_FACE_ACTIVE = 1 << 3, - VFLAG_FACE_SELECTED = 1 << 4, - VFLAG_FACE_FREESTYLE = 1 << 5, + VFLAG_VERT_ACTIVE = 1 << 0, + VFLAG_VERT_SELECTED = 1 << 1, + VFLAG_EDGE_ACTIVE = 1 << 2, + VFLAG_EDGE_SELECTED = 1 << 3, + VFLAG_EDGE_SEAM = 1 << 4, + VFLAG_EDGE_SHARP = 1 << 5, + VFLAG_EDGE_FREESTYLE = 1 << 6, /* Beware to not go over 1 << 7 (it's a byte flag) * (see gpu_shader_edit_mesh_overlay_geom.glsl) */ }; enum { - VFLAG_EDGE_EXISTS = 1 << 0, - VFLAG_EDGE_ACTIVE = 1 << 1, - VFLAG_EDGE_SELECTED = 1 << 2, - VFLAG_EDGE_SEAM = 1 << 3, - VFLAG_EDGE_SHARP = 1 << 4, - VFLAG_EDGE_FREESTYLE = 1 << 5, + VFLAG_FACE_ACTIVE = 1 << 0, + VFLAG_FACE_SELECTED = 1 << 1, + VFLAG_FACE_FREESTYLE = 1 << 2, + VFLAG_VERT_UV_SELECT = 1 << 3, + VFLAG_VERT_UV_PINNED = 1 << 4, + VFLAG_EDGE_UV_SELECT = 1 << 5, + VFLAG_FACE_UV_ACTIVE = 1 << 6, + VFLAG_FACE_UV_SELECT = 1 << 7, /* Beware to not go over 1 << 7 (it's a byte flag) * (see gpu_shader_edit_mesh_overlay_geom.glsl) */ }; |