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.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.h')
-rw-r--r--source/blender/draw/intern/draw_cache.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/source/blender/draw/intern/draw_cache.h b/source/blender/draw/intern/draw_cache.h
index 0f262b37bd9..87021360108 100644
--- a/source/blender/draw/intern/draw_cache.h
+++ b/source/blender/draw/intern/draw_cache.h
@@ -58,8 +58,7 @@ struct GPUBatch *DRW_cache_object_loose_edges_get(struct Object *ob);
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, bool reduce_len);
+struct GPUBatch *DRW_cache_object_face_wireframe_get(Object *ob);
/* Empties */
struct GPUBatch *DRW_cache_plain_axes_get(void);
@@ -153,8 +152,7 @@ struct GPUBatch **DRW_cache_mesh_surface_shaded_get(
char **auto_layer_names, int **auto_layer_is_srgb, int *auto_layer_count);
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, bool reduce_len);
+struct GPUBatch *DRW_cache_mesh_face_wireframe_get(struct Object *ob);
void DRW_cache_mesh_sculpt_coords_ensure(struct Object *ob);
@@ -164,8 +162,7 @@ struct GPUBatch **DRW_cache_curve_surface_shaded_get(
struct Object *ob, struct GPUMaterial **gpumat_array, uint gpumat_array_len);
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, bool reduce_len);
+struct GPUBatch *DRW_cache_curve_face_wireframe_get(Object *ob);
/* 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);
@@ -176,8 +173,7 @@ struct GPUBatch *DRW_cache_text_edge_wire_get(struct Object *ob);
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, bool reduce_len);
+struct GPUBatch *DRW_cache_text_face_wireframe_get(Object *ob);
/* edit-mode */
struct GPUBatch *DRW_cache_text_cursor_overlay_get(struct Object *ob);
struct GPUBatch *DRW_cache_text_select_overlay_get(struct Object *ob);
@@ -186,8 +182,7 @@ struct GPUBatch *DRW_cache_text_select_overlay_get(struct Object *ob);
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, bool reduce_len);
+struct GPUBatch *DRW_cache_surf_face_wireframe_get(Object *ob);
/* Lattice */
struct GPUBatch *DRW_cache_lattice_verts_get(struct Object *ob);
@@ -210,7 +205,6 @@ struct GPUBatch *DRW_cache_particles_get_prim(int type);
/* Metaball */
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, bool reduce_len);
+struct GPUBatch *DRW_cache_mball_face_wireframe_get(Object *ob);
#endif /* __DRAW_CACHE_H__ */