diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-04 02:39:35 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-04 15:11:04 +0300 |
commit | b2f1a6587410d00ad3bbd22e045979f80048afe2 (patch) | |
tree | 8312daea35aed37a1cdba6d6e6e97958b7f21d47 /source/blender/blenkernel/BKE_pbvh.h | |
parent | 1d8ed6dcd7cd2b3ccfaaacb59387dca481262eb6 (diff) |
Sculpt: Refactor draw manager sculpt drawing mechanism
Workbench/Eevee now displays multiple multi-materials correctly.
Iterate over pbvh nodes when doing object iteration. This makes the
rendering process more streamlined and allow for using different materials.
This change will make possible to:
- Add culling pass of each pbvh leaf node. (speedup if zoomed on a small
area)
- Reduce number of lead node iteration.
- Reduce code complexity
Diffstat (limited to 'source/blender/blenkernel/BKE_pbvh.h')
-rw-r--r-- | source/blender/blenkernel/BKE_pbvh.h | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h index f59288f54bd..9b15462de6b 100644 --- a/source/blender/blenkernel/BKE_pbvh.h +++ b/source/blender/blenkernel/BKE_pbvh.h @@ -40,6 +40,7 @@ struct MPoly; struct MVert; struct PBVH; struct PBVHNode; +struct GPU_PBVH_Buffers; typedef struct PBVH PBVH; typedef struct PBVHNode PBVHNode; @@ -48,6 +49,21 @@ typedef struct { float (*co)[3]; } PBVHProxyNode; +typedef enum { + PBVH_Leaf = 1, + + PBVH_UpdateNormals = 2, + PBVH_UpdateBB = 4, + PBVH_UpdateOriginalBB = 8, + PBVH_UpdateDrawBuffers = 16, + PBVH_UpdateRedraw = 32, + + PBVH_RebuildDrawBuffers = 64, + PBVH_FullyHidden = 128, + + PBVH_UpdateTopology = 256, +} PBVHNodeFlags; + /* Callbacks */ /* returns 1 if the search should continue from this node, 0 otherwise */ @@ -151,13 +167,15 @@ bool BKE_pbvh_node_find_nearest_to_ray(PBVH *bvh, void BKE_pbvh_draw_cb(PBVH *bvh, float (*planes)[4], float (*fnors)[3], - bool fast, - bool wires, - bool only_mask, bool show_vcol, - void (*draw_fn)(void *user_data, struct GPUBatch *batch), + void (*draw_fn)(void *user_data, struct GPU_PBVH_Buffers *buffers), void *user_data); +void BKE_pbvh_draw_debug_cb( + PBVH *bvh, + void (*draw_fn)(void *user_data, const float bmin[3], const float bmax[3], PBVHNodeFlags flag), + void *user_data); + /* PBVH Access */ typedef enum { PBVH_FACES, @@ -202,21 +220,6 @@ bool BKE_pbvh_bmesh_update_topology(PBVH *bvh, /* Node Access */ -typedef enum { - PBVH_Leaf = 1, - - PBVH_UpdateNormals = 2, - PBVH_UpdateBB = 4, - PBVH_UpdateOriginalBB = 8, - PBVH_UpdateDrawBuffers = 16, - PBVH_UpdateRedraw = 32, - - PBVH_RebuildDrawBuffers = 64, - PBVH_FullyHidden = 128, - - PBVH_UpdateTopology = 256, -} PBVHNodeFlags; - void BKE_pbvh_node_mark_update(PBVHNode *node); void BKE_pbvh_node_mark_rebuild_draw(PBVHNode *node); void BKE_pbvh_node_mark_redraw(PBVHNode *node); |