Modified weighting of sharpness values for Chaikin crease method:

- semi-sharp edges prevented from decreasing by averaging with inf-sharp
    - averaging now includes only semi-sharp edges around the vertex
    - see regression/shapes/catmark_chaikin2
This commit is contained in:
barfowl 2014-09-18 19:13:55 -07:00
parent d02bfc48d2
commit 09789296d9

View File

@ -118,8 +118,10 @@ Crease::SubdivideEdgeSharpnessAtVertex(float edgeSharpness,
float sharpSum = 0.0f;
int sharpCount = 0;
for (int i = 0; i < incEdgeCountAtVertex; ++i) {
sharpCount += IsSharp(incEdgeSharpness[i]);
sharpSum += incEdgeSharpness[i];
if (IsSemiSharp(incEdgeSharpness[i])) {
sharpCount ++;
sharpSum += incEdgeSharpness[i];
}
}
if (sharpCount > 1) {
// Chaikin rule is 3/4 original sharpness + 1/4 average of the others
@ -155,8 +157,10 @@ Crease::SubdivideEdgeSharpnessesAroundVertex(int edgeCount,
float sharpSum = 0.0f;
int sharpCount = 0;
for (int i = 0; i < edgeCount; ++i) {
sharpCount += IsSharp(parentSharpness[i]);
sharpSum += parentSharpness[i];
if (IsSemiSharp(parentSharpness[i])) {
sharpCount ++;
sharpSum += parentSharpness[i];
}
}
//