[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48059] trunk/blender/source/blender/ blenkernel/intern/CCGSubSurf.c: Fix for subsurf oscillations along creased boundary edges

Nicholas Bishop nicholasbishop at gmail.com
Mon Jun 18 22:50:36 CEST 2012


Revision: 48059
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48059
Author:   nicholasbishop
Date:     2012-06-18 20:50:35 +0000 (Mon, 18 Jun 2012)
Log Message:
-----------
Fix for subsurf oscillations along creased boundary edges

Changed the "exterior edge interior shift" section of subsurf calc to
always treat boundary edges the same, regardless of sharpness. We
should revisit subsurf creasing to see if more consistent and
predictable results are possible, but for now this a non-intrusive way
to avoid wavyness along the boundary.

Fixes bug [#31864] Artifacts when using Subsurf+Crease on plane
http://projects.blender.org/tracker/index.php?func=detail&aid=31864&group_id=9&atid=498

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/CCGSubSurf.c

Modified: trunk/blender/source/blender/blenkernel/intern/CCGSubSurf.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/CCGSubSurf.c	2012-06-18 20:50:25 UTC (rev 48058)
+++ trunk/blender/source/blender/blenkernel/intern/CCGSubSurf.c	2012-06-18 20:50:35 UTC (rev 48059)
@@ -1914,14 +1914,18 @@
 			avgSharpness = 0;
 		}
 
-		if (_edge_isBoundary(e) && (!e->numFaces || sharpCount < 2)) {
+		if (_edge_isBoundary(e)) {
 			for (x = 1; x < edgeSize - 1; x++) {
 				int fx = x * 2;
 				const float *co = EDGE_getCo(e, curLvl, x);
 				float *nCo = EDGE_getCo(e, nextLvl, fx);
+
+				/* Average previous level's endpoints */
 				VertDataCopy(r, EDGE_getCo(e, curLvl, x - 1), ss);
 				VertDataAdd(r, EDGE_getCo(e, curLvl, x + 1), ss);
 				VertDataMulN(r, 0.5f, ss);
+
+				/* nCo = nCo * 0.75 + r * 0.25 */
 				VertDataCopy(nCo, co, ss);
 				VertDataMulN(nCo, 0.75f, ss);
 				VertDataMulN(r, 0.25f, ss);




More information about the Bf-blender-cvs mailing list