reduce preview edges

This commit is contained in:
Andrew Sink
2026-03-21 10:50:18 -04:00
parent 27306ed596
commit ad39191a9f
2 changed files with 15 additions and 8 deletions
+2 -2
View File
@@ -248,7 +248,7 @@ const fragmentShader = /* glsl */`
// compute the distance from each pixel to the nearest boundary edge.
if (useDisplacement == 0 && boundaryFalloffDist > 0.001 && boundaryEdgeCount > 0) {
float minDist = boundaryFalloffDist;
for (int i = 0; i < 512; i++) {
for (int i = 0; i < 64; i++) {
if (i >= boundaryEdgeCount) break;
float uA = (float(i * 2) + 0.5) / boundaryEdgeTexWidth;
float uB = (float(i * 2 + 1) + 0.5) / boundaryEdgeTexWidth;
@@ -258,7 +258,7 @@ const fragmentShader = /* glsl */`
float abLen2 = dot(ab, ab);
float t = clamp(dot(vModelPos - ea, ab) / max(abLen2, 1e-10), 0.0, 1.0);
float d = length(vModelPos - (ea + t * ab));
minDist = min(minDist, d);
if (d < minDist) { minDist = d; if (d < 1e-4) break; }
}
maskBlend *= clamp(minDist / boundaryFalloffDist, 0.0, 1.0);
}