[Bf-blender-cvs] [81db4d2b43] clay-engine: Added wire outlines

Clément Foucault noreply at git.blender.org
Wed Feb 1 00:29:28 CET 2017


Commit: 81db4d2b430edaa9b0d18d28b9a95b32fe2062f8
Author: Clément Foucault
Date:   Tue Jan 31 17:27:05 2017 +0100
Branches: clay-engine
https://developer.blender.org/rB81db4d2b430edaa9b0d18d28b9a95b32fe2062f8

Added wire outlines

===================================================================

M	source/blender/draw/engines/clay/clay.c

===================================================================

diff --git a/source/blender/draw/engines/clay/clay.c b/source/blender/draw/engines/clay/clay.c
index 844cd5b4ec..e187affaed 100644
--- a/source/blender/draw/engines/clay/clay.c
+++ b/source/blender/draw/engines/clay/clay.c
@@ -565,6 +565,8 @@ static void CLAY_create_cache(CLAY_PassList *passes, const struct bContext *C)
 		}
 
 		struct Batch *geom;
+		bool do_outlines, do_wires;
+
 		switch (ob->type) {
 			case OB_MESH:
 				geom = DRW_cache_surface_get(ob);
@@ -573,6 +575,10 @@ static void CLAY_create_cache(CLAY_PassList *passes, const struct bContext *C)
 				DRW_shgroup_call_add(depthbatch, geom, ob->obmat);
 				DRW_shgroup_call_add(default_shgrp, geom, ob->obmat);
 
+				do_outlines  = ((ob->base_flag & BASE_SELECTED) != 0);
+
+				DRW_shgroup_wire_outline(passes->wire_outline_pass, ob, false, do_wires, do_outlines);
+
 				/* When encountering a new material :
 				 * - Create new Batch
 				 * - Initialize Batch
@@ -586,7 +592,7 @@ static void CLAY_create_cache(CLAY_PassList *passes, const struct bContext *C)
 			case OB_CAMERA:
 			case OB_EMPTY:
 			default:
-			    DRW_shgroup_non_meshes(passes->non_meshes_pass, ob);
+				DRW_shgroup_non_meshes(passes->non_meshes_pass, ob);
 				break;
 		}
 
@@ -643,6 +649,7 @@ static void CLAY_view_draw(RenderEngine *UNUSED(engine), const struct bContext *
 
 	/* Pass 4 : Overlays */
 	DRW_framebuffer_texture_attach(buffers->default_fb, textures->depth, 0);
+	DRW_draw_pass(passes->wire_outline_pass);
 	DRW_draw_pass(passes->non_meshes_pass);
 	DRW_draw_pass(passes->ob_center_pass);




More information about the Bf-blender-cvs mailing list