fix(preview): smooth shading for all masked surfaces

- Remove flat-shaded MeshLambertMaterial overlay that was covering the
  custom shader output on user-masked faces (root cause of static shading)
- Pass smooth interpolated normal (vSmoothNormal) to fragment shader and
  blend toward it on masked faces so they get smooth view-dependent
  lighting instead of flat per-face shading
- Brighten user-mask color to warm orange (0.85, 0.40, 0.15) for better
  visibility of lighting variation on masked surfaces
- Shader now handles all mask visualization consistently: exclude mode
  (orange), include-only mode (orange for unselected), and angle mask
  (grey) all receive identical smooth shading
This commit is contained in:
CNCKitchen
2026-04-06 16:10:50 +02:00
parent 5eb8264f78
commit 027c57a6a9
2 changed files with 38 additions and 23 deletions
+4 -6
View File
@@ -1104,12 +1104,10 @@ function refreshExclusionOverlay() {
const overlayFaceSet = usePrecision ? precisionExcludedFaces : excludedFaces;
_falloffDirty = true;
if (selectionMode) {
const maskGeo = buildExclusionOverlayGeo(overlayGeo, overlayFaceSet, true);
setExclusionOverlay(maskGeo, 0x8ab4d4, 0.96);
} else {
setExclusionOverlay(buildExclusionOverlayGeo(overlayGeo, overlayFaceSet), 0xff6600);
}
// Never show the flat-coloured MeshLambertMaterial overlay — the custom
// shader handles mask visualisation with smooth, view-dependent shading.
setExclusionOverlay(null);
const n = usePrecision ? precisionExcludedFaces.size : excludedFaces.size;
exclCount.textContent = selectionMode
? t(n === 1 ? 'excl.faceSelected' : 'excl.facesSelected', { n: n.toLocaleString() })