Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-12-07 07:03:01 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-12-07 07:33:53 +0300
commite929cad7067875bb2f1815a01daae32e441f99b7 (patch)
treee20a4173feb9ebef5b217f4234a6f7d9866a3d6b /source/blender/draw/intern/draw_cache_impl.h
parent9f5a27c5be0a0f6a9f36360e618dcf5254ae689e (diff)
DRW: Rework wireframe overlay implementation
The shader is way simpler and run way faster on lower end hardware (2x faster on intel HD5000) but did not notice any improvement on AMD Vega. This also adds a few changes to the way the wireframes are drawn: - the slider is more linearly progressive. - optimize display shows all wires and progressively decrease "inner" wires intensity. This is subject to change in the future. - text/surface/metaballs support is pretty rough. More work needs to be done. This remove the optimization introduced in f1975a46390a5bf85bb7012375f9bc1e761fc516. This also removes the GPU side "sharpness" calculation which means that animated meshes with wireframe display will update slower. The CPU sharpness calculation has still room for optimization. Also it is not excluded that GPU calculation can be added back as a separate preprocessing pass (saving the computation result [compute or feedback]). The goal here was to have more speed for static objects and remove the dependency of having buffer textures with triangle count. This is preparation work for multithreading the whole DRW manager.
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl.h')
-rw-r--r--source/blender/draw/intern/draw_cache_impl.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl.h b/source/blender/draw/intern/draw_cache_impl.h
index 5e2061f7fe5..d316f63ffa2 100644
--- a/source/blender/draw/intern/draw_cache_impl.h
+++ b/source/blender/draw/intern/draw_cache_impl.h
@@ -75,15 +75,12 @@ struct GPUBatch *DRW_curve_batch_cache_get_triangles_with_normals(
struct GPUBatch **DRW_curve_batch_cache_get_surface_shaded(
struct Curve *cu, struct CurveCache *ob_curve_cache,
struct GPUMaterial **gpumat_array, uint gpumat_array_len);
-void DRW_curve_batch_cache_get_wireframes_face_texbuf(
- struct Curve *cu, struct CurveCache *ob_curve_cache,
- struct GPUTexture **verts_data, struct GPUTexture **face_indices, int *tri_count, bool reduce_len);
+struct GPUBatch *DRW_curve_batch_cache_get_wireframes_face(struct Curve *cu, struct CurveCache *ob_curve_cache);
/* Metaball */
struct GPUBatch *DRW_metaball_batch_cache_get_triangles_with_normals(struct Object *ob);
struct GPUBatch **DRW_metaball_batch_cache_get_surface_shaded(struct Object *ob, struct MetaBall *mb, struct GPUMaterial **gpumat_array, uint gpumat_array_len);
-void DRW_metaball_batch_cache_get_wireframes_face_texbuf(
- struct Object *ob, struct GPUTexture **verts_data, struct GPUTexture **face_indices, int *tri_count, bool reduce_len);
+struct GPUBatch *DRW_metaball_batch_cache_get_wireframes_face(struct Object *ob);
/* Curve (Font) */
struct GPUBatch *DRW_curve_batch_cache_get_overlay_cursor(struct Curve *cu);
@@ -96,7 +93,7 @@ struct GPUIndexBuf **DRW_displist_indexbuf_calc_triangles_in_order_split_by_mate
struct ListBase *lb, uint gpumat_array_len);
struct GPUBatch **DRW_displist_batch_calc_tri_pos_normals_and_uv_split_by_material(
struct ListBase *lb, uint gpumat_array_len);
-struct GPUVertBuf *DRW_displist_create_edges_overlay_texture_buf(ListBase *lb);
+struct GPUBatch *DRW_displist_create_edges_overlay_batch(ListBase *lb);
/* Lattice */
struct GPUBatch *DRW_lattice_batch_cache_get_all_edges(struct Lattice *lt, bool use_weight, const int actdef);
@@ -161,8 +158,7 @@ struct GPUBatch *DRW_mesh_batch_cache_get_facedots_with_select_id(struct Mesh *m
struct GPUBatch *DRW_mesh_batch_cache_get_edges_with_select_id(struct Mesh *me, uint select_id_offset);
struct GPUBatch *DRW_mesh_batch_cache_get_verts_with_select_id(struct Mesh *me, uint select_id_offset);
/* Object mode Wireframe overlays */
-void DRW_mesh_batch_cache_get_wireframes_face_texbuf(
- struct Mesh *me, struct GPUTexture **verts_data, struct GPUTexture **face_indices, int *tri_count, bool reduce_len);
+struct GPUBatch *DRW_mesh_batch_cache_get_wireframes_face(struct Mesh *me);
void DRW_mesh_cache_sculpt_coords_ensure(struct Mesh *me);