From df6d5936c0ae49b9e69f0b8955a348de4abc70a3 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 6 Apr 2026 17:32:56 +0200 Subject: [PATCH] Add contact patch collection for water brushes in viewport-host.js --- src/viewport-three/viewport-host.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/viewport-three/viewport-host.js b/src/viewport-three/viewport-host.js index 25b13e5d..fb8377e7 100644 --- a/src/viewport-three/viewport-host.js +++ b/src/viewport-three/viewport-host.js @@ -2247,7 +2247,10 @@ export class ViewportHost { const brushHovered = this.hoveredSelection.kind === "brushes" && this.hoveredSelection.ids.includes(brush.id); renderObjects.edges.material.color.setHex(brushSelected ? BRUSH_SELECTED_EDGE_COLOR : brushHovered && this.whiteboxSelectionMode === "object" ? BRUSH_HOVERED_EDGE_COLOR : BRUSH_EDGE_COLOR); const previousMaterials = renderObjects.mesh.material; - renderObjects.mesh.material = BOX_FACE_IDS.map((faceId) => this.createFaceMaterial(brush, faceId, this.currentDocument?.materials[brush.faces[faceId].materialId ?? ""], this.getFaceHighlightState(brush.id, faceId), volumeRenderPaths)); + const contactPatches = brush.volume.mode === "water" + ? this.collectViewportWaterContactPatches(this.currentDocument, brush.id, brush.center, brush.rotationDegrees, brush.size) + : []; + renderObjects.mesh.material = BOX_FACE_IDS.map((faceId) => this.createFaceMaterial(brush, faceId, this.currentDocument?.materials[brush.faces[faceId].materialId ?? ""], this.getFaceHighlightState(brush.id, faceId), volumeRenderPaths, contactPatches)); for (const material of previousMaterials) { material.dispose(); }