diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-06-19 00:50:35 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-06-19 00:50:35 +0400 |
commit | c9e98e848d18959a21596e98e786cb8898fee20c (patch) | |
tree | 12ad74cc40b35a2703be8a4e07d13462d95e965d /source/blender/blenkernel/intern/CCGSubSurf.c | |
parent | fd36fb8f636d3f7888e6579f8e1f340287a4119d (diff) |
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
Diffstat (limited to 'source/blender/blenkernel/intern/CCGSubSurf.c')
-rw-r--r-- | source/blender/blenkernel/intern/CCGSubSurf.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index 207956bc570..575c721bd54 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -1914,14 +1914,18 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss, 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); |