Fixed artifacts in link coloring.

This commit is contained in:
vinivendra 2016-02-20 14:13:28 -05:00
parent 7a59a03345
commit a9b95fb99a
2 changed files with 6 additions and 7 deletions

View File

@ -45,7 +45,7 @@ kernel void
float bendClose = 0.0;
float bendCloseCount = 0.0;
float red = 0.0;
float ball = 0.0;
for (x = 0; x < numberOfMetaballs; x += 1) {
float distance1 = metaballDistances[x];
@ -77,18 +77,17 @@ kernel void
bendCloseCount += 1.0;
}
red += step(0.4, weightedValue);
ball += step(0.4, weightedValue);
if (weightedLink > greatestLinkWeight) {
greatestLinkWeight = weightedLink;
float metaballValue = step(0.5, weightedValue + weightedLink);
if (metaballValue > 0.0) {
colorSumLink = float3(0.0, 0.0, 0.0);
colorSumLink += metaballColors[x] / distance1;
colorSumLink += metaballColors[y] / distance2;
colorSumLink /= (1 / distance1) + (1 / distance2);
}
float metaballValue = step(0.5, weightedValue + weightedLink);
sum += metaballValue;
}
}
@ -107,7 +106,7 @@ kernel void
colorSum = colorSum / colorAccumulation;
if (result > 0.0 && red < 1.0) {
if (result > 0.0 && ball < 1.0) {
colorSum = colorSumLink;
}