diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-12-04 03:30:07 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-12-04 19:52:32 +0300 |
commit | f1975a46390a5bf85bb7012375f9bc1e761fc516 (patch) | |
tree | a88b08c31c9ec6e8c3482831380b2663dc922954 /source/blender/draw/intern/draw_cache.h | |
parent | 89ef69d23c079d1006fdffc9fb63199eabc257a7 (diff) |
Wireframe: Optimization: Only draw triangles that have edges
This only happens after a certain threshold.
We sort triangles into 2 bins (start and end of the buffer) based on a
threshold and just draw the start bin if the wireframe slider is low enough.
This optimization is disabled for deformed meshes.
This should help resolve (to some extent) T58188.
Diffstat (limited to 'source/blender/draw/intern/draw_cache.h')
-rw-r--r-- | source/blender/draw/intern/draw_cache.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/draw/intern/draw_cache.h b/source/blender/draw/intern/draw_cache.h index 1eeef83c81e..0f262b37bd9 100644 --- a/source/blender/draw/intern/draw_cache.h +++ b/source/blender/draw/intern/draw_cache.h @@ -59,7 +59,7 @@ struct GPUBatch **DRW_cache_object_surface_material_get( struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len, bool use_hide, char **auto_layer_names, int **auto_layer_is_srgb, int *auto_layer_count); void DRW_cache_object_face_wireframe_get( - Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count); + Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count, bool reduce_len); /* Empties */ struct GPUBatch *DRW_cache_plain_axes_get(void); @@ -154,7 +154,7 @@ struct GPUBatch **DRW_cache_mesh_surface_shaded_get( struct GPUBatch **DRW_cache_mesh_surface_texpaint_get(struct Object *ob, bool use_hide); struct GPUBatch *DRW_cache_mesh_surface_texpaint_single_get(struct Object *ob); void DRW_cache_mesh_face_wireframe_get( - Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count); + Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count, bool reduce_len); void DRW_cache_mesh_sculpt_coords_ensure(struct Object *ob); @@ -165,7 +165,7 @@ struct GPUBatch **DRW_cache_curve_surface_shaded_get( struct GPUBatch *DRW_cache_curve_surface_verts_get(struct Object *ob); struct GPUBatch *DRW_cache_curve_edge_wire_get(struct Object *ob); void DRW_cache_curve_face_wireframe_get( - Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count); + Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count, bool reduce_len); /* edit-mode */ struct GPUBatch *DRW_cache_curve_edge_normal_get(struct Object *ob, float normal_size); struct GPUBatch *DRW_cache_curve_edge_overlay_get(struct Object *ob); @@ -177,7 +177,7 @@ struct GPUBatch *DRW_cache_text_surface_get(struct Object *ob); struct GPUBatch **DRW_cache_text_surface_shaded_get( struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len); void DRW_cache_text_face_wireframe_get( - Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count); + Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count, bool reduce_len); /* edit-mode */ struct GPUBatch *DRW_cache_text_cursor_overlay_get(struct Object *ob); struct GPUBatch *DRW_cache_text_select_overlay_get(struct Object *ob); @@ -187,7 +187,7 @@ struct GPUBatch *DRW_cache_surf_surface_get(struct Object *ob); struct GPUBatch **DRW_cache_surf_surface_shaded_get( struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len); void DRW_cache_surf_face_wireframe_get( - Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count); + Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count, bool reduce_len); /* Lattice */ struct GPUBatch *DRW_cache_lattice_verts_get(struct Object *ob); @@ -211,6 +211,6 @@ struct GPUBatch *DRW_cache_particles_get_prim(int type); struct GPUBatch *DRW_cache_mball_surface_get(struct Object *ob); struct GPUBatch **DRW_cache_mball_surface_shaded_get(struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len); void DRW_cache_mball_face_wireframe_get( - Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count); + Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count, bool reduce_len); #endif /* __DRAW_CACHE_H__ */ |