[Bf-blender-cvs] [5a75ada8398] hair_guides hair_guides_grooming: Fix indexing for hair guide curve drawing.

Lukas Tönne noreply at git.blender.org
Thu May 24 12:42:08 CEST 2018


Commit: 5a75ada8398d24509869bff75a9f7e4bdf0fe0e5
Author: Lukas Tönne
Date:   Thu May 24 11:41:30 2018 +0100
Branches: hair_guides hair_guides_grooming
https://developer.blender.org/rB5a75ada8398d24509869bff75a9f7e4bdf0fe0e5

Fix indexing for hair guide curve drawing.

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

M	source/blender/draw/intern/draw_cache_impl_hair.c

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

diff --git a/source/blender/draw/intern/draw_cache_impl_hair.c b/source/blender/draw/intern/draw_cache_impl_hair.c
index 58ac4d8b4f4..9069ae7d3a8 100644
--- a/source/blender/draw/intern/draw_cache_impl_hair.c
+++ b/source/blender/draw/intern/draw_cache_impl_hair.c
@@ -377,7 +377,8 @@ static void hair_batch_cache_ensure_guide_curves(
 	GWN_INDEXBUF_DISCARD_SAFE(cache->guide_curve_edges);
 	
 	const unsigned int point_count = hair_export->totguideverts;
-	const unsigned int elems_count = hair_export->totguideverts - hair_export->totguidecurves;
+	/* One segment for each point, plus one for primitive restart index */
+	const unsigned int elems_count = hair_export->totguideverts + hair_export->totguidecurves;
 	
 	static Gwn_VertFormat format = { 0 };
 	static unsigned pos_id;



More information about the Bf-blender-cvs mailing list