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-05-31 19:43:19 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-05-31 20:09:20 +0300
commit712885c30ef2a8dbde91b7d8b4ffb9784a70fca5 (patch)
treeec2e82668e1524b82d77d8b20950f56d6c0e7e4c /source/blender/draw/intern/draw_cache.c
parentf43e3d0b6bee3bef69649e4ebb85bdebdf19e8ce (diff)
DRW: Add wireframe buffer texture generation for wireframe drawing.
Only OB_MESH is supported for now. Creates a simple index buffer with negative indices if the edges is not a real edge. Also create the buffer texture representation of this buffer along with the pos_in_order buffer texture.
Diffstat (limited to 'source/blender/draw/intern/draw_cache.c')
-rw-r--r--source/blender/draw/intern/draw_cache.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c
index ddf41ceff8a..33fb801af5a 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -502,7 +502,6 @@ Gwn_Batch *DRW_cache_object_wire_outline_get(Object *ob)
}
}
-/* Returns a buffer texture. */
Gwn_Batch *DRW_cache_object_edge_detection_get(Object *ob, bool *r_is_manifold)
{
switch (ob->type) {
@@ -515,6 +514,19 @@ Gwn_Batch *DRW_cache_object_edge_detection_get(Object *ob, bool *r_is_manifold)
}
}
+/* Returns a buffer texture. */
+void DRW_cache_object_face_wireframe_get(
+ Object *ob, struct GPUTexture **r_vert_tx, struct GPUTexture **r_faceid_tx, int *r_tri_count)
+{
+ switch (ob->type) {
+ case OB_MESH:
+ DRW_mesh_batch_cache_get_wireframes_face_texbuf((Mesh *)ob->data, r_vert_tx, r_faceid_tx, r_tri_count);
+
+ /* TODO, should match 'DRW_cache_object_surface_get' */
+ }
+}
+
+
Gwn_Batch *DRW_cache_object_surface_get(Object *ob)
{
switch (ob->type) {