[Bf-blender-cvs] [90eaade] opensubdiv-modifier: OpenSubdiv: Prevent garbage shading when displaying vertex colors/weights

Sergey Sharybin noreply at git.blender.org
Wed Aug 6 11:52:14 CEST 2014


Commit: 90eaadec823021355382b547fd07b6019ce3a318
Author: Sergey Sharybin
Date:   Wed Aug 6 15:49:52 2014 +0600
Branches: opensubdiv-modifier
https://developer.blender.org/rB90eaadec823021355382b547fd07b6019ce3a318

OpenSubdiv: Prevent garbage shading when displaying vertex colors/weights

This is for cases when vertex colors or weights are visualising. Currently
we don't have CD layers for this data and here we only make it so there's
no garbage displayed.

In the future we'll either need to have CD for this data or pass this data
as face-varying or vertex-varying data in OSD mesh.

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

M	source/blender/blenkernel/intern/subsurf_ccg.c

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

diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 0e8cb69..b7751e2 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -2825,6 +2825,17 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm,
 		int start_partition = 0, num_partitions = 0;
 		DMDrawOption draw_option = DM_DRAW_OPTION_NORMAL;
 
+		/* TODO(sergey): This is for cases when vertex colors or weights
+		 * are visualising. Currently we don't have CD layers for this data
+		 * and here we only make it so there's no garbage displayed.
+		 *
+		 * In the future we'll either need to have CD for this data or pass
+		 * this data as face-varying or vertex-varying data in OSD mesh.
+		 */
+		if (setDrawOptions == NULL) {
+			glColor3f(0.8f, 0.8f, 0.8f);
+		}
+
 		if (UNLIKELY(ccgSubSurf_prepareGLMesh(ss, true) == false)) {
 			return;
 		}




More information about the Bf-blender-cvs mailing list