diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-12-04 17:39:30 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-12-04 19:52:32 +0300 |
commit | 6f198f7851f8c8af4c55f86f0055d5da4c55d07d (patch) | |
tree | efeb21ea5b5d135a57d8ffcb9294a5b05d3c0f4a /source/blender/draw/intern/draw_cache.c | |
parent | f1975a46390a5bf85bb7012375f9bc1e761fc516 (diff) |
Wireframe: Optimization: Only draw triangles that have edges
This only happens after a certain wireframe threshold.
We sort triangles into 2 bins (start and end of the buffer) based on a
threshold and just draw the first bin if the wireframe slider is low enough.
This optimization is disabled for deformed meshes when playback is active.
This optimization is only implemented for meshes object for now.
This should help resolve (to some extent) T58188.
Diffstat (limited to 'source/blender/draw/intern/draw_cache.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index 51681f01849..2e13e1a343e 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -39,6 +39,7 @@ #include "BLI_math.h" #include "BLI_listbase.h" +#include "BKE_object.h" #include "BKE_object_deform.h" #include "GPU_batch.h" @@ -47,6 +48,8 @@ #include "MEM_guardedalloc.h" +#include "DRW_render.h" + #include "draw_cache.h" #include "draw_cache_impl.h" @@ -3067,6 +3070,9 @@ void DRW_cache_mesh_face_wireframe_get( { BLI_assert(ob->type == OB_MESH); + const DRWContextState *draw_ctx = DRW_context_state_get(); + reduce_len = reduce_len && !(DRW_state_is_playback() && BKE_object_is_deform_modified(draw_ctx->scene, ob)); + Mesh *me = ob->data; DRW_mesh_batch_cache_get_wireframes_face_texbuf(me, r_vert_tx, r_faceid_tx, r_tri_count, reduce_len); } |