mirror of
https://github.com/CNCKitchen/stlTexturizer.git
synced 2026-04-07 22:11:32 +00:00
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:
+4
-6
@@ -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() })
|
||||
|
||||
Reference in New Issue
Block a user